apiGetAccountOverage 拉取并返回单个账号的上游 Overages 状态。 同步把结果写回 config.json 缓存,确保 UI 与持久化一致。
(w http.ResponseWriter, r *http.Request, id string)
| 2437 | case strings.HasPrefix(path, "/accounts/") && strings.HasSuffix(path, "/test") && r.Method == "POST": |
| 2438 | id := strings.TrimSuffix(strings.TrimPrefix(path, "/accounts/"), "/test") |
| 2439 | h.apiTestAccount(w, r, id) |
| 2440 | case strings.HasPrefix(path, "/accounts/") && strings.HasSuffix(path, "/models/cached") && r.Method == "GET": |
| 2441 | id := strings.TrimSuffix(strings.TrimPrefix(path, "/accounts/"), "/models/cached") |
| 2442 | h.apiGetAccountModelsCached(w, r, id) |
| 2443 | case strings.HasPrefix(path, "/accounts/") && strings.HasSuffix(path, "/models") && r.Method == "GET": |
| 2444 | id := strings.TrimSuffix(strings.TrimPrefix(path, "/accounts/"), "/models") |
| 2445 | h.apiGetAccountModels(w, r, id) |
| 2446 | |
| 2447 | case strings.HasPrefix(path, "/accounts/") && strings.HasSuffix(path, "/overage") && r.Method == "POST": |
| 2448 | id := strings.TrimSuffix(strings.TrimPrefix(path, "/accounts/"), "/overage") |
| 2449 | h.apiSetAccountOverage(w, r, id) |
| 2450 | case strings.HasPrefix(path, "/accounts/") && strings.HasSuffix(path, "/overage") && r.Method == "GET": |
| 2451 | id := strings.TrimSuffix(strings.TrimPrefix(path, "/accounts/"), "/overage") |
| 2452 | h.apiGetAccountOverage(w, r, id) |
| 2453 | |
| 2454 | case strings.HasPrefix(path, "/accounts/") && strings.HasSuffix(path, "/full") && r.Method == "GET": |
| 2455 | id := strings.TrimSuffix(strings.TrimPrefix(path, "/accounts/"), "/full") |
| 2456 | h.apiGetAccountFull(w, r, id) |
| 2457 | case strings.HasPrefix(path, "/accounts/") && r.Method == "DELETE": |
| 2458 | h.apiDeleteAccount(w, r, strings.TrimPrefix(path, "/accounts/")) |
| 2459 | case strings.HasPrefix(path, "/accounts/") && r.Method == "PUT": |
| 2460 | h.apiUpdateAccount(w, r, strings.TrimPrefix(path, "/accounts/")) |
| 2461 | case path == "/auth/iam-sso/start" && r.Method == "POST": |
| 2462 | h.apiStartIamSso(w, r) |
| 2463 | case path == "/auth/iam-sso/complete" && r.Method == "POST": |
| 2464 | h.apiCompleteIamSso(w, r) |
| 2465 | case path == "/auth/microsoft-sso/start" && r.Method == "POST": |
| 2466 | h.apiStartMicrosoftSSO(w, r) |
| 2467 | case path == "/auth/microsoft-sso/complete" && r.Method == "POST": |
| 2468 | h.apiCompleteMicrosoftSSO(w, r) |
| 2469 | case path == "/auth/microsoft-sso/select-profile" && r.Method == "POST": |
| 2470 | h.apiSelectMicrosoftSSOProfile(w, r) |
| 2471 | case path == "/auth/microsoft-sso/cancel" && r.Method == "POST": |
| 2472 | h.apiCancelMicrosoftSSO(w, r) |
| 2473 | case path == "/auth/builderid/start" && r.Method == "POST": |
| 2474 | h.apiStartBuilderIdLogin(w, r) |
| 2475 | case path == "/auth/builderid/poll" && r.Method == "POST": |
| 2476 | h.apiPollBuilderIdAuth(w, r) |
| 2477 | case path == "/auth/sso-token" && r.Method == "POST": |
| 2478 | h.apiImportSsoToken(w, r) |
no test coverage detected