Documentation ¶
Overview ¶
书籍模组 其中的书籍查找功能请自行连接数据库编写,此模组暂不提供书籍查找功能
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMenu ¶ added in v0.1.23
func CreateMenu(c *BookChapter, cn *BookContent) error
创建章节信息
c 章节信息 cn 内容信息(该项的ID字段会直接进行覆盖)
Types ¶
type Book ¶ added in v0.1.23
type Book struct { Id uint `gorm:"column:id;type:int unsigned;primaryKey;autoIncrement;not null" form:"id" json:"id"` UserId uint `gorm:"column:user_id;type:INT UNSIGNED;index:user_id;comment:创建人" json:"user_id" form:"user_id"` // 创建人ID Title string `gorm:"column:title;type:varchar(200);comment:书籍标题" form:"title" json:"title"` //书籍标题 Desc string `gorm:"column:desc;type:varchar(500);comment:书籍简单描述" form:"desc" json:"desc"` //书籍简单描述 Content string `gorm:"column:content;type:text;comment:书籍简介" form:"content" json:"content"` //书籍简介 Thumb uint `gorm:"column:thumb;type:int unsigned;comment:书籍封面图片(图片ID)" form:"thumb" json:"thumb"` //书籍封面图片(图片ID) Author string `gorm:"column:author;type:varchar(100);comment:书籍作者" form:"author" json:"author"` //书籍作者 Ids string `gorm:"column:ids;type:varchar(200);comment:书籍出版IDS编号" form:"ids" json:"ids"` //书籍出版IDS编号 PublishDate string `gorm:"column:publish_date;type:date;comment:出版日期" form:"publish_date" json:"publish_date"` //出版日期 PublishShop string `gorm:"column:publish_shop;type:varchar(100);comment:出版商" form:"publish_shop" json:"publish_shop"` //出版商 AuditStatus uint8 `` // 审核状态 0-未审核 98-审核拒绝 99-审核通过 97-放弃审核(编辑以后再次编辑时,会将之前的编辑文章调整为放弃审核状态) /* 274-byte string literal not displayed */ IsDeleted uint8 `gorm:"column:is_deleted;type:tinyint unsigned;comment:是否删除" form:"-" json:"-"` //是否删除 CreatedAt string `gorm:"column:created_at;type:datetime" form:"created_at" json:"created_at"` UpdatedAt string `gorm:"column:updated_at;type:datetime" form:"updated_at" json:"updated_at"` }
书籍表,存储书籍简介等信息
type BookChapter ¶ added in v0.1.23
type BookChapter struct { Id uint `gorm:"column:id;type:int unsigned;primaryKey;autoIncrement;not null" form:"id" json:"id"` BookId uint `gorm:"column:book_id;type:int unsigned;comment:书籍ID" form:"book_id" json:"book_id"` //书籍ID Title string `gorm:"column:title;type:varchar(200);comment:章节标题" form:"title" json:"title"` //章节标题 Fid uint `gorm:"column:fid;type:int unsigned;comment:上级章节/册的ID" form:"fid" json:"fid"` //上级章节/册的ID AuditStatus uint8 `` // 审核状态 0-未审核 98-审核拒绝 99-审核通过 97-放弃审核(编辑以后再次编辑时,会将之前的编辑文章调整为放弃审核状态) /* 255-byte string literal not displayed */ CreatedAt string `gorm:"column:created_at;type:datetime" form:"created_at" json:"created_at"` UpdatedAt string `gorm:"column:updated_at;type:datetime" form:"updated_at" json:"updated_at"` }
书籍章节内容表
type BookContent ¶ added in v0.1.23
type BookContent struct { Id uint `gorm:"column:id;type:int unsigned;primaryKey;not null" form:"id" json:"id"` Content string `gorm:"column:content;type:mediumtext;comment:章节内容" form:"content" json:"content"` //章节内容 Translate string `gorm:"column:translate;type:mediumtext;comment:译文" form:"translate" json:"translate"` //译文 Annotation string `gorm:"column:annotation;type:mediumtext;comment:批注" form:"annotation" json:"annotation"` //批注 }
书籍章节内容表
Click to show internal directories.
Click to hide internal directories.