mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-14 05:56:00 +08:00
1
This commit is contained in:
@@ -17,7 +17,9 @@ type GroupInterface interface {
|
||||
CreateGroup(ctx context.Context, groups []*relation.Group, groupMember []*relation.GroupMember) error
|
||||
DeleteGroupByIDs(ctx context.Context, groupIDs []string) error
|
||||
TakeGroupByID(ctx context.Context, groupID string) (group *relation.Group, err error)
|
||||
|
||||
GetJoinedGroupList(ctx context.Context, userID string) ([]*relation.Group, error)
|
||||
GetGroupMemberNum(ctx context.Context, groupIDs []string) (map[string]int, error)
|
||||
GetGroupOwnerUserID(ctx context.Context, groupIDs []string) (map[string]string, error)
|
||||
//mongo
|
||||
CreateSuperGroup(ctx context.Context, groupID string, initMemberIDList []string) error
|
||||
GetSuperGroupByID(ctx context.Context, groupID string) (superGroup *unrelation.SuperGroup, err error)
|
||||
@@ -56,10 +58,16 @@ func (g *GroupController) CreateSuperGroup(ctx context.Context, groupID string,
|
||||
return g.database.CreateSuperGroup(ctx, groupID, initMemberIDList)
|
||||
}
|
||||
|
||||
func (g *GroupController) GetJoinedGroupList(ctx context.Context, userID string) ([]*relation.Group, error) {
|
||||
return g.database.GetJoinedGroupList(ctx, userID)
|
||||
}
|
||||
|
||||
type DataBase interface {
|
||||
FindGroupsByID(ctx context.Context, groupIDs []string) (groups []*relation.Group, err error)
|
||||
CreateGroup(ctx context.Context, groups []*relation.Group, groupMember []*relation.GroupMember) error
|
||||
DeleteGroupByIDs(ctx context.Context, groupIDs []string) error
|
||||
GetJoinedGroupList(ctx context.Context, userID string) ([]*relation.Group, error)
|
||||
|
||||
TakeGroupByID(ctx context.Context, groupID string) (group *relation.Group, err error)
|
||||
GetSuperGroupByID(ctx context.Context, groupID string) (superGroup *unrelation.SuperGroup, err error)
|
||||
CreateSuperGroup(ctx context.Context, groupID string, initMemberIDList []string) error
|
||||
@@ -146,6 +154,11 @@ func (g *GroupDataBase) Update(ctx context.Context, groups []*relation.Group) er
|
||||
})
|
||||
}
|
||||
|
||||
func (g *GroupDataBase) GetJoinedGroupList(ctx context.Context, userID string) ([]*relation.Group, error) {
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (g *GroupDataBase) CreateSuperGroup(ctx context.Context, groupID string, initMemberIDList []string) error {
|
||||
sess, err := g.mongoDB.MgoClient.StartSession()
|
||||
if err != nil {
|
||||
|
||||
@@ -159,15 +159,15 @@ func CheckAccess(ctx context.Context, OpUserID string, OwnerUserID string) bool
|
||||
return false
|
||||
}
|
||||
|
||||
func CheckAccessV3(ctx context.Context, OwnerUserID string) (err error) {
|
||||
func CheckAccessV3(ctx context.Context, ownerUserID string) (err error) {
|
||||
opUserID := tools.OpUserID(ctx)
|
||||
defer func() {
|
||||
trace_log.SetCtxInfo(ctx, utils.GetFuncName(1), err, "OpUserID", opUserID, "OwnerUserID", OwnerUserID)
|
||||
trace_log.SetCtxInfo(ctx, utils.GetFuncName(1), err, "OpUserID", opUserID, "ownerUserID", ownerUserID)
|
||||
}()
|
||||
if utils.IsContain(opUserID, config.Config.Manager.AppManagerUid) {
|
||||
return nil
|
||||
}
|
||||
if opUserID == OwnerUserID {
|
||||
if opUserID == ownerUserID {
|
||||
return nil
|
||||
}
|
||||
return constant.ErrIdentity.Wrap(utils.GetSelfFuncName())
|
||||
|
||||
@@ -81,7 +81,7 @@ type GroupInfo struct {
|
||||
Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"`
|
||||
FaceURL string `protobuf:"bytes,5,opt,name=faceURL" json:"faceURL,omitempty"`
|
||||
OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID" json:"ownerUserID,omitempty"`
|
||||
CreateTime uint32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"`
|
||||
CreateTime int64 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"`
|
||||
MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount" json:"memberCount,omitempty"`
|
||||
Ex string `protobuf:"bytes,9,opt,name=ex" json:"ex,omitempty"`
|
||||
Status int32 `protobuf:"varint,10,opt,name=status" json:"status,omitempty"`
|
||||
@@ -90,7 +90,7 @@ type GroupInfo struct {
|
||||
NeedVerification int32 `protobuf:"varint,13,opt,name=needVerification" json:"needVerification,omitempty"`
|
||||
LookMemberInfo int32 `protobuf:"varint,14,opt,name=lookMemberInfo" json:"lookMemberInfo,omitempty"`
|
||||
ApplyMemberFriend int32 `protobuf:"varint,15,opt,name=applyMemberFriend" json:"applyMemberFriend,omitempty"`
|
||||
NotificationUpdateTime uint32 `protobuf:"varint,16,opt,name=notificationUpdateTime" json:"notificationUpdateTime,omitempty"`
|
||||
NotificationUpdateTime int64 `protobuf:"varint,16,opt,name=notificationUpdateTime" json:"notificationUpdateTime,omitempty"`
|
||||
NotificationUserID string `protobuf:"bytes,17,opt,name=notificationUserID" json:"notificationUserID,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
|
||||
Reference in New Issue
Block a user