(c *gin.Context)
| 47 | } |
| 48 | |
| 49 | func ResetModelRatio(c *gin.Context) { |
| 50 | defaultStr := ratio_setting.DefaultModelRatio2JSONString() |
| 51 | err := model.UpdateOption("ModelRatio", defaultStr) |
| 52 | if err != nil { |
| 53 | c.JSON(200, gin.H{ |
| 54 | "success": false, |
| 55 | "message": err.Error(), |
| 56 | }) |
| 57 | return |
| 58 | } |
| 59 | err = ratio_setting.UpdateModelRatioByJSONString(defaultStr) |
| 60 | if err != nil { |
| 61 | c.JSON(200, gin.H{ |
| 62 | "success": false, |
| 63 | "message": err.Error(), |
| 64 | }) |
| 65 | return |
| 66 | } |
| 67 | c.JSON(200, gin.H{ |
| 68 | "success": true, |
| 69 | "message": "重置模型倍率成功", |
| 70 | }) |
| 71 | } |
nothing calls this directly
no test coverage detected