This commit is contained in:
Sakurasan
2025-02-01 23:52:55 +08:00
parent 65d6d12972
commit bc223d6530
30 changed files with 2683 additions and 242 deletions

View File

@@ -0,0 +1,22 @@
package dto
import (
"net/http"
"github.com/gin-gonic/gin"
)
type Error struct {
Message string `json:"message,omitempty"`
Code string `json:"code,omitempty"`
}
func WarpErrAsOpenAI(c *gin.Context, msg string, code string) {
c.JSON(http.StatusForbidden, gin.H{
"error": Error{
Message: msg,
Code: code,
},
})
return
}