chore: move config key to package ctxkey

This commit is contained in:
JustSong
2024-04-21 18:55:13 +08:00
parent d87c55f542
commit e30ebda0fe
9 changed files with 23 additions and 25 deletions

View File

@@ -2,14 +2,14 @@ package azure
import (
"github.com/gin-gonic/gin"
"github.com/songquanpeng/one-api/common/config"
"github.com/songquanpeng/one-api/common/ctxkey"
)
func GetAPIVersion(c *gin.Context) string {
query := c.Request.URL.Query()
apiVersion := query.Get("api-version")
if apiVersion == "" {
apiVersion = c.GetString(config.KeyAPIVersion)
apiVersion = c.GetString(ctxkey.ConfigAPIVersion)
}
return apiVersion
}