This commit is contained in:
wangchuxiao
2022-01-24 01:40:49 +08:00
parent d58bcd136a
commit 1607853393
21 changed files with 6352 additions and 2696 deletions
+22
View File
@@ -1 +1,23 @@
package http
import (
"Open_IM/pkg/common/constant"
"net/http"
"github.com/gin-gonic/gin"
)
type BaseResp struct {
Code int32 `json:"code"`
ErrMsg string `json:"err_msg"`
Data interface{} `json:"data"`
}
func RespHttp200(ctx *gin.Context, err constant.ErrInfo, data interface{}) {
resp := BaseResp{
Code: err.Code(),
ErrMsg: err.Error(),
Data: data,
}
ctx.JSON(http.StatusOK, resp)
}