This commit is contained in:
withchao
2023-03-24 17:34:00 +08:00
parent 5017c61e28
commit 429d5da1d2
2 changed files with 12 additions and 13 deletions
+2 -6
View File
@@ -6,13 +6,9 @@ import (
)
func GinError(c *gin.Context, err error) {
if err == nil {
GinSuccess(c, nil)
return
}
c.JSON(http.StatusOK, apiError(err))
c.JSON(http.StatusOK, ApiError(err))
}
func GinSuccess(c *gin.Context, data any) {
c.JSON(http.StatusOK, apiSuccess(data))
c.JSON(http.StatusOK, ApiSuccess(data))
}