mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-14 22:15:59 +08:00
pkg
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package apiresp
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func GinError(c *gin.Context, err error) {
|
||||
if err == nil {
|
||||
GinSuccess(c, nil)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, apiError(err))
|
||||
}
|
||||
|
||||
func GinSuccess(c *gin.Context, data any) {
|
||||
c.JSON(http.StatusOK, apiSuccess(data))
|
||||
}
|
||||
Reference in New Issue
Block a user