mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-18 09:44:26 +08:00
perf: 优化模型自动更新表字段
This commit is contained in:
@@ -122,6 +122,7 @@ func (c *BookController) Setting() {
|
||||
if book.PrivateToken != "" {
|
||||
book.PrivateToken = conf.URLFor("DocumentController.Index", ":key", book.Identify, "token", book.PrivateToken)
|
||||
}
|
||||
fmt.Println("book.PrintState", book.PrintState)
|
||||
c.Data["Model"] = book
|
||||
|
||||
}
|
||||
@@ -153,6 +154,7 @@ func (c *BookController) SaveBook() {
|
||||
isUseFirstDocument := strings.TrimSpace(c.GetString("is_use_first_document")) == "on"
|
||||
autoSave := strings.TrimSpace(c.GetString("auto_save")) == "on"
|
||||
itemId, _ := c.GetInt("itemId")
|
||||
pringState := strings.TrimSpace(c.GetString("print_state")) == "on"
|
||||
|
||||
if strings.Count(description, "") > 500 {
|
||||
c.JsonResult(6004, i18n.Tr(c.Lang, "message.project_desc_tips"))
|
||||
@@ -211,6 +213,11 @@ func (c *BookController) SaveBook() {
|
||||
} else {
|
||||
book.AutoSave = 0
|
||||
}
|
||||
if pringState {
|
||||
book.PrintSate = 1
|
||||
} else {
|
||||
book.PrintSate = 0
|
||||
}
|
||||
if err := book.Update(); err != nil {
|
||||
c.JsonResult(6006, i18n.Tr(c.Lang, "message.failed"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user