pull/241/head
wangchuxiao 2 years ago
parent 4eeef63724
commit 2907cac50f

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -29,6 +29,13 @@ import (
"Open_IM/pkg/common/constant"
)
// @title open-IM-Server API
// @version 1.0
// @description open-IM-Server 的API服务器文档, 文档中所有请求都有一个operationID字段用于链路追踪
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @BasePath /
func main() {
log.NewPrivateLog(constant.LogFileName)
gin.SetMode(gin.ReleaseMode)

@ -16,17 +16,17 @@ import (
"strings"
)
// @Summary 用户登录
// @Description 用户登录
// @Summary 用户注册
// @Description 用户注册
// @Tags 鉴权认证
// @ID UserRegister
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UserRegisterReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID <br> ex为拓展字段"
// @Param req body api.UserRegisterReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID <br> ex为拓展字段 <br> gender为性别, 0为女, 1为男"
// @Produce json
// @Success 0 {object} api.UserRegisterResp
// @Failure 500 {object} api.UserRegisterResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.UserRegisterResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /auth/user_register [post]
func UserRegister(c *gin.Context) {
params := api.UserRegisterReq{}
@ -91,11 +91,11 @@ func UserRegister(c *gin.Context) {
// @ID UserToken
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UserTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段, platform为平台ID"
// @Param req body api.UserTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID"
// @Produce json
// @Success 0 {object} api.UserTokenResp
// @Failure 500 {object} api.UserTokenResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.UserTokenResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /auth/user_token [post]
func UserToken(c *gin.Context) {
params := api.UserTokenReq{}
@ -135,17 +135,17 @@ func UserToken(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 解析token
// @Description 解析用户token
// @Summary 解析当前用户token
// @Description 解析当前用户token(token在请求头中传入)
// @Tags 鉴权认证
// @ID ParseToken
// @Accept json
// @Param token header string true "im token"
// @Param req body api.ParseTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段, platform为平台ID"
// @Param req body api.ParseTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段<br>platform为平台ID"
// @Produce json
// @Success 0 {object} api.ParseTokenResp
// @Failure 500 {object} api.ParseTokenResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.ParseTokenResp "errCode为400 一般为参数输入错误, token未带上等"
// @Success 0 {object} api.ParseTokenResp{Data=api.ExpireTime}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /auth/parse_token [post]
func ParseToken(c *gin.Context) {
params := api.ParseTokenReq{}
@ -179,11 +179,11 @@ func ParseToken(c *gin.Context) {
// @ID ForceLogout
// @Accept json
// @Param token header string true "im token"
// @Param req body api.ForceLogoutReq true "platform为平台ID, fromUserID为要执行强制登出的用户ID"
// @Param req body api.ForceLogoutReq true "platform为平台ID <br> fromUserID为要执行强制登出的用户ID"
// @Produce json
// @Success 0 {object} api.ForceLogoutResp
// @Failure 500 {object} api.ForceLogoutResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.ForceLogoutResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /auth/force_logout [post]
func ForceLogout(c *gin.Context) {
params := api.ForceLogoutReq{}

@ -25,8 +25,8 @@ import (
// @Param req body api.DelMsgReq true "userID为要删除的用户ID <br> seqList为seq列表"
// @Produce json
// @Success 0 {object} api.DelMsgResp
// @Failure 500 {object} api.DelMsgResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.DelMsgResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/del_msg [post]
func DelMsg(c *gin.Context) {
var (
@ -82,8 +82,8 @@ func DelMsg(c *gin.Context) {
// @Param req body api.CleanUpMsgReq true "userID为要清空的用户ID"
// @Produce json
// @Success 0 {object} api.CleanUpMsgResp
// @Failure 500 {object} api.CleanUpMsgResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.CleanUpMsgResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/clear_msg [post]
func ClearMsg(c *gin.Context) {
params := api.CleanUpMsgReq{}

@ -127,6 +127,18 @@ func BatchSetConversations(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 获取用户所有会话
// @Description 获取用户所有会话
// @Tags 会话相关
// @ID GetAllConversations
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetAllConversationsReq true "ownerUserID为要获取的用户ID"
// @Produce json
// @Success 0 {object} api.GetAllConversationsResp
// @Failure 500 {object} api.GetAllConversationsResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetAllConversationsResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/get_all_conversations [post]
func GetAllConversations(c *gin.Context) {
var (
req api.GetAllConversationsReq
@ -165,6 +177,18 @@ func GetAllConversations(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 根据会话ID获取会话
// @Description 根据会话ID获取会话
// @Tags 会话相关
// @ID GetConversation
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetConversationReq true "ownerUserID为要获取的用户ID<br>conversationID为要获取的会话ID"
// @Produce json
// @Success 0 {object} api.GetConversationResp
// @Failure 500 {object} api.GetConversationResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetConversationResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/get_conversation [post]
func GetConversation(c *gin.Context) {
var (
req api.GetConversationReq
@ -203,6 +227,18 @@ func GetConversation(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 根据会话ID列表获取会话
// @Description 根据会话ID列表获取会话
// @Tags 会话相关
// @ID GetConversations
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetConversationsReq true "ownerUserID为要获取的用户ID<br>conversationIDs为要获取的会话ID列表"
// @Produce json
// @Success 0 {object} api.GetConversationsResp
// @Failure 500 {object} api.GetConversationsResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetConversationsResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/get_conversations [post]
func GetConversations(c *gin.Context) {
var (
req api.GetConversationsReq

@ -22,11 +22,11 @@ import (
// @ID AddBlack
// @Accept json
// @Param token header string true "im token"
// @Param req body api.AddBlacklistReq true "fromUserID为设置的用户, toUserID为被设置的用户"
// @Param req body api.AddBlacklistReq true "fromUserID为设置的用户 <br> toUserID为被设置的用户"
// @Produce json
// @Success 0 {object} api.AddBlacklistResp
// @Failure 500 {object} api.AddBlacklistResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.AddBlacklistResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/add_black [post]
func AddBlack(c *gin.Context) {
params := api.AddBlacklistReq{}
@ -43,7 +43,7 @@ func AddBlack(c *gin.Context) {
if !ok {
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
log.NewInfo(params.OperationID, "AddBlacklist args ", req.String())
@ -67,11 +67,11 @@ func AddBlack(c *gin.Context) {
// @ID ImportFriend
// @Accept json
// @Param token header string true "im token"
// @Param req body api.ImportFriendReq true "fromUserID批量加好友的用户ID, friendUserIDList为"
// @Param req body api.ImportFriendReq true "fromUserID批量加好友的用户ID<br> friendUserIDList为"
// @Produce json
// @Success 0 {object} api.ImportFriendResp "data列表中对象的result-1为添加该用户失败, 0为成功"
// @Failure 500 {object} api.ImportFriendResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.ImportFriendResp "errCode为400 一般为参数输入错误, token未带上等"
// @Success 0 {object} api.ImportFriendResp "data列表中对象的result-1为添加该用户失败<br>0为成功"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/import_friend [post]
func ImportFriend(c *gin.Context) {
params := api.ImportFriendReq{}
@ -88,7 +88,7 @@ func ImportFriend(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -127,11 +127,11 @@ func ImportFriend(c *gin.Context) {
// @ID AddFriend
// @Accept json
// @Param token header string true "im token"
// @Param req body api.AddFriendReq true "reqMsg为申请信息, fromUserID为申请用户, toUserID为被添加用户"
// @Param req body api.AddFriendReq true "reqMsg为申请信息 <br> fromUserID为申请用户 <br> toUserID为被添加用户"
// @Produce json
// @Success 0 {object} api.AddFriendResp
// @Failure 500 {object} api.AddFriendResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.AddFriendResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/add_friend [post]
func AddFriend(c *gin.Context) {
params := api.AddFriendReq{}
@ -182,11 +182,11 @@ func AddFriend(c *gin.Context) {
// @ID AddFriendResponse
// @Accept json
// @Param token header string true "im token"
// @Param req body api.AddFriendResponseReq true "fromUserID同意/拒绝的用户ID, toUserID为申请用户, handleMsg为处理信息, flag为具体操作, 1为同意, 2为拒绝"
// @Param req body api.AddFriendResponseReq true "fromUserID同意/拒绝的用户ID<br>toUserID为申请用户D<br>handleMsg为处理信息<br>flag为具体操作, 1为同意, 2为拒绝"
// @Produce json
// @Success 0 {object} api.AddFriendResponseResp
// @Failure 500 {object} api.AddFriendResponseResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.AddFriendResponseResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/add_friend_response [post]
func AddFriendResponse(c *gin.Context) {
params := api.AddFriendResponseReq{}
@ -240,11 +240,11 @@ func AddFriendResponse(c *gin.Context) {
// @ID DeleteFriend
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteFriendReq true "fromUserID为操作用户, toUserID为被删除用户"
// @Param req body api.DeleteFriendReq true "fromUserID为操作用户<br>toUserID为被删除用户"
// @Produce json
// @Success 0 {object} api.DeleteFriendResp
// @Failure 500 {object} api.DeleteFriendResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.DeleteFriendResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/delete_friend [post]
func DeleteFriend(c *gin.Context) {
params := api.DeleteFriendReq{}
@ -262,7 +262,7 @@ func DeleteFriend(c *gin.Context) {
if !ok {
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -296,9 +296,9 @@ func DeleteFriend(c *gin.Context) {
// @Param token header string true "im token"
// @Param req body api.GetBlackListReq true "fromUserID要获取黑名单的用户"
// @Produce json
// @Success 0 {object} api.GetBlackListResp
// @Failure 500 {object} api.GetBlackListResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetBlackListResp "errCode为400 一般为参数输入错误, token未带上等"
// @Success 0 {object} api.GetBlackListResp{data=[]open_im_sdk.PublicUserInfo}
// @Failure 500 {object} api.Swagger400Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger500Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/get_black_list [post]
func GetBlacklist(c *gin.Context) {
params := api.GetBlackListReq{}
@ -354,11 +354,11 @@ func GetBlacklist(c *gin.Context) {
// @ID SetFriendRemark
// @Accept json
// @Param token header string true "im token"
// @Param req body api.SetFriendRemarkReq true "fromUserID为设置的用户, toUserID为被设置的用户 remark为好友备注"
// @Param req body api.SetFriendRemarkReq true "fromUserID为设置的用户<br> toUserID为被设置的用户<br> remark为好友备注"
// @Produce json
// @Success 0 {object} api.SetFriendRemarkResp
// @Failure 500 {object} api.SetFriendRemarkResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.SetFriendRemarkResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/set_friend_remark [post]
func SetFriendRemark(c *gin.Context) {
params := api.SetFriendRemarkReq{}
@ -377,7 +377,7 @@ func SetFriendRemark(c *gin.Context) {
if !ok {
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -412,8 +412,8 @@ func SetFriendRemark(c *gin.Context) {
// @Param req body api.RemoveBlackListReq true "fromUserID要获取黑名单的用户"
// @Produce json
// @Success 0 {object} api.RemoveBlackListResp
// @Failure 500 {object} api.RemoveBlackListResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.RemoveBlackListResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/remove_black [post]
func RemoveBlack(c *gin.Context) {
params := api.RemoveBlackListReq{}
@ -462,11 +462,11 @@ func RemoveBlack(c *gin.Context) {
// @ID IsFriend
// @Accept json
// @Param token header string true "im token"
// @Param req body api.IsFriendReq true "fromUserID为请求用户, toUserID为要检查的用户"
// @Param req body api.IsFriendReq true "fromUserID为请求用户<br> toUserID为要检查的用户"
// @Produce json
// @Success 0 {object} api.IsFriendResp
// @Failure 500 {object} api.IsFriendResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.IsFriendResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/is_friend [post]
func IsFriend(c *gin.Context) {
params := api.IsFriendReq{}
@ -519,9 +519,9 @@ func IsFriend(c *gin.Context) {
// @Param token header string true "im token"
// @Param req body api.GetFriendListReq true "fromUserID为要获取好友列表的用户ID"
// @Produce json
// @Success 0 {object} api.GetFriendListResp
// @Failure 500 {object} api.GetFriendListResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetFriendListResp "errCode为400 一般为参数输入错误, token未带上等"
// @Success 0 {object} api.GetFriendListResp{data=[]open_im_sdk.FriendInfo}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/get_friend_list [post]
func GetFriendList(c *gin.Context) {
params := api.GetFriendListReq{}
@ -539,7 +539,7 @@ func GetFriendList(c *gin.Context) {
if !ok {
errMsg := req.CommID.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.CommID.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -575,9 +575,9 @@ func GetFriendList(c *gin.Context) {
// @Param token header string true "im token"
// @Param req body api.GetFriendApplyListReq true "fromUserID为要获取申请列表的用户ID"
// @Produce json
// @Success 0 {object} api.GetFriendApplyListResp
// @Failure 500 {object} api.GetFriendApplyListResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetFriendApplyListResp "errCode为400 一般为参数输入错误, token未带上等"
// @Success 0 {object} api.GetFriendApplyListResp{data=[]open_im_sdk.FriendRequest}
// @Failure 500 {object} api.Swagger400Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/get_friend_apply_list [post]
func GetFriendApplyList(c *gin.Context) {
params := api.GetFriendApplyListReq{}
@ -631,9 +631,9 @@ func GetFriendApplyList(c *gin.Context) {
// @Param token header string true "im token"
// @Param req body api.GetSelfApplyListReq true "fromUserID为自己的用户ID"
// @Produce json
// @Success 0 {object} api.GetSelfApplyListResp
// @Failure 500 {object} api.GetSelfApplyListResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetSelfApplyListResp "errCode为400 一般为参数输入错误, token未带上等"
// @Success 0 {object} api.GetSelfApplyListResp{data=[]open_im_sdk.FriendRequest}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /friend/get_self_friend_apply_list [post]
func GetSelfFriendApplyList(c *gin.Context) {
params := api.GetSelfApplyListReq{}

@ -29,8 +29,8 @@ import (
// @Param req body api.KickGroupMemberReq true "GroupID为要操作的群ID <br> kickedUserIDList为要踢出的群用户ID <br> reason为原因"
// @Produce json
// @Success 0 {object} api.KickGroupMemberResp "result为结果码, -1为失败, 0为成功"
// @Failure 500 {object} api.KickGroupMemberResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.KickGroupMemberResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/kick_group [post]
func KickGroupMember(c *gin.Context) {
params := api.KickGroupMemberReq{}
@ -49,7 +49,7 @@ func KickGroupMember(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -90,11 +90,11 @@ func KickGroupMember(c *gin.Context) {
// @ID GetGroupMembersInfo
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetGroupMembersInfoReq true "memberList为要获取群成员的群ID列表"
// @Param req body api.GetGroupMembersInfoReq true "groupID为要获取的群ID <br> memberList为要获取群成员的群ID列表"
// @Produce json
// @Success 0 {object} api.GetGroupMembersInfoResp{data=[]open_im_sdk.GroupMemberFullInfo}
// @Failure 500 {object} api.GetGroupMembersInfoResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetGroupMembersInfoResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/get_group_members_info [post]
func GetGroupMembersInfo(c *gin.Context) {
params := api.GetGroupMembersInfoReq{}
@ -112,7 +112,7 @@ func GetGroupMembersInfo(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -156,7 +156,7 @@ func GetGroupMemberList(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -194,8 +194,8 @@ func GetGroupMemberList(c *gin.Context) {
// @Param req body api.GetGroupAllMemberReq true "GroupID为要获取群成员的群ID"
// @Produce json
// @Success 0 {object} api.GetGroupAllMemberResp{data=[]open_im_sdk.GroupMemberFullInfo}
// @Failure 500 {object} api.GetGroupAllMemberResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetGroupAllMemberResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/get_group_all_member_list [post]
func GetGroupAllMemberList(c *gin.Context) {
params := api.GetGroupAllMemberReq{}
@ -213,7 +213,7 @@ func GetGroupAllMemberList(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -249,8 +249,8 @@ func GetGroupAllMemberList(c *gin.Context) {
// @Param req body api.GetJoinedGroupListReq true "fromUserID为要获取的用户ID"
// @Produce json
// @Success 0 {object} api.GetJoinedGroupListResp{data=[]open_im_sdk.GroupInfo}
// @Failure 500 {object} api.GetJoinedGroupListResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetJoinedGroupListResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/get_joined_group_list [post]
func GetJoinedGroupList(c *gin.Context) {
params := api.GetJoinedGroupListReq{}
@ -268,7 +268,7 @@ func GetJoinedGroupList(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -304,8 +304,8 @@ func GetJoinedGroupList(c *gin.Context) {
// @Param req body api.InviteUserToGroupReq true "groupID为要拉进的群组ID <br> invitedUserIDList为要获取群成员的群ID列表 <br> reason为原因"
// @Produce json
// @Success 0 {object} api.InviteUserToGroupResp "result为结果码, -1为失败, 0为成功""
// @Failure 500 {object} api.InviteUserToGroupResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.InviteUserToGroupResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/invite_user_to_group [post]
func InviteUserToGroup(c *gin.Context) {
params := api.InviteUserToGroupReq{}
@ -323,7 +323,7 @@ func InviteUserToGroup(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -363,11 +363,11 @@ func InviteUserToGroup(c *gin.Context) {
// @ID CreateGroup
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CreateGroupReq true "ownerUserID为群主ID <br> ex为群扩展字段 <br> roleLevel为群员角色,1为普通用户 2为群主 3为管理员"
// @Param req body api.CreateGroupReq true "groupType这里填0代表普通群 <br>groupName为群名称<br> introduction为群介绍<br> notification为群公共<br>ownerUserID为群主ID <br> ex为群扩展字段 <br> memberList中对象roleLevel为群员角色,1为普通用户 2为群主 3为管理员"
// @Produce json
// @Success 0 {object} api.CreateGroupResp{data=open_im_sdk.GroupInfo}
// @Failure 500 {object} api.CreateGroupResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.CreateGroupResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/create_group [post]
func CreateGroup(c *gin.Context) {
params := api.CreateGroupReq{}
@ -431,9 +431,9 @@ func CreateGroup(c *gin.Context) {
// @Param token header string true "im token"
// @Param req body api.GetGroupApplicationListReq true "fromUserID为要获取的用户ID"
// @Produce json
// @Success 0 {object} api.GetGroupApplicationListResp
// @Failure 500 {object} api.GetGroupApplicationListResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetGroupApplicationListResp "errCode为400 一般为参数输入错误, token未带上等"
// @Success 0 {object} api.GetGroupApplicationListResp{data=[]open_im_sdk.GroupRequest}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/get_recv_group_applicationList [post]
func GetRecvGroupApplicationList(c *gin.Context) {
params := api.GetGroupApplicationListReq{}
@ -484,9 +484,9 @@ func GetRecvGroupApplicationList(c *gin.Context) {
// @Param token header string true "im token"
// @Param req body api.GetUserReqGroupApplicationListReq true "userID为要获取的用户ID"
// @Produce json
// @Success 0 {object} api.GetGroupApplicationListResp
// @Failure 500 {object} api.GetGroupApplicationListResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetGroupApplicationListResp "errCode为400 一般为参数输入错误, token未带上等"
// @Success 0 {object} api.GetGroupApplicationListResp{data=[]open_im_sdk.GroupRequest}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/get_user_req_group_applicationList [post]
func GetUserReqGroupApplicationList(c *gin.Context) {
var params api.GetUserReqGroupApplicationListReq
@ -537,8 +537,8 @@ func GetUserReqGroupApplicationList(c *gin.Context) {
// @Param req body api.GetGroupInfoReq true "groupIDList为群ID列表"
// @Produce json
// @Success 0 {object} api.GetGroupInfoResp
// @Failure 500 {object} api.GetGroupInfoResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetGroupInfoResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/get_groups_info [post]
func GetGroupsInfo(c *gin.Context) {
params := api.GetGroupInfoReq{}
@ -556,7 +556,7 @@ func GetGroupsInfo(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -606,8 +606,8 @@ func GetGroupsInfo(c *gin.Context) {
// @Param req body api.ApplicationGroupResponseReq true "groupID为要处理的群ID <br> fromUserID为要处理的用户ID <br> handleMsg为处理结果信息 <br> handleResult为处理结果 1为同意加群 2为拒绝加群"
// @Produce json
// @Success 0 {object} api.ApplicationGroupResponseResp
// @Failure 500 {object} api.ApplicationGroupResponseResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.ApplicationGroupResponseResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/group_application_response [post]
func ApplicationGroupResponse(c *gin.Context) {
params := api.ApplicationGroupResponseReq{}
@ -625,7 +625,7 @@ func ApplicationGroupResponse(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -657,11 +657,11 @@ func ApplicationGroupResponse(c *gin.Context) {
// @ID JoinGroup
// @Accept json
// @Param token header string true "im token"
// @Param req body api.JoinGroupReq true "reqMessage为申请进群信息"
// @Param req body api.JoinGroupReq true "reqMessage为申请进群信息<br>groupID为申请的群ID"
// @Produce json
// @Success 0 {object} api.JoinGroupResp
// @Failure 500 {object} api.JoinGroupResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.JoinGroupResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/join_group [post]
func JoinGroup(c *gin.Context) {
params := api.JoinGroupReq{}
@ -704,8 +704,8 @@ func JoinGroup(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 退出群聊
// @Description 退出群聊
// @Summary 当前用户退出群聊
// @Description 当前用户退出群聊
// @Tags 群组相关
// @ID QuitGroup
// @Accept json
@ -713,8 +713,8 @@ func JoinGroup(c *gin.Context) {
// @Param req body api.QuitGroupReq true "groupID为要退出的群ID"
// @Produce json
// @Success 0 {object} api.QuitGroupResp
// @Failure 500 {object} api.QuitGroupResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.QuitGroupResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/quit_group [post]
func QuitGroup(c *gin.Context) {
params := api.QuitGroupReq{}
@ -732,7 +732,7 @@ func QuitGroup(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -763,11 +763,11 @@ func QuitGroup(c *gin.Context) {
// @ID SetGroupInfo
// @Accept json
// @Param token header string true "im token"
// @Param req body api.SetGroupInfoReq true "notification为群介绍 <br> introduction为群公告 <br> needVerification为加群验证 0为申请需要同意 邀请直接进 1为所有人进群需要验证除了群主管理员邀请进群 2为直接进群"
// @Param req body api.SetGroupInfoReq true "groupID为要修改的群ID<br>groupName为新的群名称<br>notification为群介绍 <br> introduction为群公告 <br> needVerification为加群验证 0为申请需要同意 邀请直接进 1为所有人进群需要验证除了群主管理员邀请进群 2为直接进群"
// @Produce json
// @Success 0 {object} api.SetGroupInfoResp
// @Failure 500 {object} api.SetGroupInfoResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.SetGroupInfoResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/set_group_info [post]
func SetGroupInfo(c *gin.Context) {
params := api.SetGroupInfoReq{}
@ -791,7 +791,7 @@ func SetGroupInfo(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -825,8 +825,8 @@ func SetGroupInfo(c *gin.Context) {
// @Param req body api.TransferGroupOwnerReq true "GroupID为要操作的群ID <br> oldOwnerUserID为老群主ID <br> newOwnerUserID为新群主ID"
// @Produce json
// @Success 0 {object} api.TransferGroupOwnerResp
// @Failure 500 {object} api.TransferGroupOwnerResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.TransferGroupOwnerResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/transfer_group [post]
func TransferGroupOwner(c *gin.Context) {
params := api.TransferGroupOwnerReq{}
@ -844,7 +844,7 @@ func TransferGroupOwner(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -879,8 +879,8 @@ func TransferGroupOwner(c *gin.Context) {
// @Param req body api.DismissGroupReq true "groupID为要解散的群组ID"
// @Produce json
// @Success 0 {object} api.DismissGroupResp
// @Failure 500 {object} api.DismissGroupResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.DismissGroupResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/dismiss_group [post]
func DismissGroup(c *gin.Context) {
params := api.DismissGroupReq{}
@ -898,7 +898,7 @@ func DismissGroup(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -933,8 +933,8 @@ func DismissGroup(c *gin.Context) {
// @Param req body api.MuteGroupMemberReq true "groupID为群组ID <br> userID为要禁言的用户ID <br> mutedSeconds为禁言秒数"
// @Produce json
// @Success 0 {object} api.DismissGroupResp
// @Failure 500 {object} api.DismissGroupResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.DismissGroupResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/mute_group_member [post]
func MuteGroupMember(c *gin.Context) {
params := api.MuteGroupMemberReq{}
@ -952,7 +952,7 @@ func MuteGroupMember(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -987,8 +987,8 @@ func MuteGroupMember(c *gin.Context) {
// @Param req body api.CancelMuteGroupMemberReq true "groupID为群组ID <br> userID为要取消禁言的用户ID"
// @Produce json
// @Success 0 {object} api.CancelMuteGroupMemberResp
// @Failure 500 {object} api.CancelMuteGroupMemberResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.CancelMuteGroupMemberResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/cancel_mute_group_member [post]
func CancelMuteGroupMember(c *gin.Context) {
params := api.CancelMuteGroupMemberReq{}
@ -1006,7 +1006,7 @@ func CancelMuteGroupMember(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -1060,7 +1060,7 @@ func MuteGroup(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg})
return
}
@ -1095,8 +1095,8 @@ func MuteGroup(c *gin.Context) {
// @Param req body api.CancelMuteGroupReq true "groupID为群组ID"
// @Produce json
// @Success 0 {object} api.CancelMuteGroupResp
// @Failure 500 {object} api.CancelMuteGroupResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.CancelMuteGroupResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/cancel_mute_group [post]
func CancelMuteGroup(c *gin.Context) {
params := api.CancelMuteGroupReq{}
@ -1114,7 +1114,7 @@ func CancelMuteGroup(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -1158,7 +1158,7 @@ func SetGroupMemberNickname(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
@ -1190,11 +1190,11 @@ func SetGroupMemberNickname(c *gin.Context) {
// @ID SetGroupMemberInfo
// @Accept json
// @Param token header string true "im token"
// @Param req body api.SetGroupMemberInfoReq true "除了operationID, userID, groupID其他参数可选"
// @Param req body api.SetGroupMemberInfoReq true "除了operationID, userID, groupID其他参数可选<br>ex为拓展字段<br>faceURL为群头像<br>nickName为群昵称<br>roleLevel为群员角色,1为普通用户 2为群主 3为管理员"
// @Produce json
// @Success 0 {object} api.SetGroupMemberInfoResp
// @Failure 500 {object} api.SetGroupMemberInfoResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.SetGroupMemberInfoResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /group/set_group_member_info [post]
func SetGroupMemberInfo(c *gin.Context) {
var (
@ -1212,7 +1212,7 @@ func SetGroupMemberInfo(c *gin.Context) {
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}

@ -59,7 +59,6 @@ func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq {
OperationID: params.OperationID,
MsgData: &open_im_sdk.MsgData{
SendID: params.SendID,
RecvID: params.RecvID,
GroupID: params.GroupID,
ClientMsgID: utils.GetMsgID(params.SendID),
SenderPlatformID: params.SenderPlatformID,
@ -69,6 +68,7 @@ func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq {
MsgFrom: constant.SysMsgType,
ContentType: params.ContentType,
Content: []byte(newContent),
RecvID: params.RecvID,
// ForceList: params.ForceList,
CreateTime: utils.GetCurrentTimestampByMill(),
Options: options,
@ -89,6 +89,20 @@ func init() {
validate = validator.New()
}
// @Summary 管理员发送/撤回消息
// @Description 管理员发送/撤回消息 消息格式详细见<a href="https://doc.rentsoft.cn/#/server_doc/admin?id=%e6%b6%88%e6%81%af%e7%b1%bb%e5%9e%8b%e6%a0%bc%e5%bc%8f%e6%8f%8f%e8%bf%b0">消息格式</href>
// @Tags 消息相关
// @ID ManagementSendMsg
// @Accept json
// @Param token header string true "im token"
// @Param 管理员发送文字消息 body api.ManagementSendMsgReq{content=TextElem{}} true "该请求和消息结构体一样"
// @Param 管理员发送OA通知消息 body api.ManagementSendMsgReq{content=OANotificationElem{}} true "该请求和消息结构体一样"
// @Param 管理员撤回单聊消息 body api.ManagementSendMsgReq{content=RevokeElem{}} true "该请求和消息结构体一样"
// @Produce json
// @Success 0 {object} api.ManagementSendMsgResp "serverMsgID为服务器消息ID <br> clientMsgID为客户端消息ID <br> sendTime为发送消息时间"
// @Failure 500 {object} api.ManagementSendMsgResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.ManagementSendMsgResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/manage_send_msg [post]
func ManagementSendMsg(c *gin.Context) {
var data interface{}
params := api.ManagementSendMsgReq{}
@ -194,6 +208,19 @@ func ManagementSendMsg(c *gin.Context) {
c.JSON(http.StatusOK, resp)
}
// @Summary 管理员批量发送群聊单聊消息
// @Description 管理员批量发送群聊单聊消息 消息格式详细见<a href="https://doc.rentsoft.cn/#/server_doc/admin?id=%e6%b6%88%e6%81%af%e7%b1%bb%e5%9e%8b%e6%a0%bc%e5%bc%8f%e6%8f%8f%e8%bf%b0">消息格式</href>
// @Tags 消息相关
// @ID ManagementBatchSendMsg
// @Accept json
// @Param token header string true "im token"
// @Param 管理员批量发送单聊消息 body api.ManagementBatchSendMsgReq{content=TextElem{}} true "该请求和消息结构体一样 <br> recvIDList为接受消息的用户ID列表"
// @Param 管理员批量发送OA通知 body api.ManagementSendMsgReq{content=OANotificationElem{}} true "该请求和消息结构体一样 <br> recvIDList为接受消息的用户ID列表"
// @Produce json
// @Success 0 {object} api.ManagementBatchSendMsgReq "serverMsgID为服务器消息ID <br> clientMsgID为客户端消息ID <br> sendTime为发送消息时间"
// @Failure 500 {object} api.ManagementBatchSendMsgReq "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.ManagementBatchSendMsgReq "errCode为400 一般为参数输入错误, token未带上等"
// @Router /msg/batch_send_msg [post]
func ManagementBatchSendMsg(c *gin.Context) {
var data interface{}
params := api.ManagementBatchSendMsgReq{}
@ -260,7 +287,11 @@ func ManagementBatchSendMsg(c *gin.Context) {
}
log.NewInfo(params.OperationID, "Ws call success to ManagementSendMsgReq", params)
for _, recvID := range params.RecvIDList {
pbData := newUserSendMsgReq(&params.ManagementSendMsgReq)
req := &api.ManagementSendMsgReq{
ManagementSendMsg: params.ManagementSendMsg,
RecvID: recvID,
}
pbData := newUserSendMsgReq(req)
pbData.MsgData.RecvID = recvID
log.Info(params.OperationID, "", "api ManagementSendMsg call start..., ", pbData.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID)

@ -16,6 +16,18 @@ import (
"strings"
)
// @Summary 创建部门
// @Description 创建部门
// @Tags 组织架构相关
// @ID CreateDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CreateDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.CreateDepartmentResp{data=open_im_sdk.Department}
// @Failure 500 {object} api.CreateDepartmentResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.CreateDepartmentResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/create_department [post]
func CreateDepartment(c *gin.Context) {
params := api.CreateDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
@ -59,6 +71,18 @@ func CreateDepartment(c *gin.Context) {
c.JSON(http.StatusOK, apiResp)
}
// @Summary 更新部门信息
// @Description 更新部门信息
// @Tags 组织架构相关
// @ID UpdateDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UpdateDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.UpdateDepartmentResp
// @Failure 500 {object} api.UpdateDepartmentResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.UpdateDepartmentResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/update_department [post]
func UpdateDepartment(c *gin.Context) {
params := api.UpdateDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
@ -101,6 +125,18 @@ func UpdateDepartment(c *gin.Context) {
c.JSON(http.StatusOK, apiResp)
}
// @Summary 获取子部门列表
// @Description 获取子部门列表
// @Tags 组织架构相关
// @ID GetSubDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetSubDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.GetSubDepartmentResp
// @Failure 500 {object} api.GetSubDepartmentResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetSubDepartmentResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/get_sub_department [post]
func GetSubDepartment(c *gin.Context) {
params := api.GetSubDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
@ -146,6 +182,18 @@ func GetAllDepartment(c *gin.Context) {
}
// @Summary 删除部门
// @Description 删除部门
// @Tags 组织架构相关
// @ID DeleteDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.DeleteDepartmentResp
// @Failure 500 {object} api.DeleteDepartmentResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.DeleteDepartmentResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/delete_department [post]
func DeleteDepartment(c *gin.Context) {
params := api.DeleteDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
@ -185,6 +233,18 @@ func DeleteDepartment(c *gin.Context) {
c.JSON(http.StatusOK, apiResp)
}
// @Summary 组织架构导入用户
// @Description 组织架构导入用户
// @Tags 组织架构相关
// @ID CreateOrganizationUser
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CreateOrganizationUserReq true "请求"
// @Produce json
// @Success 0 {object} api.CreateOrganizationUserResp
// @Failure 500 {object} api.CreateOrganizationUserResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.CreateOrganizationUserResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/create_organization_user [post]
func CreateOrganizationUser(c *gin.Context) {
params := api.CreateOrganizationUserReq{}
if err := c.BindJSON(&params); err != nil {
@ -227,6 +287,18 @@ func CreateOrganizationUser(c *gin.Context) {
c.JSON(http.StatusOK, apiResp)
}
// @Summary 更新组织架构中的用户
// @Description 更新组织架构中的用户
// @Tags 组织架构相关
// @ID UpdateOrganizationUser
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UpdateOrganizationUserReq true "请求"
// @Produce json
// @Success 0 {object} api.UpdateOrganizationUserResp
// @Failure 500 {object} api.UpdateOrganizationUserResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.UpdateOrganizationUserResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/update_organization_user [post]
func UpdateOrganizationUser(c *gin.Context) {
params := api.UpdateOrganizationUserReq{}
if err := c.BindJSON(&params); err != nil {
@ -262,12 +334,23 @@ func UpdateOrganizationUser(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
apiResp := api.UpdateOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp)
c.JSON(http.StatusOK, apiResp)
}
// @Summary 创建部门用户
// @Description 创建部门用户
// @Tags 组织架构相关
// @ID CreateDepartmentMember
// @Accept json
// @Param token header string true "im token"
// @Param req body api.CreateDepartmentMemberReq true "请求"
// @Produce json
// @Success 0 {object} api.CreateDepartmentMemberResp
// @Failure 500 {object} api.CreateDepartmentMemberResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.CreateDepartmentMemberResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/create_department_member [post]
func CreateDepartmentMember(c *gin.Context) {
params := api.CreateDepartmentMemberReq{}
if err := c.BindJSON(&params); err != nil {
@ -310,6 +393,18 @@ func CreateDepartmentMember(c *gin.Context) {
c.JSON(http.StatusOK, apiResp)
}
// @Summary 获取部门中的所有用户
// @Description 获取部门中的所有用户
// @Tags 组织架构相关
// @ID GetUserInDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetUserInDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.GetUserInDepartmentResp{data=open_im_sdk.UserInDepartment}
// @Failure 500 {object} api.GetUserInDepartmentResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetUserInDepartmentResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/get_user_in_department [post]
func GetUserInDepartment(c *gin.Context) {
params := api.GetUserInDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
@ -352,6 +447,18 @@ func GetUserInDepartment(c *gin.Context) {
c.JSON(http.StatusOK, apiResp)
}
// @Summary 更新部门中某个用户
// @Description 更新部门中某个用户
// @Tags 组织架构相关
// @ID UpdateUserInDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.UpdateUserInDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.UpdateUserInDepartmentResp
// @Failure 500 {object} api.UpdateUserInDepartmentResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.UpdateUserInDepartmentResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/update_user_in_department [post]
func UpdateUserInDepartment(c *gin.Context) {
params := api.UpdateUserInDepartmentReq{}
if err := c.BindJSON(&params); err != nil {
@ -393,6 +500,18 @@ func UpdateUserInDepartment(c *gin.Context) {
c.JSON(http.StatusOK, apiResp)
}
// @Summary 删除组织架构中某个用户
// @Description 删除组织架构中某个用户
// @Tags 组织架构相关
// @ID DeleteOrganizationUser
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteOrganizationUserReq true "请求"
// @Produce json
// @Success 0 {object} api.DeleteOrganizationUserResp
// @Failure 500 {object} api.DeleteOrganizationUserResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.DeleteOrganizationUserResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/delete_organization_user [post]
func DeleteOrganizationUser(c *gin.Context) {
params := api.DeleteOrganizationUserReq{}
if err := c.BindJSON(&params); err != nil {
@ -434,6 +553,18 @@ func DeleteOrganizationUser(c *gin.Context) {
c.JSON(http.StatusOK, apiResp)
}
// @Summary 获取部门中所有成员
// @Description 获取部门中所有成员
// @Tags 组织架构相关
// @ID GetDepartmentMember
// @Accept json
// @Param token header string true "im token"
// @Param req body api.GetDepartmentMemberReq true "请求"
// @Produce json
// @Success 0 {object} api.GetDepartmentMemberResp{data=open_im_sdk.UserDepartmentMember}
// @Failure 500 {object} api.GetDepartmentMemberResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetDepartmentMemberResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/get_department_member [post]
func GetDepartmentMember(c *gin.Context) {
params := api.GetDepartmentMemberReq{}
if err := c.BindJSON(&params); err != nil {
@ -476,6 +607,18 @@ func GetDepartmentMember(c *gin.Context) {
c.JSON(http.StatusOK, apiResp)
}
// @Summary 删除部门中某个用户
// @Description 删除部门中某个用户
// @Tags 组织架构相关
// @ID DeleteUserInDepartment
// @Accept json
// @Param token header string true "im token"
// @Param req body api.DeleteUserInDepartmentReq true "请求"
// @Produce json
// @Success 0 {object} api.DeleteUserInDepartmentResp
// @Failure 500 {object} api.DeleteUserInDepartmentResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.DeleteUserInDepartmentResp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /organization/delete_user_in_department [post]
func DeleteUserInDepartment(c *gin.Context) {
params := api.DeleteUserInDepartmentReq{}
if err := c.BindJSON(&params); err != nil {

@ -28,13 +28,13 @@ import (
// @Param operationID formData string true "操作唯一ID"
// @Produce json
// @Success 0 {object} api.MinioUploadFileResp ""
// @Failure 500 {object} api.MinioUploadFileResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.MinioUploadFileResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /third/minio_upload [post]
func MinioUploadFile(c *gin.Context) {
var (
req api.MinioUploadFileReq
resp api.MinioUploadFileResp
resp api.MinioUploadFile
)
defer func() {
if r := recover(); r != nil {

@ -155,9 +155,9 @@ func GetBlackIDListFromCache(c *gin.Context) {
// @Param token header string true "im token"
// @Param req body api.GetUsersInfoReq true "请求体"
// @Produce json
// @Success 0 {object} api.GetUsersInfoResp
// @Failure 500 {object} api.GetUsersInfoResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetUsersInfoResp "errCode为400 一般为参数输入错误, token未带上等"
// @Success 0 {object} api.GetUsersInfoResp{Data=[]open_im_sdk.PublicUserInfo}
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /user/get_users_info [post]
func GetUsersInfo(c *gin.Context) {
params := api.GetUsersInfoReq{}
@ -216,8 +216,8 @@ func GetUsersInfo(c *gin.Context) {
// @Param req body api.UpdateSelfUserInfoReq true "请求体"
// @Produce json
// @Success 0 {object} api.UpdateUserInfoResp
// @Failure 500 {object} api.UpdateUserInfoResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.UpdateUserInfoResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /user/update_user_info [post]
func UpdateUserInfo(c *gin.Context) {
params := api.UpdateSelfUserInfoReq{}
@ -264,11 +264,11 @@ func UpdateUserInfo(c *gin.Context) {
// @ID SetGlobalRecvMessageOpt
// @Accept json
// @Param token header string true "im token"
// @Param req body api.SetGlobalRecvMessageOptReq true "请求体"
// @Param req body api.SetGlobalRecvMessageOptReq true "globalRecvMsgOpt为全局免打扰设置0为关闭 1为开启"
// @Produce json
// @Success 0 {object} api.SetGlobalRecvMessageOptResp
// @Failure 500 {object} api.SetGlobalRecvMessageOptResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.SetGlobalRecvMessageOptResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /user/set_global_msg_recv_opt [post]
func SetGlobalRecvMessageOpt(c *gin.Context) {
params := api.SetGlobalRecvMessageOptReq{}
@ -318,8 +318,8 @@ func SetGlobalRecvMessageOpt(c *gin.Context) {
// @Param req body api.GetSelfUserInfoReq true "请求体"
// @Produce json
// @Success 0 {object} api.GetSelfUserInfoResp{data=open_im_sdk.UserInfo}
// @Failure 500 {object} api.GetSelfUserInfoResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetSelfUserInfoResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /user/get_self_user_info [post]
func GetSelfUserInfo(c *gin.Context) {
params := api.GetSelfUserInfoReq{}
@ -381,8 +381,8 @@ func GetSelfUserInfo(c *gin.Context) {
// @Param req body api.GetUsersOnlineStatusReq true "请求体"
// @Produce json
// @Success 0 {object} api.GetUsersOnlineStatusResp
// @Failure 500 {object} api.GetUsersOnlineStatusResp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.GetUsersOnlineStatusResp "errCode为400 一般为参数输入错误, token未带上等"
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
// @Router /user/get_users_online_status [post]
func GetUsersOnlineStatus(c *gin.Context) {
params := api.GetUsersOnlineStatusReq{}

@ -63,6 +63,6 @@ type ExpireTime struct {
type ParseTokenResp struct {
CommResp
Data map[string]interface{} `json:"data"`
Data map[string]interface{} `json:"data" swaggerignore:"true"`
ExpireTime ExpireTime `json:"-"`
}

@ -60,7 +60,7 @@ type GetBlackListReq struct {
type GetBlackListResp struct {
CommResp
BlackUserInfoList []*open_im_sdk.PublicUserInfo `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
//type PublicUserInfo struct {
@ -102,7 +102,7 @@ type GetFriendsInfoReq struct {
type GetFriendsInfoResp struct {
CommResp
FriendInfoList []*open_im_sdk.FriendInfo `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type GetFriendListReq struct {
@ -112,7 +112,7 @@ type GetFriendListReq struct {
type GetFriendListResp struct {
CommResp
FriendInfoList []*open_im_sdk.FriendInfo `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type GetFriendApplyListReq struct {
@ -122,7 +122,7 @@ type GetFriendApplyListReq struct {
type GetFriendApplyListResp struct {
CommResp
FriendRequestList []*open_im_sdk.FriendRequest `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type GetSelfApplyListReq struct {
@ -132,5 +132,5 @@ type GetSelfApplyListReq struct {
type GetSelfApplyListResp struct {
CommResp
FriendRequestList []*open_im_sdk.FriendRequest `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}

@ -33,7 +33,7 @@ type GetGroupMembersInfoReq struct {
type GetGroupMembersInfoResp struct {
CommResp
MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type InviteUserToGroupReq struct {
@ -54,7 +54,7 @@ type GetJoinedGroupListReq struct {
type GetJoinedGroupListResp struct {
CommResp
GroupInfoList []*open_im_sdk.GroupInfo `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type GetGroupMemberListReq struct {
@ -67,7 +67,7 @@ type GetGroupMemberListResp struct {
CommResp
NextSeq int32 `json:"nextSeq"`
MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type GetGroupAllMemberReq struct {
@ -77,7 +77,7 @@ type GetGroupAllMemberReq struct {
type GetGroupAllMemberResp struct {
CommResp
MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type CreateGroupReq struct {
@ -105,7 +105,7 @@ type GetGroupApplicationListReq struct {
type GetGroupApplicationListResp struct {
CommResp
GroupRequestList []*open_im_sdk.GroupRequest `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type GetUserReqGroupApplicationListReq struct {
@ -125,7 +125,7 @@ type GetGroupInfoReq struct {
type GetGroupInfoResp struct {
CommResp
GroupInfoList []*open_im_sdk.GroupInfo `json:"-"`
Data []map[string]interface{} `json:"data"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
//type GroupInfoAlias struct {

@ -39,20 +39,24 @@ type AccountCheckResp struct {
ResultList []*pbUser.AccountCheckResp_SingleUserStatus `json:"data"`
}
type ManagementSendMsg struct {
OperationID string `json:"operationID" binding:"required"`
SendID string `json:"sendID" binding:"required"`
GroupID string `json:"groupID" `
SenderNickname string `json:"senderNickname" `
SenderFaceURL string `json:"senderFaceURL" `
SenderPlatformID int32 `json:"senderPlatformID"`
//ForceList []string `json:"forceList" `
Content map[string]interface{} `json:"content" binding:"required" swaggerignore:"true"`
ContentType int32 `json:"contentType" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
IsOnlineOnly bool `json:"isOnlineOnly"`
OfflinePushInfo *open_im_sdk.OfflinePushInfo `json:"offlinePushInfo"`
}
type ManagementSendMsgReq struct {
OperationID string `json:"operationID" binding:"required"`
SendID string `json:"sendID" binding:"required"`
RecvID string `json:"recvID" `
GroupID string `json:"groupID" `
SenderNickname string `json:"senderNickname" `
SenderFaceURL string `json:"senderFaceURL" `
SenderPlatformID int32 `json:"senderPlatformID"`
ForceList []string `json:"forceList" `
Content map[string]interface{} `json:"content" binding:"required"`
ContentType int32 `json:"contentType" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
IsOnlineOnly bool `json:"isOnlineOnly"`
OfflinePushInfo *open_im_sdk.OfflinePushInfo `json:"offlinePushInfo"`
ManagementSendMsg
RecvID string `json:"recvID" `
}
type ManagementSendMsgResp struct {
@ -61,7 +65,7 @@ type ManagementSendMsgResp struct {
}
type ManagementBatchSendMsgReq struct {
ManagementSendMsgReq
ManagementSendMsg
RecvIDList []string `json:"recvIDList"`
}

@ -0,0 +1,11 @@
package base_info
type Swagger400Resp struct {
ErrCode int32 `json:"errCode" example:"400"`
ErrMsg string `json:"errMsg" example:"err msg"`
}
type Swagger500Resp struct {
ErrCode int32 `json:"errCode" example:"500"`
ErrMsg string `json:"errMsg" example:"err msg"`
}

@ -19,13 +19,20 @@ type MinioUploadFileReq struct {
FileType int `form:"fileType" binding:"required"`
}
type MinioUploadFileResp struct {
type MinioUploadFile struct {
URL string `json:"URL"`
NewName string `json:"newName"`
SnapshotURL string `json:"snapshotURL,omitempty"`
SnapshotNewName string `json:"snapshotName,omitempty"`
}
type MinioUploadFileResp struct {
CommResp
Data struct {
MinioUploadFile
} `json:"data"`
}
type UploadUpdateAppReq struct {
OperationID string `form:"operationID" binding:"required"`
Type int `form:"type" binding:"required"`

Loading…
Cancel
Save