Book struct .
| 53 | |
| 54 | // Book struct . |
| 55 | type Book struct { |
| 56 | BookId int `orm:"pk;auto;unique;column(book_id)" json:"book_id"` |
| 57 | ParentId int `orm:"column(parent_id);default(0)"` // 书籍的父级id,一般用于拷贝书籍项目生成新项目的时候 |
| 58 | BookName string `orm:"column(book_name);size(500)" json:"book_name"` // BookName 书籍名称. |
| 59 | Identify string `orm:"column(identify);size(100);unique" json:"identify"` // Identify 书籍唯一标识. |
| 60 | OrderIndex int `orm:"column(order_index);type(int);default(0);index" json:"order_index"` |
| 61 | Pin int `orm:"column(pin);type(int);default(0)" json:"pin"` // pin值,用于首页固定显示 |
| 62 | Description string `orm:"column(description);size(2000)" json:"description"` // Description 书籍描述. |
| 63 | Label string `orm:"column(label);size(500)" json:"label"` |
| 64 | PrivatelyOwned int `orm:"column(privately_owned);type(int);default(0)" json:"privately_owned"` // PrivatelyOwned 书籍私有: 0 公开/ 1 私有 |
| 65 | PrivateToken string `orm:"column(private_token);size(500);null" json:"private_token"` // 当书籍是私有时的访问Token. |
| 66 | Status int `orm:"column(status);type(int);default(0)" json:"status"` //状态:0 正常/1 已删除 |
| 67 | Editor string `orm:"column(editor);size(50)" json:"editor"` //默认的编辑器. |
| 68 | DocCount int `orm:"column(doc_count);type(int)" json:"doc_count"` // DocCount 包含文档数量. |
| 69 | CommentStatus string `orm:"column(comment_status);size(20);default(open)" json:"comment_status"` // CommentStatus 评论设置的状态:open 为允许所有人评论,closed 为不允许评论, group_only 仅允许参与者评论 ,registered_only 仅允许注册者评论. |
| 70 | CommentCount int `orm:"column(comment_count);type(int)" json:"comment_count"` |
| 71 | Cover string `orm:"column(cover);size(1000)" json:"cover"` //封面地址 |
| 72 | Theme string `orm:"column(theme);size(255);default(default)" json:"theme"` //主题风格 |
| 73 | CreateTime time.Time `orm:"type(datetime);column(create_time);auto_now_add" json:"create_time"` // CreateTime 创建时间 . |
| 74 | MemberId int `orm:"column(member_id);size(100);index" json:"member_id"` |
| 75 | ModifyTime time.Time `orm:"type(datetime);column(modify_time);auto_now" json:"modify_time"` |
| 76 | ReleaseTime time.Time `orm:"type(datetime);column(release_time);" json:"release_time"` //书籍发布时间,每次发布都更新一次,如果文档更新时间小于发布时间,则文档不再执行发布 |
| 77 | GenerateTime time.Time `orm:"type(datetime);column(generate_time);" json:"generate_time"` //电子书生成时间 |
| 78 | LastClickGenerate time.Time `orm:"type(datetime);column(last_click_generate)" json:"-"` //上次点击生成电子书的时间,用于显示频繁点击浪费服务器硬件资源的情况 |
| 79 | Version int64 `orm:"type(bigint);column(version);default(0)" json:"version"` |
| 80 | Vcnt int `orm:"column(vcnt);default(0)" json:"vcnt"` // 书籍被阅读次数 |
| 81 | Star int `orm:"column(star);default(0)" json:"star"` // 书籍被收藏次数 |
| 82 | Score int `orm:"column(score);default(40)" json:"score"` // 书籍评分,默认40,即4.0星 |
| 83 | CntScore int // 评分人数 |
| 84 | CntComment int // 评论人数 |
| 85 | Author string `orm:"size(50)"` //原作者,即来源 |
| 86 | AuthorURL string `orm:"column(author_url)"` //原作者链接,即来源链接 |
| 87 | AdTitle string `orm:"default()"` // 文字广告标题 |
| 88 | AdLink string `orm:"default();size(512)"` // 文字广告链接 |
| 89 | Lang string `orm:"size(10);index;default(zh)"` |
| 90 | NavJSON string `orm:"size(8192);default();column(nav_json)"` // 导航栏扩展 |
| 91 | Navs []BookNav `orm:"-" json:"navs"` |
| 92 | } |
| 93 | |
| 94 | type BookNavs []BookNav |
| 95 |
nothing calls this directly
no outgoing calls
no test coverage detected