(c *gin.Context)
| 219 | } |
| 220 | |
| 221 | func FetchUpstreamModels(c *gin.Context) { |
| 222 | id, err := strconv.Atoi(c.Param("id")) |
| 223 | if err != nil { |
| 224 | common.ApiError(c, err) |
| 225 | return |
| 226 | } |
| 227 | |
| 228 | channel, err := model.GetChannelById(id, true) |
| 229 | if err != nil { |
| 230 | common.ApiError(c, err) |
| 231 | return |
| 232 | } |
| 233 | |
| 234 | ids, err := fetchChannelUpstreamModelIDs(channel) |
| 235 | if err != nil { |
| 236 | c.JSON(http.StatusOK, gin.H{ |
| 237 | "success": false, |
| 238 | "message": fmt.Sprintf("获取模型列表失败: %s", err.Error()), |
| 239 | }) |
| 240 | return |
| 241 | } |
| 242 | |
| 243 | c.JSON(http.StatusOK, gin.H{ |
| 244 | "success": true, |
| 245 | "message": "", |
| 246 | "data": ids, |
| 247 | }) |
| 248 | } |
| 249 | |
| 250 | func FixChannelsAbilities(c *gin.Context) { |
| 251 | success, fails, err := model.FixAbility() |
nothing calls this directly
no test coverage detected