Files
xuanzhi-service/server/model/book/book_chapter.go
wdh-home 1e33640629
Some checks failed
CI / init (pull_request) Has been cancelled
CI / Frontend node 18.16.0 (pull_request) Has been cancelled
CI / Backend go (1.22) (pull_request) Has been cancelled
CI / release-pr (pull_request) Has been cancelled
CI / devops-test (1.22, 18.16.0) (pull_request) Has been cancelled
CI / release-please (pull_request) Has been cancelled
CI / devops-prod (1.22, 18.x) (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
基础项目
2026-04-26 15:32:21 +08:00

17 lines
1.1 KiB
Go

package book
type BookChapter struct {
HardDeleteModel
BookID uint `json:"bookId" form:"bookId" gorm:"not null;uniqueIndex:uk_book_chapter_book_id_chapter_no;index:idx_book_chapter_book_id_is_enabled_is_readable;comment:书籍 ID"`
Title string `json:"title" form:"title" gorm:"type:varchar(255);not null;comment:章节标题"`
ChapterNo int `json:"chapterNo" form:"chapterNo" gorm:"not null;uniqueIndex:uk_book_chapter_book_id_chapter_no;comment:章节序号"`
IsReadable bool `json:"isReadable" form:"isReadable" gorm:"not null;default:false;index:idx_book_chapter_book_id_is_enabled_is_readable;comment:是否开放阅读"`
ContentFileUrl string `json:"contentFileUrl" form:"contentFileUrl" gorm:"type:varchar(500);not null;comment:章节正文文件 URL"`
TotalLines int `json:"totalLines" form:"totalLines" gorm:"not null;default:0;comment:正文总行数"`
IsEnabled bool `json:"isEnabled" form:"isEnabled" gorm:"not null;default:true;index:idx_book_chapter_book_id_is_enabled_is_readable;comment:章节是否启用"`
}
func (BookChapter) TableName() string {
return "book_chapter"
}