完善功能

This commit is contained in:
2025-07-16 15:16:40 +08:00
parent b2871ec0d2
commit f68a5b360b
123 changed files with 4643 additions and 931 deletions

View File

@ -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:"是否成功"`
}