mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-17 19:13:42 +08:00
Compare commits
3 Commits
v0.2.1.0-a
...
v0.2.1.0-a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c33b1522cc | ||
|
|
ff7da08bad | ||
|
|
3e03c5a742 |
@@ -77,7 +77,7 @@ func RequestEpay(c *gin.Context) {
|
||||
callBackAddress := service.GetCallbackAddress()
|
||||
returnUrl, _ := url.Parse(common.ServerAddress + "/log")
|
||||
notifyUrl, _ := url.Parse(callBackAddress + "/api/user/epay/notify")
|
||||
tradeNo := strconv.FormatInt(time.Now().Unix(), 10)
|
||||
tradeNo := fmt.Sprintf("%s%d", common.GetRandomString(6), time.Now().Unix())
|
||||
client := GetEpayClient()
|
||||
if client == nil {
|
||||
c.JSON(200, gin.H{"message": "error", "data": "当前管理员未配置支付信息"})
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package dto
|
||||
|
||||
type TextResponseWithError struct {
|
||||
Choices []OpenAITextResponseChoice `json:"choices"`
|
||||
Id string `json:"id"`
|
||||
Object string `json:"object"`
|
||||
Created int64 `json:"created"`
|
||||
Choices []OpenAITextResponseChoice `json:"choices"`
|
||||
Data []OpenAIEmbeddingResponseItem `json:"data"`
|
||||
Model string `json:"model"`
|
||||
Usage `json:"usage"`
|
||||
@@ -10,6 +12,9 @@ type TextResponseWithError struct {
|
||||
}
|
||||
|
||||
type TextResponse struct {
|
||||
Id string `json:"id"`
|
||||
Object string `json:"object"`
|
||||
Created int64 `json:"created"`
|
||||
Model string `json:"model"`
|
||||
Choices []OpenAITextResponseChoice `json:"choices"`
|
||||
Usage `json:"usage"`
|
||||
|
||||
@@ -192,6 +192,9 @@ func OpenaiHandler(c *gin.Context, resp *http.Response, promptTokens int, model
|
||||
}
|
||||
}
|
||||
textResponse := &dto.TextResponse{
|
||||
Id: responseWithError.Id,
|
||||
Created: responseWithError.Created,
|
||||
Object: responseWithError.Object,
|
||||
Choices: responseWithError.Choices,
|
||||
Model: responseWithError.Model,
|
||||
Usage: *usage,
|
||||
|
||||
Reference in New Issue
Block a user