书籍列表接口新增参数
This commit is contained in:
@ -18,4 +18,7 @@ type IAuthorV1 interface {
|
||||
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)
|
||||
AuthorInfo(ctx context.Context, req *v1.AuthorInfoReq) (res *v1.AuthorInfoRes, err error)
|
||||
Apply(ctx context.Context, req *v1.ApplyReq) (res *v1.ApplyRes, err error)
|
||||
Review(ctx context.Context, req *v1.ReviewReq) (res *v1.ReviewRes, err error)
|
||||
}
|
||||
|
||||
@ -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:"是否成功"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user