Skip to content

Commit 48a4b59

Browse files
修改错误
1 parent 0e5cd5c commit 48a4b59

File tree

12 files changed

+27
-12
lines changed

12 files changed

+27
-12
lines changed

common/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ func Init() {
6161
}
6262
logger.LogDir = *LogDir
6363
}
64-
}
64+
}

common/logger/logger.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"time"
1414

1515
"github.com/gin-gonic/gin"
16+
1617
"github.com/songquanpeng/one-api/common/config"
1718
"github.com/songquanpeng/one-api/common/helper"
1819
)
@@ -156,4 +157,4 @@ func getLineInfo() (string, string) {
156157
file = parts[1]
157158
}
158159
return fmt.Sprintf(" | %s:%d", file, line), funcName
159-
}
160+
}

middleware/rate-limit.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"time"
88

99
"github.com/gin-gonic/gin"
10+
1011
"github.com/songquanpeng/one-api/common"
1112
"github.com/songquanpeng/one-api/common/config"
1213
)
@@ -107,4 +108,4 @@ func DownloadRateLimit() func(c *gin.Context) {
107108

108109
func UploadRateLimit() func(c *gin.Context) {
109110
return rateLimitFactory(config.UploadRateLimitNum, config.UploadRateLimitDuration, "UP")
110-
}
111+
}

monitor/channel.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package monitor
22

33
import (
44
"fmt"
5+
56
"github.com/songquanpeng/one-api/common/config"
67
"github.com/songquanpeng/one-api/common/logger"
78
"github.com/songquanpeng/one-api/common/message"
@@ -73,4 +74,4 @@ func EnableChannel(channelId int, channelName string) {
7374
`, channelName, channelId),
7475
)
7576
notifyRootUser(subject, content)
76-
}
77+
}

one-api.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Restart=always
1515
RestartSec=5
1616

1717
[Install]
18-
WantedBy=multi-user.target
18+
WantedBy=multi-user.target

relay/adaptor/xunfei/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
"github.com/gin-gonic/gin"
1717
"github.com/gorilla/websocket"
18+
1819
"github.com/songquanpeng/one-api/common"
1920
"github.com/songquanpeng/one-api/common/helper"
2021
"github.com/songquanpeng/one-api/common/logger"
@@ -269,4 +270,4 @@ func xunfeiMakeRequest(textRequest model.GeneralOpenAIRequest, domain, authUrl,
269270
}()
270271

271272
return dataChan, stopChan, nil
272-
}
273+
}

relay/billing/billing.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package billing
33
import (
44
"context"
55
"fmt"
6+
67
"github.com/songquanpeng/one-api/common/logger"
78
"github.com/songquanpeng/one-api/model"
89
)
@@ -48,4 +49,4 @@ func PostConsumeQuota(ctx context.Context, tokenId int, quotaDelta int64, totalQ
4849
if totalQuota <= 0 {
4950
logger.Error(ctx, fmt.Sprintf("totalQuota consumed is %d, something is wrong", totalQuota))
5051
}
51-
}
52+
}

relay/controller/helper.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ import (
99
"strings"
1010

1111
"github.com/songquanpeng/one-api/common/helper"
12+
"github.com/songquanpeng/one-api/relay/constant/role"
13+
14+
"github.com/gin-gonic/gin"
1215

1316
"github.com/songquanpeng/one-api/common"
1417
"github.com/songquanpeng/one-api/common/config"
1518
"github.com/songquanpeng/one-api/common/logger"
19+
"github.com/songquanpeng/one-api/model"
1620
"github.com/songquanpeng/one-api/relay/adaptor/openai"
1721
billingratio "github.com/songquanpeng/one-api/relay/billing/ratio"
1822
"github.com/songquanpeng/one-api/relay/channeltype"
@@ -191,4 +195,4 @@ func setSystemPrompt(ctx context.Context, request *relaymodel.GeneralOpenAIReque
191195
}}, request.Messages...)
192196
logger.Infof(ctx, "add system prompt")
193197
return true
194-
}
198+
}

relay/controller/image.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"net/http"
1111

1212
"github.com/gin-gonic/gin"
13+
1314
"github.com/songquanpeng/one-api/common"
1415
"github.com/songquanpeng/one-api/common/ctxkey"
1516
"github.com/songquanpeng/one-api/common/logger"
@@ -234,4 +235,4 @@ func RelayImageHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
234235
}
235236

236237
return nil
237-
}
238+
}

web/default/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@
5353
"jsxSingleQuote": true
5454
},
5555
"proxy": "http://localhost:3003"
56-
}
56+
}

0 commit comments

Comments
 (0)