feat: 初步重构完成

This commit is contained in:
1808837298@qq.com
2024-02-29 16:21:25 +08:00
parent 5b18cd6b0a
commit 6013219f5b
30 changed files with 240 additions and 195 deletions

View File

@@ -3,6 +3,7 @@ package controller
import (
"github.com/gin-gonic/gin"
"one-api/common"
"one-api/dto"
"one-api/model"
)
@@ -27,7 +28,7 @@ func GetSubscription(c *gin.Context) {
expiredTime = 0
}
if err != nil {
openAIError := OpenAIError{
openAIError := dto.OpenAIError{
Message: err.Error(),
Type: "upstream_error",
}
@@ -69,7 +70,7 @@ func GetUsage(c *gin.Context) {
quota, err = model.GetUserUsedQuota(userId)
}
if err != nil {
openAIError := OpenAIError{
openAIError := dto.OpenAIError{
Message: err.Error(),
Type: "new_api_error",
}