MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / ResetModelRatio

Function ResetModelRatio

controller/pricing.go:49–71  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

47}
48
49func 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}

Callers

nothing calls this directly

Calls 4

UpdateOptionFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected