mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
refactor: replace api error handler with cosy err handler
This commit is contained in:
parent
4cb4695e7b
commit
b469ca7961
37 changed files with 268 additions and 250 deletions
|
@ -1,13 +1,13 @@
|
|||
package openai
|
||||
|
||||
import (
|
||||
"github.com/0xJacky/Nginx-UI/api"
|
||||
"net/http"
|
||||
|
||||
"github.com/0xJacky/Nginx-UI/model"
|
||||
"github.com/0xJacky/Nginx-UI/query"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/sashabaranov/go-openai"
|
||||
"github.com/uozi-tech/cosy"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func StoreChatGPTRecord(c *gin.Context) {
|
||||
|
@ -25,7 +25,7 @@ func StoreChatGPTRecord(c *gin.Context) {
|
|||
_, err := g.Where(g.Name.Eq(name)).FirstOrCreate()
|
||||
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
cosy.ErrHandler(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ func StoreChatGPTRecord(c *gin.Context) {
|
|||
})
|
||||
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
cosy.ErrHandler(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue