team api
This commit is contained in:
22
team/dto/openai/err_resp.go
Normal file
22
team/dto/openai/err_resp.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user