refactor: /antigravity/v1/models 使用专用 handler

不再复用 Models(),避免内部 ForcePlatform 判断
This commit is contained in:
song
2026-01-02 10:32:20 +08:00
parent 6cc7f9978c
commit f1fdb5d38f
2 changed files with 1 additions and 12 deletions

View File

@@ -402,17 +402,6 @@ func (h *GatewayHandler) Messages(c *gin.Context) {
func (h *GatewayHandler) Models(c *gin.Context) {
apiKey, _ := middleware2.GetApiKeyFromContext(c)
// 优先检查强制平台(/antigravity 路由)
if forcePlatform, ok := middleware2.GetForcePlatformFromContext(c); ok {
if forcePlatform == service.PlatformAntigravity {
c.JSON(http.StatusOK, gin.H{
"object": "list",
"data": antigravity.DefaultModels(),
})
return
}
}
var groupID *int64
var platform string

View File

@@ -58,7 +58,7 @@ func RegisterGatewayRoutes(
{
antigravityV1.POST("/messages", h.Gateway.Messages)
antigravityV1.POST("/messages/count_tokens", h.Gateway.CountTokens)
antigravityV1.GET("/models", h.Gateway.Models)
antigravityV1.GET("/models", h.Gateway.AntigravityModels)
antigravityV1.GET("/usage", h.Gateway.Usage)
}