(c *gin.Context)
| 28 | } |
| 29 | |
| 30 | func GetSetting(c *gin.Context) { |
| 31 | key := c.Query("key") |
| 32 | keys := c.Query("keys") |
| 33 | if key != "" { |
| 34 | item, err := op.GetSettingItemByKey(key) |
| 35 | if err != nil { |
| 36 | common.ErrorResp(c, err, 400) |
| 37 | return |
| 38 | } |
| 39 | common.SuccessResp(c, item) |
| 40 | } else { |
| 41 | items, err := op.GetSettingItemInKeys(strings.Split(keys, ",")) |
| 42 | if err != nil { |
| 43 | common.ErrorResp(c, err, 400) |
| 44 | return |
| 45 | } |
| 46 | common.SuccessResp(c, items) |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func SaveSettings(c *gin.Context) { |
| 51 | var req []model.SettingItem |
nothing calls this directly
no test coverage detected