书籍模块
This commit is contained in:
@@ -18,8 +18,6 @@ const (
|
||||
BookPublishStatusDraft = "draft"
|
||||
BookPublishStatusOffShelf = "off_shelf"
|
||||
BookPublishStatusOnShelf = "on_shelf"
|
||||
BookAuthorStatusEnabled = "enabled"
|
||||
BookAuthorStatusDisabled = "disabled"
|
||||
BookCommentStatusNormal = "normal"
|
||||
BookCommentStatusHidden = "hidden"
|
||||
)
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user