Files
soul-yongping/soul-api/internal/model/chapter.go

25 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import "time"
// Chapter 对应表 chaptersmid 为自增主键id 保留业务标识如 1.1、preface
type Chapter struct {
MID int `gorm:"column:mid;primaryKey;autoIncrement" json:"mid"`
ID string `gorm:"column:id;size:20;uniqueIndex" json:"id"`
PartID string `gorm:"column:part_id;size:20" json:"partId"`
PartTitle string `gorm:"column:part_title;size:100" json:"partTitle"`
ChapterID string `gorm:"column:chapter_id;size:20" json:"chapterId"`
ChapterTitle string `gorm:"column:chapter_title;size:200" json:"chapterTitle"`
SectionTitle string `gorm:"column:section_title;size:200" json:"sectionTitle"`
Content string `gorm:"column:content;type:longtext" json:"content,omitempty"`
WordCount *int `gorm:"column:word_count" json:"wordCount,omitempty"`
IsFree *bool `gorm:"column:is_free" json:"isFree,omitempty"`
Price *float64 `gorm:"column:price;type:decimal(10,2)" json:"price,omitempty"`
SortOrder *int `gorm:"column:sort_order" json:"sortOrder,omitempty"`
Status *string `gorm:"column:status;size:20" json:"status,omitempty"`
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
}
func (Chapter) TableName() string { return "chapters" }