62 lines
1.7 KiB
Go
62 lines
1.7 KiB
Go
package v1
|
|
|
|
import (
|
|
"server/internal/model"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
type BookListReq struct {
|
|
g.Meta `path:"/book" tags:"Book" method:"get" summary:"获取小说列表"`
|
|
Page int `json:"page"`
|
|
Size int `json:"size"`
|
|
Title string `json:"title"`
|
|
CategoryId int64 `json:"categoryId"`
|
|
AuthorId int64 `json:"authorId"`
|
|
Status int `json:"status"`
|
|
IsRecommended int `json:"isRecommended"`
|
|
}
|
|
type BookListRes struct {
|
|
Total int `json:"total"`
|
|
List []model.Book `json:"list"`
|
|
}
|
|
|
|
type BookAddReq struct {
|
|
g.Meta `path:"/book" tags:"Book" method:"post" summary:"新增小说"`
|
|
AuthorId int64 `json:"authorId"`
|
|
CategoryId int64 `json:"categoryId"`
|
|
Title string `json:"title"`
|
|
CoverUrl string `json:"coverUrl"`
|
|
Description string `json:"description"`
|
|
Status int `json:"status"`
|
|
Tags string `json:"tags"`
|
|
IsRecommended int `json:"isRecommended"`
|
|
}
|
|
type BookAddRes struct {
|
|
Success bool `json:"success"`
|
|
}
|
|
|
|
type BookEditReq struct {
|
|
g.Meta `path:"/book" tags:"Book" method:"put" summary:"编辑小说"`
|
|
Id int64 `json:"id"`
|
|
AuthorId int64 `json:"authorId"`
|
|
CategoryId int64 `json:"categoryId"`
|
|
Title string `json:"title"`
|
|
CoverUrl string `json:"coverUrl"`
|
|
Description string `json:"description"`
|
|
Status int `json:"status"`
|
|
Tags string `json:"tags"`
|
|
IsRecommended int `json:"isRecommended"`
|
|
}
|
|
type BookEditRes struct {
|
|
Success bool `json:"success"`
|
|
}
|
|
|
|
type BookDelReq struct {
|
|
g.Meta `path:"/book" tags:"Book" method:"delete" summary:"删除小说"`
|
|
Id int64 `json:"id"`
|
|
}
|
|
type BookDelRes struct {
|
|
Success bool `json:"success"`
|
|
}
|