76 lines
2.4 KiB
Go
76 lines
2.4 KiB
Go
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:"作者信息"`
|
||
}
|