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"
}
