chore: reorganize relay related package

This commit is contained in:
JustSong
2024-04-06 01:31:44 +08:00
parent 8f4d78e24d
commit f70506eac1
23 changed files with 113 additions and 102 deletions

View File

@@ -3,7 +3,6 @@ package util
import (
"encoding/json"
"fmt"
"github.com/songquanpeng/one-api/common"
"github.com/songquanpeng/one-api/common/config"
"github.com/songquanpeng/one-api/common/logger"
"github.com/songquanpeng/one-api/relay/channeltype"
@@ -12,8 +11,6 @@ import (
"net/http"
"strconv"
"strings"
"github.com/gin-gonic/gin"
)
func ShouldDisableChannel(err *relaymodel.Error, statusCode int) bool {
@@ -162,12 +159,3 @@ func GetFullRequestURL(baseURL string, requestURL string, channelType int) strin
}
return fullRequestURL
}
func GetAzureAPIVersion(c *gin.Context) string {
query := c.Request.URL.Query()
apiVersion := query.Get("api-version")
if apiVersion == "" {
apiVersion = c.GetString(common.ConfigKeyAPIVersion)
}
return apiVersion
}