feat: 支持章节通过 mid 进行访问,优化阅读跳转逻辑。新增章节数据结构,包含章节的 mid 信息,提升用户体验。更新 API 以支持通过 mid 查询章节内容,确保兼容性与灵活性。
This commit is contained in:
@@ -2,9 +2,10 @@ package model
|
||||
|
||||
import "time"
|
||||
|
||||
// Chapter 对应表 chapters(与 Prisma 一致),JSON 小写驼峰
|
||||
// Chapter 对应表 chapters(mid 为自增主键,id 保留业务标识如 1.1、preface)
|
||||
type Chapter struct {
|
||||
ID string `gorm:"column:id;primaryKey;size:20" json:"id"`
|
||||
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"`
|
||||
|
||||
Reference in New Issue
Block a user