mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-12 00:53:41 +08:00
feat: 初步重构完成
This commit is contained in:
@@ -56,9 +56,9 @@ func GenRelayInfo(c *gin.Context) *RelayInfo {
|
||||
if info.BaseUrl == "" {
|
||||
info.BaseUrl = common.ChannelBaseURLs[channelType]
|
||||
}
|
||||
//if info.ChannelType == common.ChannelTypeAzure {
|
||||
// info.ApiVersion = GetAzureAPIVersion(c)
|
||||
//}
|
||||
if info.ChannelType == common.ChannelTypeAzure {
|
||||
info.ApiVersion = GetAzureAPIVersion(c)
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
||||
|
||||
@@ -66,3 +66,12 @@ func GetAPIVersion(c *gin.Context) string {
|
||||
}
|
||||
return apiVersion
|
||||
}
|
||||
|
||||
func GetAzureAPIVersion(c *gin.Context) string {
|
||||
query := c.Request.URL.Query()
|
||||
apiVersion := query.Get("api-version")
|
||||
if apiVersion == "" {
|
||||
apiVersion = c.GetString("api_version")
|
||||
}
|
||||
return apiVersion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user