书籍列表接口新增参数

This commit is contained in:
2025-08-13 15:19:42 +08:00
parent 6ccc87f2bf
commit 8afe651c64
201 changed files with 6987 additions and 1066 deletions

View File

@ -1,12 +1,13 @@
package v1
import (
"github.com/gogf/gf/v2/frame/g"
"server/internal/model"
"github.com/gogf/gf/v2/frame/g"
)
type ListReq struct {
g.Meta `path:"/author" tags:"Backend/Admin" method:"get" summary:"获取作者列表"`
g.Meta `path:"/author" tags:"Backend/Author" method:"get" summary:"获取作者列表"`
Page int `json:"page" dc:"页码"`
Size int `json:"size" dc:"每页数量"`
PenName string `json:"penName" dc:"笔名(模糊搜索)"`
@ -18,7 +19,7 @@ type ListRes struct {
}
type AddReq struct {
g.Meta `path:"/author" tags:"Backend/Admin" method:"post" summary:"新增作者"`
g.Meta `path:"/author" tags:"Backend/Author" method:"post" summary:"新增作者"`
UserId int64 `json:"userId" dc:"用户ID" v:"required"`
PenName string `json:"penName" dc:"笔名" v:"required"`
Bio string `json:"bio" dc:"作者简介"`
@ -29,7 +30,7 @@ type AddRes struct {
}
type EditReq struct {
g.Meta `path:"/author" tags:"Backend/Admin" method:"put" summary:"编辑作者"`
g.Meta `path:"/author" tags:"Backend/Author" method:"put" summary:"编辑作者"`
Id int64 `json:"id" dc:"作者ID" v:"required"`
PenName string `json:"penName" dc:"笔名" v:"required"`
Bio string `json:"bio" dc:"作者简介"`
@ -40,7 +41,7 @@ type EditRes struct {
}
type DelReq struct {
g.Meta `path:"/author" tags:"Backend/Admin" method:"delete" summary:"删除作者"`
g.Meta `path:"/author" tags:"Backend/Author" method:"delete" summary:"删除作者"`
Id int64 `json:"id" dc:"作者ID" v:"required"`
}
type DelRes struct {
@ -50,7 +51,7 @@ type DelRes struct {
// 关注作者
// =============================
type FollowReq struct {
g.Meta `path:"/author/follow" tags:"APP" method:"post" summary:"关注作者"`
g.Meta `path:"/author/follow" tags:"APP/Author" method:"post" summary:"关注作者"`
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
}
type FollowRes struct {
@ -60,16 +61,48 @@ type FollowRes struct {
// 取消关注作者
// =============================
type UnfollowReq struct {
g.Meta `path:"/author/unfollow" tags:"APP" method:"post" summary:"取消关注作者"`
g.Meta `path:"/author/unfollow" tags:"APP/Author" 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:"作者详情"`
g.Meta `path:"/author/detail" tags:"APP/Author" method:"get" summary:"作者详情"`
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
}
type DetailRes struct {
Author *model.AuthorDetailOut `json:"author" dc:"作者信息"`
*model.AuthorDetailOut
}
type AuthorInfoReq struct {
g.Meta `path:"/author/info" tags:"Backend/Author" method:"get" summary:"作者基础信息"`
}
type AuthorInfoRes struct {
Id int64 `json:"id"`
PenName string `json:"penName"`
Role string `json:"role"`
}
type ApplyReq struct {
g.Meta `path:"/author/apply" tags:"APP/Author" method:"post" summary:"申请作者"`
Bio string `json:"bio" dc:"作者简介"`
PenName string `json:"penName" dc:"笔名"`
}
type ApplyRes struct {
g.Meta `path:"/author/apply" tags:"APP/Author" method:"post" summary:"申请作者"`
Success bool `json:"success" dc:"是否成功"`
Msg string `json:"msg" dc:"消息"`
}
// 审核作者
// =============================
type ReviewReq struct {
g.Meta `path:"/author/review" tags:"Backend/Author" method:"post" summary:"审核作者申请"`
AuthorId int64 `json:"authorId" dc:"作者ID" v:"required"`
Status int `json:"status" dc:"审核状态1通过3拒绝" v:"required|in:1,3"`
}
type ReviewRes struct {
Success bool `json:"success" dc:"是否成功"`
}