Download controller/ratio_config.go from AZILS/new-api: direct link, hf CLI and curl.
- Browser
- Download file 451 Bytes
-
https://huggingface.co/spaces/AZILS/new-api/resolve/main/controller/ratio_config.go
- Command line
-
hf download hf://spaces/AZILS/new-api/controller/ratio_config.go
-
curl -L -o ratio_config.go https://huggingface.co/spaces/AZILS/new-api/resolve/main/controller/ratio_config.go
451 Bytes
| package controller | |
| import ( | |
| "net/http" | |
| "github.com/QuantumNous/new-api/setting/ratio_setting" | |
| "github.com/gin-gonic/gin" | |
| ) | |
| func GetRatioConfig(c *gin.Context) { | |
| if !ratio_setting.IsExposeRatioEnabled() { | |
| c.JSON(http.StatusForbidden, gin.H{ | |
| "success": false, | |
| "message": "倍率配置接口未启用", | |
| }) | |
| return | |
| } | |
| c.JSON(http.StatusOK, gin.H{ | |
| "success": true, | |
| "message": "", | |
| "data": ratio_setting.GetExposedData(), | |
| }) | |
| } | |