书籍模块

This commit is contained in:
2026-04-27 10:12:21 +08:00
parent 1e33640629
commit 13db6e89f0
33 changed files with 8820 additions and 738 deletions

View File

@@ -18,8 +18,6 @@ const (
BookPublishStatusDraft = "draft"
BookPublishStatusOffShelf = "off_shelf"
BookPublishStatusOnShelf = "on_shelf"
BookAuthorStatusEnabled = "enabled"
BookAuthorStatusDisabled = "disabled"
BookCommentStatusNormal = "normal"
BookCommentStatusHidden = "hidden"
)

View File

@@ -3,7 +3,7 @@ package book
type BookAuthor struct {
HardDeleteModel
Name string `json:"name" form:"name" gorm:"type:varchar(128);not null;uniqueIndex:uk_book_author_name;comment:作者名称"`
AuthorStatus string `json:"authorStatus" form:"authorStatus" gorm:"type:varchar(32);not null;default:enabled;index;comment:作者状态字典值,对应 book_author_status"`
AuthorStatus string `json:"authorStatus" form:"authorStatus" gorm:"type:varchar(32);not null;default:enabled;index;comment:作者启用状态字典值,对应 common_enabled_status"`
Intro string `json:"intro" form:"intro" gorm:"type:text;comment:作者简介"`
CoverUrl string `json:"coverUrl" form:"coverUrl" gorm:"type:varchar(500);comment:作者头像或封面 URL"`
}

View File

@@ -8,9 +8,17 @@ type BookResponse struct {
type BookAuthorResponse struct {
BookAuthor book.BookAuthor `json:"bookAuthor"`
}
type BookAuthorListItem struct {
book.BookAuthor `gorm:"embedded"`
AuthorName string `json:"authorName" gorm:"column:author_name"`
}
type BookAuthorRelationResponse struct {
BookAuthorRelation book.BookAuthorRelation `json:"bookAuthorRelation"`
}
type BookAuthorRelationListItem struct {
book.BookAuthorRelation `gorm:"embedded"`
AuthorName string `json:"authorName" gorm:"column:author_name"`
}
type BookChapterResponse struct {
BookChapter book.BookChapter `json:"bookChapter"`
}

View File

@@ -0,0 +1,6 @@
package common
const (
CommonEnabledStatusEnabled = "enabled"
CommonEnabledStatusDisabled = "disabled"
)