mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-07 09:43:43 +08:00
feat: system notice function is ready
This commit is contained in:
@@ -33,8 +33,9 @@ func (h *ConfigHandler) Update(c *gin.Context) {
|
||||
resp.ERROR(c, types.InvalidArgs)
|
||||
return
|
||||
}
|
||||
str := utils.JsonEncode(&data.Config)
|
||||
config := model.Config{Key: data.Key, Config: str}
|
||||
|
||||
value := utils.JsonEncode(&data.Config)
|
||||
config := model.Config{Key: data.Key, Config: value}
|
||||
res := h.db.FirstOrCreate(&config, model.Config{Key: data.Key})
|
||||
if res.Error != nil {
|
||||
resp.ERROR(c, res.Error.Error())
|
||||
@@ -42,7 +43,7 @@ func (h *ConfigHandler) Update(c *gin.Context) {
|
||||
}
|
||||
|
||||
if config.Id > 0 {
|
||||
config.Config = str
|
||||
config.Config = value
|
||||
res := h.db.Updates(&config)
|
||||
if res.Error != nil {
|
||||
resp.ERROR(c, res.Error.Error())
|
||||
|
||||
Reference in New Issue
Block a user