Files
open-im-server/pkg/apiresp/gin.go
T

19 lines
292 B
Go
Raw Normal View History

2023-03-03 18:42:33 +08:00
package apiresp
import (
"github.com/gin-gonic/gin"
"net/http"
)
func GinError(c *gin.Context, err error) {
if err == nil {
GinSuccess(c, nil)
return
}
2023-03-24 16:39:33 +08:00
c.JSON(http.StatusOK, ParseError(err))
2023-03-03 18:42:33 +08:00
}
func GinSuccess(c *gin.Context, data any) {
c.JSON(http.StatusOK, apiSuccess(data))
}