mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-19 01:58:00 +08:00
perf: 优化模型自动更新表字段
This commit is contained in:
@@ -82,7 +82,8 @@ type Book struct {
|
||||
//是否使用第一篇文章项目为默认首页,0 否/1 是
|
||||
IsUseFirstDocument int `orm:"column(is_use_first_document);type(int);default(0);description(是否使用第一篇文章项目为默认首页,0 否/1 是)" json:"is_use_first_document"`
|
||||
//是否开启自动保存:0 否/1 是
|
||||
AutoSave int `orm:"column(auto_save);type(tinyint);default(0);description(是否开启自动保存:0 否/1 是)" json:"auto_save"`
|
||||
AutoSave int `orm:"column(auto_save);type(tinyint);default(0);description(是否开启自动保存:0 否/1 是)" json:"auto_save"`
|
||||
PrintSate int `orm:"column(print_state);type(tinyint);default(1);description(启用打印:0 否/1 是)" json:"print_state"`
|
||||
}
|
||||
|
||||
func (book *Book) String() string {
|
||||
|
@@ -71,6 +71,7 @@ type BookResult struct {
|
||||
IsDisplayComment bool `json:"is_display_comment"`
|
||||
IsDownload bool `json:"is_download"`
|
||||
AutoSave bool `json:"auto_save"`
|
||||
PrintState bool `json:"print_state"`
|
||||
Lang string
|
||||
}
|
||||
|
||||
@@ -213,6 +214,7 @@ func (m *BookResult) ToBookResult(book Book) *BookResult {
|
||||
m.HistoryCount = book.HistoryCount
|
||||
m.IsDownload = book.IsDownload == 0
|
||||
m.AutoSave = book.AutoSave == 1
|
||||
m.PrintState = book.PrintSate == 1
|
||||
m.ItemId = book.ItemId
|
||||
m.RoleId = conf.BookRoleNoSpecific
|
||||
|
||||
|
Reference in New Issue
Block a user