书籍列表接口新增参数

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

@ -25,8 +25,16 @@ type Book struct {
Tags string `json:"tags" orm:"tags"`
IsRecommended int `json:"isRecommended" orm:"is_recommended"`
IsFeatured int `json:"isFeatured" orm:"is_featured"`
IsHot int `json:"isHot" orm:"is_hot"`
Language string `json:"language" orm:"language"`
}
type SimpleBook struct {
g.Meta `orm:"table:books"`
Id int64 `json:"id" orm:"id"`
AuthorId int64 `json:"authorId" orm:"author_id"`
Author Author `json:"author" orm:"with:id = author_id"`
Title string `json:"title" orm:"title"`
}
// App作者信息结构体
type AppAuthor struct {
@ -112,10 +120,12 @@ type BookAppItem struct {
CurrentReaders int64 `json:"currentReaders" dc:"在读人数" orm:"current_readers"`
Tags string `json:"tags" dc:"标签" orm:"tags"`
IsRecommended int `json:"isRecommended" dc:"是否推荐" orm:"is_recommended"`
IsHot int `json:"isHot" dc:"是否热门" orm:"is_hot"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间" orm:"created_at"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间" orm:"updated_at"`
HasRated bool `json:"hasRated" dc:"当前用户是否已评分"`
MyRating float64 `json:"myRating" dc:"当前用户评分未评分为0"`
IsInBookshelf bool `json:"isInBookshelf" dc:"当前用户是否已加入书架"`
}
// App 书籍列表查询输入参数
@ -129,6 +139,7 @@ type BookAppListIn struct {
UserId int64 `json:"userId" dc:"用户ID"`
AuthorId int `json:"authorId" dc:"作者ID"`
IsFeatured bool `json:"isFeatured" dc:"是否精选"`
IsHot bool `json:"isHot" dc:"是否热门"`
Language string `json:"language" dc:"语言"`
Sort string `json:"sort" dc:"排序字段"`
}
@ -147,25 +158,34 @@ type BookAppDetailIn struct {
// App 书籍详情输出结构体
type BookAppDetailOut struct {
Id int64 `json:"id" dc:"书籍ID"`
AuthorId int64 `json:"authorId" dc:"作者ID"`
CategoryId int64 `json:"categoryId" dc:"分类ID"`
Title string `json:"title" dc:"书名"`
CoverUrl string `json:"coverUrl" dc:"封面图"`
Description string `json:"description" dc:"简介"`
Status int `json:"status" dc:"状态"`
Tags string `json:"tags" dc:"标签"`
IsRecommended int `json:"isRecommended" dc:"是否推荐"`
IsFeatured int `json:"isFeatured" dc:"是否精选"`
Language string `json:"language" dc:"语言"`
Rating float64 `json:"rating" dc:"评分"`
CurrentReaders int64 `json:"currentReaders" dc:"在读人数"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
HasRead bool `json:"hasRead" dc:"是否读过"`
ReadProgress int `json:"readProgress" dc:"阅读进度百分比"`
LastChapterId int64 `json:"lastChapterId" dc:"最近阅读章节ID"`
LastReadAt string `json:"lastReadAt" dc:"最近阅读时间"`
Id int64 `json:"id" dc:"书籍ID" orm:"id"`
CoverUrl string `json:"coverUrl" dc:"封面图" orm:"cover_url"`
Rating float64 `json:"rating" dc:"评分" orm:"rating"`
Title string `json:"title" dc:"标题" orm:"title"`
Description string `json:"description" dc:"简介" orm:"description"`
AuthorId int64 `json:"authorId" dc:"作者ID" orm:"author_id"`
Author AppAuthor `json:"author" dc:"作者信息" orm:"with:id = author_id"`
IsFeatured int `json:"isFeatured" dc:"是否精选" orm:"is_featured"`
Language string `json:"language" dc:"语言" orm:"language"`
CategoryId int64 `json:"categoryId" dc:"分类ID" orm:"category_id"`
Category Category `json:"category" dc:"分类信息" orm:"with:id = category_id"`
Status int `json:"status" dc:"状态" orm:"status"`
WordsCount int `json:"wordsCount" dc:"字数" orm:"words_count"`
ChaptersCount int `json:"chaptersCount" dc:"章节数" orm:"chapters_count"`
ReadCount int64 `json:"readCount" dc:"阅读人数" orm:"read_count"`
CurrentReaders int64 `json:"currentReaders" dc:"在读人数" orm:"current_readers"`
Tags string `json:"tags" dc:"标签" orm:"tags"`
IsRecommended int `json:"isRecommended" dc:"是否推荐" orm:"is_recommended"`
IsHot int `json:"isHot" dc:"是否热门" orm:"is_hot"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间" orm:"created_at"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间" orm:"updated_at"`
HasRated bool `json:"hasRated" dc:"当前用户是否已评分"`
MyRating float64 `json:"myRating" dc:"当前用户评分未评分为0"`
HasRead bool `json:"hasRead" dc:"是否读过"`
ReadProgress int `json:"readProgress" dc:"阅读进度百分比"`
LastChapterId int64 `json:"lastChapterId" dc:"最近阅读章节ID"`
LastReadAt string `json:"lastReadAt" dc:"最近阅读时间"`
IsInBookshelf bool `json:"isInBookshelf" dc:"当前用户是否已加入书架"`
}
// App 用户评分输入参数
@ -207,16 +227,20 @@ type BookRatingCRUDOut struct {
// 我的书籍列表项
// =============================
type MyBookItem struct {
Id int64 `json:"id"`
Title string `json:"title"`
CoverUrl string `json:"coverUrl"`
Description string `json:"description"`
Progress int `json:"progress" dc:"阅读进度百分比"`
IsInShelf bool `json:"isInShelf" dc:"是否在书架"`
LastReadAt string `json:"lastReadAt" dc:"最近阅读时间"`
Status int `json:"status" dc:"书籍状态"`
AuthorId int64 `json:"authorId"`
CategoryId int64 `json:"categoryId"`
g.Meta `orm:"table:books"`
Id int64 `json:"id"`
Title string `json:"title"`
CoverUrl string `json:"coverUrl"`
Description string `json:"description"`
Progress int `json:"progress" dc:"阅读进度百分比"`
IsInShelf bool `json:"isInShelf" dc:"是否在书架"`
LastReadAt string `json:"lastReadAt" dc:"最近阅读时间"`
Status int `json:"status" dc:"书籍状态"`
AuthorId int64 `json:"authorId"`
CategoryId int64 `json:"categoryId"`
Rating float64 `json:"rating" dc:"评分"`
HasRated bool `json:"hasRated" dc:"当前用户是否已评分"`
MyRating float64 `json:"myRating" dc:"当前用户评分未评分为0"`
}
// 我的书籍列表查询参数
@ -248,3 +272,8 @@ type BookSetRecommendedIn struct {
Id int64 `json:"id" dc:"书籍ID"`
IsRecommended int `json:"isRecommended" dc:"是否推荐"`
}
type BookSetHotIn struct {
Id int64 `json:"id" dc:"书籍ID"`
IsHot int `json:"isHot" dc:"是否热门"`
}