书籍列表接口新增参数

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

@ -18,7 +18,7 @@ type AuthorListIn struct {
}
type AuthorListOut struct {
Total int
List []Author
List []AuthorListItem
}
type AuthorAddIn struct {
@ -41,6 +41,7 @@ type AuthorCRUDOut struct {
}
type AuthorApplyIn struct {
UserId int64
PenName string // 笔名
Bio string // 作者简介
}
@ -51,10 +52,50 @@ type AuthorDetailIn struct {
AuthorId int64
}
type AuthorDetailOut struct {
g.Meta `orm:"table:authors"`
Id int64 `json:"id" orm:"id"`
UserId int64 `json:"userId" orm:"user_id"`
PenName string `json:"penName" orm:"pen_name"`
Bio string `json:"bio" orm:"bio"`
User User `json:"user" orm:"with:id = user_id"`
g.Meta `orm:"table:authors"`
Id int64 `json:"id" orm:"id"` // 作者ID author id
UserId int64 `json:"userId" orm:"user_id"` // 用户ID user id
PenName string `json:"penName" orm:"pen_name"` // 笔名 pen name
Bio string `json:"bio" orm:"bio"` // 作者简介 author bio
FollowerCount int `json:"followerCount" orm:"follower_count"` // 粉丝数量 follower count
User User `json:"user" orm:"with:id = user_id"` // 用户信息 user info
WorksCount int `json:"worksCount" orm:"-"` // 作品数量 works count
IsFollowed bool `json:"isFollowed" orm:"-"` // 是否已关注 is followed
}
type AuthorListItem struct {
g.Meta `orm:"table:authors"`
Id int64 `json:"id"`
UserId int64 `json:"userId"`
User User `json:"user" orm:"with:id = user_id"`
PenName string `json:"penName"`
Bio string `json:"bio"`
FollowerCount int `json:"followerCount"`
Status int `json:"status"`
}
type AuthorInfoIn struct {
UserId int64 // 用户ID
}
type AuthorInfoOut struct {
Id int64 `json:"id"` // 作者ID
PenName string `json:"penName"` // 笔名
Role string `json:"role"` // 角色
}
// 审核作者申请入参
// AuthorReviewIn 用于管理员审核作者申请
// Status: 1=通过3=拒绝
// Remark 可选,记录审核意见
type AuthorReviewIn struct {
AuthorId int64 // 作者ID
Status int // 审核状态 1=通过2=拒绝
Remark string // 审核备注(可选)
}
// 审核作者申请出参
// AuthorReviewOut 返回审核是否成功
type AuthorReviewOut struct {
Success bool
}