102 lines
2.7 KiB
Go
102 lines
2.7 KiB
Go
package model
|
||
|
||
import "github.com/gogf/gf/v2/frame/g"
|
||
|
||
type Author 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"`
|
||
}
|
||
|
||
type AuthorListIn struct {
|
||
Page int
|
||
Size int
|
||
PenName string
|
||
Status int
|
||
}
|
||
type AuthorListOut struct {
|
||
Total int
|
||
List []AuthorListItem
|
||
}
|
||
|
||
type AuthorAddIn struct {
|
||
UserId int64
|
||
PenName string
|
||
Bio string
|
||
Status int
|
||
}
|
||
type AuthorEditIn struct {
|
||
Id int64
|
||
PenName string
|
||
Bio string
|
||
Status int
|
||
}
|
||
type AuthorDelIn struct {
|
||
Id int64
|
||
}
|
||
type AuthorCRUDOut struct {
|
||
Success bool
|
||
}
|
||
|
||
type AuthorApplyIn struct {
|
||
UserId int64
|
||
PenName string // 笔名
|
||
Bio string // 作者简介
|
||
}
|
||
type AuthorApplyOut struct {
|
||
Success bool
|
||
}
|
||
type AuthorDetailIn struct {
|
||
AuthorId int64
|
||
}
|
||
type AuthorDetailOut struct {
|
||
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
|
||
}
|