mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-16 06:49:02 +08:00
cms
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user