mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-09 03:25:59 +08:00
Refactor code
This commit is contained in:
@@ -108,12 +108,11 @@ type GetGroupInfoResp struct {
|
||||
}
|
||||
|
||||
type ApplicationGroupResponseReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"` //application from FromUserID
|
||||
HandledMsg string `json:"handledMsg"`
|
||||
//`json:"flag" binding:"required,oneof=-1 0 1"`
|
||||
HandleResult int32 `json:"handleResult" binding:"required,oneof=-1 1"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
FromUserID string `json:"fromUserID" binding:"required"` //application from FromUserID
|
||||
HandledMsg string `json:"handledMsg"`
|
||||
HandleResult int32 `json:"handleResult" binding:"required,oneof=-1 1"`
|
||||
}
|
||||
type ApplicationGroupResponseResp struct {
|
||||
CommResp
|
||||
|
||||
@@ -210,6 +210,19 @@ func GetJoinedGroupIDListByUserID(userID string) ([]string, error) {
|
||||
return groupIDList, nil
|
||||
}
|
||||
|
||||
func IsGroupOwnerAdmin(groupID, UserID string) bool {
|
||||
groupMemberList, err := GetOwnerManagerByGroupID(groupID)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
for _, v := range groupMemberList {
|
||||
if v.UserID == UserID && v.RoleLevel > constant.GroupOrdinaryUsers {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
//
|
||||
//func SelectGroupList(groupID string) ([]string, error) {
|
||||
// var groupUserID string
|
||||
|
||||
Reference in New Issue
Block a user