Commit f1fdb5d3 authored by song's avatar song
Browse files

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

不再复用 Models(),避免内部 ForcePlatform 判断
parent 6cc7f997
...@@ -402,17 +402,6 @@ func (h *GatewayHandler) Messages(c *gin.Context) { ...@@ -402,17 +402,6 @@ func (h *GatewayHandler) Messages(c *gin.Context) {
func (h *GatewayHandler) Models(c *gin.Context) { func (h *GatewayHandler) Models(c *gin.Context) {
apiKey, _ := middleware2.GetApiKeyFromContext(c) 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 groupID *int64
var platform string var platform string
......
...@@ -58,7 +58,7 @@ func RegisterGatewayRoutes( ...@@ -58,7 +58,7 @@ func RegisterGatewayRoutes(
{ {
antigravityV1.POST("/messages", h.Gateway.Messages) antigravityV1.POST("/messages", h.Gateway.Messages)
antigravityV1.POST("/messages/count_tokens", h.Gateway.CountTokens) 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) antigravityV1.GET("/usage", h.Gateway.Usage)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment