完善功能
This commit is contained in:
@ -11,6 +11,6 @@ import (
|
||||
)
|
||||
|
||||
type IAdminV1 interface {
|
||||
AdminInfo(ctx context.Context, req *v1.AdminInfoReq) (res *v1.AdminInfoRes, err error)
|
||||
AdminEditPass(ctx context.Context, req *v1.AdminEditPassReq) (res *v1.AdminEditPassRes, err error)
|
||||
Info(ctx context.Context, req *v1.InfoReq) (res *v1.InfoRes, err error)
|
||||
EditPass(ctx context.Context, req *v1.EditPassReq) (res *v1.EditPassRes, err error)
|
||||
}
|
||||
|
||||
@ -4,21 +4,21 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type AdminInfoReq struct {
|
||||
g.Meta `path:"/admin/info" tags:"Admin" method:"get" summary:"管理员信息"`
|
||||
type InfoReq struct {
|
||||
g.Meta `path:"/admin/info" tags:"Backend/Admin" method:"get" summary:"管理员信息"`
|
||||
}
|
||||
type AdminInfoRes struct {
|
||||
type InfoRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
AdminId int64 `json:"adminId"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
type AdminEditPassReq struct {
|
||||
g.Meta `path:"/admin/editPass" tags:"Admin" method:"post" summary:"修改密码"`
|
||||
type EditPassReq struct {
|
||||
g.Meta `path:"/admin/editPass" tags:"Backend/Admin" method:"post" summary:"修改密码"`
|
||||
OldPass string `json:"oldPass" v:"required" dc:"旧密码"`
|
||||
NewPass string `json:"newPass" v:"required" dc:"新密码"`
|
||||
}
|
||||
type AdminEditPassRes struct {
|
||||
type EditPassRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
Success bool
|
||||
}
|
||||
|
||||
21
api/author/author.go
Normal file
21
api/author/author.go
Normal file
@ -0,0 +1,21 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package author
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"server/api/author/v1"
|
||||
)
|
||||
|
||||
type IAuthorV1 interface {
|
||||
List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error)
|
||||
Add(ctx context.Context, req *v1.AddReq) (res *v1.AddRes, err error)
|
||||
Edit(ctx context.Context, req *v1.EditReq) (res *v1.EditRes, err error)
|
||||
Del(ctx context.Context, req *v1.DelReq) (res *v1.DelRes, err error)
|
||||
Follow(ctx context.Context, req *v1.FollowReq) (res *v1.FollowRes, err error)
|
||||
Unfollow(ctx context.Context, req *v1.UnfollowReq) (res *v1.UnfollowRes, err error)
|
||||
Detail(ctx context.Context, req *v1.DetailReq) (res *v1.DetailRes, err error)
|
||||
}
|
||||
75
api/author/v1/author.go
Normal file
75
api/author/v1/author.go
Normal file
@ -0,0 +1,75 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"server/internal/model"
|
||||
)
|
||||
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/author" tags:"Backend/Admin" method:"get" summary:"获取作者列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
PenName string `json:"penName" dc:"笔名(模糊搜索)"`
|
||||
Status int `json:"status" dc:"状态:1正常,2禁用"`
|
||||
}
|
||||
type ListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List interface{} `json:"list" dc:"作者列表"`
|
||||
}
|
||||
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/author" tags:"Backend/Admin" method:"post" summary:"新增作者"`
|
||||
UserId int64 `json:"userId" dc:"用户ID" v:"required"`
|
||||
PenName string `json:"penName" dc:"笔名" v:"required"`
|
||||
Bio string `json:"bio" dc:"作者简介"`
|
||||
Status int `json:"status" dc:"状态:1正常,2禁用"`
|
||||
}
|
||||
type AddRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/author" tags:"Backend/Admin" method:"put" summary:"编辑作者"`
|
||||
Id int64 `json:"id" dc:"作者ID" v:"required"`
|
||||
PenName string `json:"penName" dc:"笔名" v:"required"`
|
||||
Bio string `json:"bio" dc:"作者简介"`
|
||||
Status int `json:"status" dc:"状态:1正常,2禁用"`
|
||||
}
|
||||
type EditRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type DelReq struct {
|
||||
g.Meta `path:"/author" tags:"Backend/Admin" method:"delete" summary:"删除作者"`
|
||||
Id int64 `json:"id" dc:"作者ID" v:"required"`
|
||||
}
|
||||
type DelRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// 关注作者
|
||||
// =============================
|
||||
type FollowReq struct {
|
||||
g.Meta `path:"/author/follow" tags:"APP" method:"post" summary:"关注作者"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
}
|
||||
type FollowRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// 取消关注作者
|
||||
// =============================
|
||||
type UnfollowReq struct {
|
||||
g.Meta `path:"/author/unfollow" tags:"APP" method:"post" summary:"取消关注作者"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
}
|
||||
type UnfollowRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
type DetailReq struct {
|
||||
g.Meta `path:"/author/detail" tags:"APP" method:"get" summary:"作者详情"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
}
|
||||
type DetailRes struct {
|
||||
Author *model.AuthorDetailOut `json:"author" dc:"作者信息"`
|
||||
}
|
||||
@ -11,8 +11,16 @@ import (
|
||||
)
|
||||
|
||||
type IBookV1 interface {
|
||||
BookList(ctx context.Context, req *v1.BookListReq) (res *v1.BookListRes, err error)
|
||||
BookAdd(ctx context.Context, req *v1.BookAddReq) (res *v1.BookAddRes, err error)
|
||||
BookEdit(ctx context.Context, req *v1.BookEditReq) (res *v1.BookEditRes, err error)
|
||||
BookDel(ctx context.Context, req *v1.BookDelReq) (res *v1.BookDelRes, err error)
|
||||
List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error)
|
||||
Add(ctx context.Context, req *v1.AddReq) (res *v1.AddRes, err error)
|
||||
Edit(ctx context.Context, req *v1.EditReq) (res *v1.EditRes, err error)
|
||||
Del(ctx context.Context, req *v1.DelReq) (res *v1.DelRes, err error)
|
||||
ShelfAdd(ctx context.Context, req *v1.ShelfAddReq) (res *v1.ShelfAddRes, err error)
|
||||
ShelfRemove(ctx context.Context, req *v1.ShelfRemoveReq) (res *v1.ShelfRemoveRes, err error)
|
||||
AppList(ctx context.Context, req *v1.AppListReq) (res *v1.AppListRes, err error)
|
||||
AppDetail(ctx context.Context, req *v1.AppDetailReq) (res *v1.AppDetailRes, err error)
|
||||
AppRate(ctx context.Context, req *v1.AppRateReq) (res *v1.AppRateRes, err error)
|
||||
MyList(ctx context.Context, req *v1.MyListReq) (res *v1.MyListRes, err error)
|
||||
BookSetFeatured(ctx context.Context, req *v1.BookSetFeaturedReq) (res *v1.BookSetFeaturedRes, err error)
|
||||
BookSetRecommended(ctx context.Context, req *v1.BookSetRecommendedReq) (res *v1.BookSetRecommendedRes, err error)
|
||||
}
|
||||
|
||||
@ -6,56 +6,180 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type BookListReq struct {
|
||||
g.Meta `path:"/book" tags:"Book" method:"get" summary:"获取小说列表"`
|
||||
Page int `json:"page"`
|
||||
Size int `json:"size"`
|
||||
Title string `json:"title"`
|
||||
CategoryId int64 `json:"categoryId"`
|
||||
AuthorId int64 `json:"authorId"`
|
||||
Status int `json:"status"`
|
||||
IsRecommended int `json:"isRecommended"`
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/book" tags:"Backend/Author" method:"get" summary:"获取小说列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Title string `json:"title" dc:"书名模糊搜索"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
IsRecommended int `json:"isRecommended" dc:"是否推荐"`
|
||||
Sort string `json:"sort" dc:"排序字段"`
|
||||
}
|
||||
type BookListRes struct {
|
||||
Total int `json:"total"`
|
||||
List []model.Book `json:"list"`
|
||||
type ListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.Book `json:"list" dc:"书籍列表"`
|
||||
}
|
||||
|
||||
type BookAddReq struct {
|
||||
g.Meta `path:"/book" tags:"Book" method:"post" summary:"新增小说"`
|
||||
AuthorId int64 `json:"authorId"`
|
||||
CategoryId int64 `json:"categoryId"`
|
||||
Title string `json:"title"`
|
||||
CoverUrl string `json:"coverUrl"`
|
||||
Description string `json:"description"`
|
||||
Status int `json:"status"`
|
||||
Tags string `json:"tags"`
|
||||
IsRecommended int `json:"isRecommended"`
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/book" tags:"Backend/Author" method:"post" summary:"新增小说"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID" v:"required"`
|
||||
Title string `json:"title" dc:"书名" v:"required"`
|
||||
CoverUrl string `json:"coverUrl" dc:"封面图"`
|
||||
Description string `json:"description" dc:"简介"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
Tags string `json:"tags" dc:"标签"`
|
||||
IsRecommended int `json:"isRecommended" dc:"是否推荐"`
|
||||
IsFeatured int `json:"isFeatured" dc:"是否精选"`
|
||||
Language string `json:"language" dc:"语言"`
|
||||
}
|
||||
type BookAddRes struct {
|
||||
Success bool `json:"success"`
|
||||
type AddRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type BookEditReq struct {
|
||||
g.Meta `path:"/book" tags:"Book" method:"put" summary:"编辑小说"`
|
||||
Id int64 `json:"id"`
|
||||
AuthorId int64 `json:"authorId"`
|
||||
CategoryId int64 `json:"categoryId"`
|
||||
Title string `json:"title"`
|
||||
CoverUrl string `json:"coverUrl"`
|
||||
Description string `json:"description"`
|
||||
Status int `json:"status"`
|
||||
Tags string `json:"tags"`
|
||||
IsRecommended int `json:"isRecommended"`
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/book" tags:"Backend/Author" method:"put" summary:"编辑小说"`
|
||||
Id int64 `json:"id" dc:"书籍ID" v:"required"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID" v:"required"`
|
||||
Title string `json:"title" dc:"书名" v:"required"`
|
||||
CoverUrl string `json:"coverUrl" dc:"封面图"`
|
||||
Description string `json:"description" dc:"简介"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
Tags string `json:"tags" dc:"标签"`
|
||||
IsRecommended int `json:"isRecommended" dc:"是否推荐"`
|
||||
IsFeatured int `json:"isFeatured" dc:"是否精选"`
|
||||
Language string `json:"language" dc:"语言"`
|
||||
}
|
||||
type BookEditRes struct {
|
||||
Success bool `json:"success"`
|
||||
type EditRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type BookDelReq struct {
|
||||
g.Meta `path:"/book" tags:"Book" method:"delete" summary:"删除小说"`
|
||||
Id int64 `json:"id"`
|
||||
type DelReq struct {
|
||||
g.Meta `path:"/book" tags:"Backend/Author" method:"delete" summary:"删除小说"`
|
||||
Id int64 `json:"id" dc:"书籍ID" v:"required"`
|
||||
}
|
||||
type BookDelRes struct {
|
||||
Success bool `json:"success"`
|
||||
type DelRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// 加入书架
|
||||
type ShelfAddReq struct {
|
||||
g.Meta `path:"/book/shelf/add" tags:"APP" method:"post" summary:"加入书架"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID" v:"required"`
|
||||
}
|
||||
type ShelfAddRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// 移除书架
|
||||
type ShelfRemoveReq struct {
|
||||
g.Meta `path:"/book/shelf/remove" tags:"APP" method:"post" summary:"移除书架(支持批量)"`
|
||||
BookIds []int64 `json:"bookIds" dc:"小说ID列表" v:"required"`
|
||||
}
|
||||
type ShelfRemoveRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
// App 获取书籍列表
|
||||
type AppListReq struct {
|
||||
g.Meta `path:"/book/app/list" tags:"APP" method:"get" summary:"App获取书籍列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
IsRecommended bool `json:"isRecommended" dc:"是否推荐"`
|
||||
IsFeatured bool `json:"isFeatured" dc:"是否精选"`
|
||||
IsLatest int `json:"isLatest" dc:"是否最新"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID"`
|
||||
Title string `json:"title" dc:"书名模糊搜索"`
|
||||
AuthorId int `json:"authorId" dc:"作者ID"`
|
||||
Language string `json:"language" dc:"语言"`
|
||||
Sort string `json:"sort" dc:"排序字段"`
|
||||
}
|
||||
type AppListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.BookAppItem `json:"list" dc:"书籍列表"`
|
||||
}
|
||||
|
||||
// App 获取书籍详情
|
||||
type AppDetailReq struct {
|
||||
g.Meta `path:"/book/app/detail" tags:"APP" method:"get" summary:"App获取书籍详情"`
|
||||
Id int64 `json:"id" dc:"书籍ID" v:"required"`
|
||||
}
|
||||
type AppDetailRes struct {
|
||||
Id int64 `json:"id" dc:"书籍ID"`
|
||||
AuthorId int64 `json:"authorId" dc:"作者ID"`
|
||||
CategoryId int64 `json:"categoryId" dc:"分类ID"`
|
||||
Title string `json:"title" dc:"书名"`
|
||||
CoverUrl string `json:"coverUrl" dc:"封面图"`
|
||||
Description string `json:"description" dc:"简介"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
Tags string `json:"tags" dc:"标签"`
|
||||
IsRecommended int `json:"isRecommended" dc:"是否推荐"`
|
||||
IsFeatured int `json:"isFeatured" dc:"是否精选"`
|
||||
Language string `json:"language" dc:"语言"`
|
||||
Rating float64 `json:"rating" dc:"评分"`
|
||||
CurrentReaders int64 `json:"currentReaders" dc:"在读人数"`
|
||||
CreatedAt string `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt string `json:"updatedAt" dc:"更新时间"`
|
||||
HasRead bool `json:"hasRead" dc:"是否读过"`
|
||||
ReadProgress int `json:"readProgress" dc:"阅读进度百分比"`
|
||||
LastChapterId int64 `json:"lastChapterId" dc:"最近阅读章节ID"`
|
||||
LastReadAt string `json:"lastReadAt" dc:"最近阅读时间"`
|
||||
}
|
||||
|
||||
// App 用户评分
|
||||
type AppRateReq struct {
|
||||
g.Meta `path:"/book/app/rate" tags:"APP" method:"post" summary:"App用户评分"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID" v:"required"`
|
||||
Rating float64 `json:"rating" dc:"评分(1-10分)" v:"required"`
|
||||
}
|
||||
type AppRateRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type BookAppItem struct {
|
||||
Id int64 `json:"id" dc:"书籍ID"`
|
||||
CoverUrl string `json:"coverUrl" dc:"封面图"`
|
||||
Rating float64 `json:"rating" dc:"评分"`
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Description string `json:"description" dc:"简介"`
|
||||
HasRated bool `json:"hasRated" dc:"当前用户是否已评分"`
|
||||
MyRating float64 `json:"myRating" dc:"当前用户评分(未评分为0)"`
|
||||
}
|
||||
|
||||
// 我的书籍列表
|
||||
// =============================
|
||||
type MyListReq struct {
|
||||
g.Meta `path:"/book/app/my-books" tags:"APP" method:"get" summary:"获取我的书籍列表"`
|
||||
Type int `json:"type" dc:"类型:1-正在读 2-已读完 3-历史记录" v:"required"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Sort string `json:"sort" dc:"排序字段"`
|
||||
}
|
||||
type MyListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.MyBookItem `json:"list" dc:"书籍列表"`
|
||||
}
|
||||
|
||||
// =============================
|
||||
// 新增:单独修改精选状态和推荐状态
|
||||
// =============================
|
||||
type BookSetFeaturedReq struct {
|
||||
g.Meta `path:"/book/set-featured" tags:"Backend/Book" method:"post" summary:"设置书籍精选状态"`
|
||||
Id int64 `json:"id" dc:"书籍ID" v:"required"`
|
||||
IsFeatured int `json:"isFeatured" dc:"是否精选" v:"required"`
|
||||
}
|
||||
type BookSetFeaturedRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type BookSetRecommendedReq struct {
|
||||
g.Meta `path:"/book/set-recommended" tags:"Backend/Book" method:"post" summary:"设置书籍推荐状态"`
|
||||
Id int64 `json:"id" dc:"书籍ID" v:"required"`
|
||||
IsRecommended int `json:"isRecommended" dc:"是否推荐" v:"required"`
|
||||
}
|
||||
type BookSetRecommendedRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
@ -11,8 +11,8 @@ import (
|
||||
)
|
||||
|
||||
type ICategoryV1 interface {
|
||||
CategoryList(ctx context.Context, req *v1.CategoryListReq) (res *v1.CategoryListRes, err error)
|
||||
CategoryAdd(ctx context.Context, req *v1.CategoryAddReq) (res *v1.CategoryAddRes, err error)
|
||||
CategoryEdit(ctx context.Context, req *v1.CategoryEditReq) (res *v1.CategoryEditRes, err error)
|
||||
CategoryDel(ctx context.Context, req *v1.CategoryDelReq) (res *v1.CategoryDelRes, err error)
|
||||
List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error)
|
||||
Add(ctx context.Context, req *v1.AddReq) (res *v1.AddRes, err error)
|
||||
Edit(ctx context.Context, req *v1.EditReq) (res *v1.EditRes, err error)
|
||||
Del(ctx context.Context, req *v1.DelReq) (res *v1.DelRes, err error)
|
||||
}
|
||||
|
||||
@ -6,41 +6,41 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type CategoryListReq struct {
|
||||
g.Meta `path:"/category" tags:"Category" method:"get" summary:"获取分类列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Name string `json:"name" dc:"分类名称(模糊搜索)"`
|
||||
Type int `json:"type" dc:"类型,1男频,2女频"`
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/category" tags:"APP" method:"get" summary:"获取分类列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
Name string `json:"name" dc:"分类名称(模糊搜索)"`
|
||||
Channel int `json:"channel" dc:"频道类型:1=男频,2=女频"`
|
||||
}
|
||||
type CategoryListRes struct {
|
||||
type ListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.Category `json:"list" dc:"分类列表"`
|
||||
}
|
||||
|
||||
type CategoryAddReq struct {
|
||||
g.Meta `path:"/category" tags:"Category" method:"post" summary:"新增分类"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
Type int `json:"type" dc:"类型,1男频,2女频"`
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/category" tags:"Backend/Admin" method:"post" summary:"新增分类"`
|
||||
Name string `json:"name" dc:"分类名称" v:"required"`
|
||||
Channel int `json:"channel" dc:"频道类型:1=男频,2=女频" v:"required"`
|
||||
}
|
||||
type CategoryAddRes struct {
|
||||
type AddRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type CategoryEditReq struct {
|
||||
g.Meta `path:"/category" tags:"Category" method:"put" summary:"编辑分类"`
|
||||
Id int `json:"id" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
Type int `json:"type" dc:"类型,1男频,2女频"`
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/category" tags:"Backend/Admin" method:"put" summary:"编辑分类"`
|
||||
Id int64 `json:"id" dc:"分类ID" v:"required"`
|
||||
Name string `json:"name" dc:"分类名称" v:"required"`
|
||||
Channel int `json:"channel" dc:"频道类型:1=男频,2=女频" v:"required"`
|
||||
}
|
||||
type CategoryEditRes struct {
|
||||
type EditRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type CategoryDelReq struct {
|
||||
g.Meta `path:"/category" tags:"Category" method:"delete" summary:"删除分类"`
|
||||
Id int `json:"id" dc:"分类ID"`
|
||||
type DelReq struct {
|
||||
g.Meta `path:"/category" tags:"Backend/Admin" method:"delete" summary:"删除分类"`
|
||||
Id int64 `json:"id" dc:"分类ID" v:"required"`
|
||||
}
|
||||
type CategoryDelRes struct {
|
||||
type DelRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
@ -11,8 +11,12 @@ import (
|
||||
)
|
||||
|
||||
type IChapterV1 interface {
|
||||
ChapterList(ctx context.Context, req *v1.ChapterListReq) (res *v1.ChapterListRes, err error)
|
||||
ChapterAdd(ctx context.Context, req *v1.ChapterAddReq) (res *v1.ChapterAddRes, err error)
|
||||
ChapterEdit(ctx context.Context, req *v1.ChapterEditReq) (res *v1.ChapterEditRes, err error)
|
||||
ChapterDel(ctx context.Context, req *v1.ChapterDelReq) (res *v1.ChapterDelRes, err error)
|
||||
List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error)
|
||||
Add(ctx context.Context, req *v1.AddReq) (res *v1.AddRes, err error)
|
||||
Edit(ctx context.Context, req *v1.EditReq) (res *v1.EditRes, err error)
|
||||
Del(ctx context.Context, req *v1.DelReq) (res *v1.DelRes, err error)
|
||||
AppList(ctx context.Context, req *v1.AppListReq) (res *v1.AppListRes, err error)
|
||||
AppDetail(ctx context.Context, req *v1.AppDetailReq) (res *v1.AppDetailRes, err error)
|
||||
AppPurchase(ctx context.Context, req *v1.AppPurchaseReq) (res *v1.AppPurchaseRes, err error)
|
||||
AppProgress(ctx context.Context, req *v1.AppProgressReq) (res *v1.AppProgressRes, err error)
|
||||
}
|
||||
|
||||
@ -6,52 +6,98 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type ChapterListReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Chapter" method:"get" summary:"获取章节列表"`
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Backend/Author" method:"get" summary:"获取章节列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID"`
|
||||
Title string `json:"title" dc:"章节标题(模糊搜索)"`
|
||||
IsLocked int `json:"isLocked" dc:"是否锁定:0免费,1需积分解锁"`
|
||||
}
|
||||
type ChapterListRes struct {
|
||||
type ListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.Chapter `json:"list" dc:"章节列表"`
|
||||
}
|
||||
|
||||
type ChapterAddReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Chapter" method:"post" summary:"新增章节"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID"`
|
||||
Title string `json:"title" dc:"章节标题"`
|
||||
Content string `json:"content" dc:"章节内容"`
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Backend/Author" method:"post" summary:"新增章节"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID" v:"required"`
|
||||
Title string `json:"title" dc:"章节标题" v:"required"`
|
||||
Content string `json:"content" dc:"章节内容" v:"required"`
|
||||
WordCount int `json:"wordCount" dc:"章节字数"`
|
||||
Sort int `json:"sort" dc:"排序序号"`
|
||||
IsLocked int `json:"isLocked" dc:"是否锁定:0免费,1需积分解锁"`
|
||||
RequiredScore int `json:"requiredScore" dc:"解锁所需积分"`
|
||||
}
|
||||
type ChapterAddRes struct {
|
||||
type AddRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type ChapterEditReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Chapter" method:"put" summary:"编辑章节"`
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Backend/Author" method:"put" summary:"编辑章节"`
|
||||
Id int64 `json:"id" dc:"章节ID" v:"required"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID" v:"required"`
|
||||
Title string `json:"title" dc:"章节标题" v:"required"`
|
||||
Content string `json:"content" dc:"章节内容" v:"required"`
|
||||
WordCount int `json:"wordCount" dc:"章节字数"`
|
||||
Sort int `json:"sort" dc:"排序序号"`
|
||||
IsLocked int `json:"isLocked" dc:"是否锁定:0免费,1需积分解锁"`
|
||||
RequiredScore int `json:"requiredScore" dc:"解锁所需积分"`
|
||||
}
|
||||
type EditRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type DelReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Backend/Author" method:"delete" summary:"删除章节"`
|
||||
Id int64 `json:"id" dc:"章节ID" v:"required"`
|
||||
}
|
||||
type DelRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type AppListReq struct {
|
||||
g.Meta `path:"/chapter/app/list" tags:"APP" method:"get" summary:"App获取章节列表"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID" v:"required"`
|
||||
IsDesc bool `json:"isDesc" dc:"是否逆序排列"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
}
|
||||
type AppListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.ChapterAppItem `json:"list" dc:"章节列表"`
|
||||
}
|
||||
|
||||
type AppDetailReq struct {
|
||||
g.Meta `path:"/chapter/app/detail" tags:"APP" method:"get" summary:"App获取章节详情"`
|
||||
Id int64 `json:"id" dc:"章节ID" v:"required"`
|
||||
}
|
||||
type AppDetailRes struct {
|
||||
Id int64 `json:"id" dc:"章节ID"`
|
||||
BookId int64 `json:"bookId" dc:"小说ID"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID"`
|
||||
Title string `json:"title" dc:"章节标题"`
|
||||
Content string `json:"content" dc:"章节内容"`
|
||||
WordCount int `json:"wordCount" dc:"章节字数"`
|
||||
Sort int `json:"sort" dc:"排序序号"`
|
||||
IsLocked int `json:"isLocked" dc:"是否锁定:0免费,1需积分解锁"`
|
||||
RequiredScore int `json:"requiredScore" dc:"解锁所需积分"`
|
||||
WordCount int `json:"wordCount" dc:"字数"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
IsLocked int `json:"isLocked" dc:"是否锁定"`
|
||||
RequiredScore int `json:"requiredScore" dc:"所需积分"`
|
||||
UpdatedAt string `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
type ChapterEditRes struct {
|
||||
|
||||
type AppPurchaseReq struct {
|
||||
g.Meta `path:"/chapter/app/purchase" tags:"APP" method:"post" summary:"App购买章节"`
|
||||
Id int64 `json:"id" dc:"章节ID" v:"required"`
|
||||
}
|
||||
type AppPurchaseRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type ChapterDelReq struct {
|
||||
g.Meta `path:"/chapter" tags:"Chapter" method:"delete" summary:"删除章节"`
|
||||
Id int64 `json:"id" dc:"章节ID"`
|
||||
type AppProgressReq struct {
|
||||
g.Meta `path:"/chapter/app/progress" tags:"APP" method:"post" summary:"App上传阅读进度"`
|
||||
BookId int64 `json:"bookId" dc:"书籍ID" v:"required"`
|
||||
ChapterId int64 `json:"chapterId" dc:"章节ID" v:"required"`
|
||||
Progress int `json:"progress" dc:"阅读进度百分比(0-100)"`
|
||||
}
|
||||
type ChapterDelRes struct {
|
||||
type AppProgressRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
@ -11,6 +11,6 @@ import (
|
||||
)
|
||||
|
||||
type IFeedbackV1 interface {
|
||||
FeedbackList(ctx context.Context, req *v1.FeedbackListReq) (res *v1.FeedbackListRes, err error)
|
||||
FeedbackAdd(ctx context.Context, req *v1.FeedbackAddReq) (res *v1.FeedbackAddRes, err error)
|
||||
List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error)
|
||||
Add(ctx context.Context, req *v1.AddReq) (res *v1.AddRes, err error)
|
||||
}
|
||||
|
||||
@ -6,22 +6,22 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type FeedbackListReq struct {
|
||||
g.Meta `path:"/feedback" tags:"Feedback" method:"get" summary:"获取反馈列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
UserId int64 `json:"userId" dc:"用户ID"`
|
||||
Status int `json:"status" dc:"处理状态:1未处理,2处理中,3已处理"`
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/feedback" tags:"Backend/Admin" method:"get" summary:"获取反馈列表"`
|
||||
Page int `json:"page" dc:"页码"`
|
||||
Size int `json:"size" dc:"每页数量"`
|
||||
UserId int64 `json:"userId" dc:"用户ID"`
|
||||
Status int `json:"status" dc:"处理状态:1未处理,2处理中,3已处理"`
|
||||
}
|
||||
type FeedbackListRes struct {
|
||||
type ListRes struct {
|
||||
Total int `json:"total" dc:"总数"`
|
||||
List []model.Feedback `json:"list" dc:"反馈列表"`
|
||||
}
|
||||
|
||||
type FeedbackAddReq struct {
|
||||
g.Meta `path:"/feedback" tags:"APP/Feedback" method:"post" summary:"新增反馈"`
|
||||
Content string `json:"content" dc:"反馈内容"`
|
||||
type AddReq struct {
|
||||
g.Meta `path:"/feedback" tags:"APP" method:"post" summary:"新增反馈"`
|
||||
Content string `json:"content" dc:"反馈内容" v:"required"`
|
||||
}
|
||||
type FeedbackAddRes struct {
|
||||
type AddRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
type IUserV1 interface {
|
||||
UserInfo(ctx context.Context, req *v1.UserInfoReq) (res *v1.UserInfoRes, err error)
|
||||
Info(ctx context.Context, req *v1.InfoReq) (res *v1.InfoRes, err error)
|
||||
Delete(ctx context.Context, req *v1.DeleteReq) (res *v1.DeleteRes, err error)
|
||||
Logout(ctx context.Context, req *v1.LogoutReq) (res *v1.LogoutRes, err error)
|
||||
}
|
||||
|
||||
@ -4,10 +4,10 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type UserInfoReq struct {
|
||||
g.Meta `path:"/user/info" tags:"APP/User" method:"get" summary:"获取用户信息"`
|
||||
type InfoReq struct {
|
||||
g.Meta `path:"/user/info" tags:"APP" method:"get" summary:"获取用户信息"`
|
||||
}
|
||||
type UserInfoRes struct {
|
||||
type InfoRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
UserId int64 `json:"userId"`
|
||||
Username string `json:"username"` // 用户名
|
||||
@ -17,7 +17,7 @@ type UserInfoRes struct {
|
||||
}
|
||||
|
||||
type DeleteReq struct {
|
||||
g.Meta `path:"/user/delete" tags:"APP/User" method:"post" summary:"删除用户"`
|
||||
g.Meta `path:"/user/delete" tags:"APP" method:"post" summary:"删除用户"`
|
||||
Password string `json:"password" v:"required" dc:"密码"`
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ type DeleteRes struct {
|
||||
}
|
||||
|
||||
type LogoutReq struct {
|
||||
g.Meta `path:"/user/logout" tags:"APP/User" method:"post" summary:"登出"`
|
||||
g.Meta `path:"/user/logout" tags:"APP" method:"post" summary:"登出"`
|
||||
}
|
||||
type LogoutRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
|
||||
Reference in New Issue
Block a user