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

15 lines
242 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) {
2023-03-24 17:36:36 +08:00
c.JSON(http.StatusOK, ParseError(err))
2023-03-03 18:42:33 +08:00
}
func GinSuccess(c *gin.Context, data any) {
2023-03-24 17:34:00 +08:00
c.JSON(http.StatusOK, ApiSuccess(data))
2023-03-03 18:42:33 +08:00
}