int32 modify

pull/173/head
Gordon 3 years ago
parent 0315abc0df
commit 9d132d7f92

@ -128,7 +128,7 @@ func GetGroupByName(c *gin.Context) {
func CreateGroup(c *gin.Context) { func CreateGroup(c *gin.Context) {
var ( var (
req cms_api_struct.CreateGroupRequest req cms_api_struct.CreateGroupRequest
_ cms_api_struct.CreateGroupResponse _ cms_api_struct.CreateGroupResponse
reqPb pbGroup.CreateGroupReq reqPb pbGroup.CreateGroupReq
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
@ -253,9 +253,9 @@ func OpenPrivateChat(c *gin.Context) {
func GetGroupMembers(c *gin.Context) { func GetGroupMembers(c *gin.Context) {
var ( var (
req cms_api_struct.GetGroupMembersRequest req cms_api_struct.GetGroupMembersRequest
reqPb pbGroup.GetGroupMembersCMSReq reqPb pbGroup.GetGroupMembersCMSReq
resp cms_api_struct.GetGroupMembersResponse resp cms_api_struct.GetGroupMembersResponse
) )
if err := c.ShouldBindQuery(&req); err != nil { if err := c.ShouldBindQuery(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error())
@ -286,21 +286,20 @@ func GetGroupMembers(c *gin.Context) {
MemberPosition: int(groupMembers.RoleLevel), MemberPosition: int(groupMembers.RoleLevel),
MemberNickName: groupMembers.Nickname, MemberNickName: groupMembers.Nickname,
MemberId: groupMembers.UserID, MemberId: groupMembers.UserID,
JoinTime: utils.UnixSecondToTime(groupMembers.JoinTime).String(), JoinTime: utils.UnixSecondToTime(int64(groupMembers.JoinTime)).String(),
}) })
} }
openIMHttp.RespHttp200(c, constant.OK, resp) openIMHttp.RespHttp200(c, constant.OK, resp)
} }
func AddGroupMembers(c *gin.Context) { func AddGroupMembers(c *gin.Context) {
var ( var (
req cms_api_struct.RemoveGroupMembersRequest req cms_api_struct.RemoveGroupMembersRequest
resp cms_api_struct.RemoveGroupMembersResponse resp cms_api_struct.RemoveGroupMembersResponse
reqPb pbGroup.AddGroupMembersCMSReq reqPb pbGroup.AddGroupMembersCMSReq
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
log.NewError(reqPb.OperationId, utils.GetSelfFuncName(),"BindJSON failed ", err.Error()) log.NewError(reqPb.OperationId, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil) openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return return
} }
@ -321,12 +320,12 @@ func AddGroupMembers(c *gin.Context) {
func RemoveGroupMembers(c *gin.Context) { func RemoveGroupMembers(c *gin.Context) {
var ( var (
req cms_api_struct.RemoveGroupMembersRequest req cms_api_struct.RemoveGroupMembersRequest
resp cms_api_struct.RemoveGroupMembersResponse resp cms_api_struct.RemoveGroupMembersResponse
reqPb pbGroup.RemoveGroupMembersCMSReq reqPb pbGroup.RemoveGroupMembersCMSReq
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(),"BindJSON failed ", err.Error()) log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil) openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return return
} }
@ -347,12 +346,12 @@ func RemoveGroupMembers(c *gin.Context) {
func DeleteGroup(c *gin.Context) { func DeleteGroup(c *gin.Context) {
var ( var (
req cms_api_struct.DeleteGroupRequest req cms_api_struct.DeleteGroupRequest
_ cms_api_struct.DeleteGroupResponse _ cms_api_struct.DeleteGroupResponse
reqPb pbGroup.DeleteGroupReq reqPb pbGroup.DeleteGroupReq
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(),"BindJSON failed ", err.Error()) log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil) openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return return
} }
@ -370,12 +369,12 @@ func DeleteGroup(c *gin.Context) {
func SetGroupMaster(c *gin.Context) { func SetGroupMaster(c *gin.Context) {
var ( var (
req cms_api_struct.SetGroupMasterRequest req cms_api_struct.SetGroupMasterRequest
_ cms_api_struct.SetGroupMasterResponse _ cms_api_struct.SetGroupMasterResponse
reqPb pbGroup.OperateUserRoleReq reqPb pbGroup.OperateUserRoleReq
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(),"BindJSON failed ", err.Error()) log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil) openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return return
} }
@ -395,8 +394,8 @@ func SetGroupMaster(c *gin.Context) {
func SetGroupOrdinaryUsers(c *gin.Context) { func SetGroupOrdinaryUsers(c *gin.Context) {
var ( var (
req cms_api_struct.SetGroupMemberRequest req cms_api_struct.SetGroupMemberRequest
_ cms_api_struct.AdminLoginResponse _ cms_api_struct.AdminLoginResponse
reqPb pbGroup.OperateUserRoleReq reqPb pbGroup.OperateUserRoleReq
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
@ -420,8 +419,8 @@ func SetGroupOrdinaryUsers(c *gin.Context) {
func AlterGroupInfo(c *gin.Context) { func AlterGroupInfo(c *gin.Context) {
var ( var (
req cms_api_struct.AlterGroupInfoRequest req cms_api_struct.AlterGroupInfoRequest
_ cms_api_struct.SetGroupMasterResponse _ cms_api_struct.SetGroupMasterResponse
reqPb pbGroup.SetGroupInfoReq reqPb pbGroup.SetGroupInfoReq
) )
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {
@ -431,12 +430,12 @@ func AlterGroupInfo(c *gin.Context) {
} }
reqPb.OpUserID = c.MustGet("userID").(string) reqPb.OpUserID = c.MustGet("userID").(string)
reqPb.GroupInfo = &commonPb.GroupInfo{ reqPb.GroupInfo = &commonPb.GroupInfo{
GroupID: req.GroupID, GroupID: req.GroupID,
GroupName: req.GroupName, GroupName: req.GroupName,
Introduction: req.Introduction, Introduction: req.Introduction,
Notification: req.Notification, Notification: req.Notification,
FaceURL: req.ProfilePhoto, FaceURL: req.ProfilePhoto,
GroupType: int32(req.GroupType), GroupType: int32(req.GroupType),
} }
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName)
client := pbGroup.NewGroupClient(etcdConn) client := pbGroup.NewGroupClient(etcdConn)
@ -447,4 +446,4 @@ func AlterGroupInfo(c *gin.Context) {
return return
} }
openIMHttp.RespHttp200(c, constant.OK, nil) openIMHttp.RespHttp200(c, constant.OK, nil)
} }

Loading…
Cancel
Save