diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_model_k.go b/pkg/common/db/mysql_model/im_mysql_model/group_model_k.go index 9cccad927..86146ab1f 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_model_k.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_model_k.go @@ -3,6 +3,7 @@ package im_mysql_model import ( "Open_IM/pkg/common/db" "Open_IM/pkg/utils" + "gorm.io/gorm" "time" ) @@ -22,6 +23,7 @@ type Group struct { ApplyMemberFriend int32 `gorm:"column:apply_member_friend" json:"applyMemberFriend"` NotificationUpdateTime time.Time `gorm:"column:notification_update_time"` NotificationUserID string `gorm:"column:notification_user_id;size:64"` + DB *gorm.DB `gorm:"-" json:"-"` } func (*Group) Create(groupList []*Group) error { @@ -29,7 +31,7 @@ func (*Group) Create(groupList []*Group) error { } func (*Group) Delete(groupIDList []string) error { - return nil + return utils.Wrap(db.DB.MysqlDB.DefaultGormDB().Where("group_id in (?)", groupIDList).Delete(&Group{}).Error, "") } func (*Group) Update(groupList []*Group) error { diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_sk.go b/pkg/common/db/mysql_model/im_mysql_model/group_sk.go index e449333cf..bbe82e1f1 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_sk.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_sk.go @@ -1,32 +1,32 @@ package im_mysql_model -func (tb *Group) Create(groups []*Group) error { - return nil -} -func (tb *Group) Take(groupIDs []string) (*Group, error) { - return nil, nil -} -func (tb *Group) Get(groupIDs []string) (*Group, error) { - return nil, nil -} -func (tb *Group) Update(groups []*Group) error { - return nil -} -func (tb *Group) GetByName(groupName string, pageNumber, showNumber int32) ([]GroupWithNum, int64, error) { - -} -func (tb *Group) GetGroups(pageNumber, showNumber int) ([]GroupWithNum, error) { -} -func (tb *Group) OperateGroupStatus(groupId string, groupStatus int32) error { -} - -func (tb *Group) GetCountsNum(groupIDs []string) ([]int32, error) { - -} - -func (tb *Group) UpdateDefaultZero(groupID string, args map[string]interface{}) error { -} - -func (tb *Group) GetGroupIDsByGroupType(groupType int) ([]string, error) { - -} +//func (tb *Group) Create(groups []*Group) error { +// return nil +//} +//func (tb *Group) Take(groupIDs []string) (*Group, error) { +// return nil, nil +//} +//func (tb *Group) Get(groupIDs []string) (*Group, error) { +// return nil, nil +//} +//func (tb *Group) Update(groups []*Group) error { +// return nil +//} +//func (tb *Group) GetByName(groupName string, pageNumber, showNumber int32) ([]GroupWithNum, int64, error) { +// +//} +//func (tb *Group) GetGroups(pageNumber, showNumber int) ([]GroupWithNum, error) { +//} +//func (tb *Group) OperateGroupStatus(groupId string, groupStatus int32) error { +//} +// +//func (tb *Group) GetCountsNum(groupIDs []string) ([]int32, error) { +// +//} +// +//func (tb *Group) UpdateDefaultZero(groupID string, args map[string]interface{}) error { +//} +// +//func (tb *Group) GetGroupIDsByGroupType(groupType int) ([]string, error) { +// +//} diff --git a/pkg/common/db/mysql_model/im_mysql_model/model_struct.go b/pkg/common/db/mysql_model/im_mysql_model/model_struct.go index a7a444cb4..865458686 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/model_struct.go +++ b/pkg/common/db/mysql_model/im_mysql_model/model_struct.go @@ -1,7 +1,6 @@ package im_mysql_model import ( - "gorm.io/gorm" "time" ) @@ -87,26 +86,26 @@ func (FriendRequest) TableName() string { // } // // open_im_sdk.GroupInfo (OwnerUserID , MemberCount )> imdb.Group -type Group struct { - //`json:"operationID" binding:"required"` - //`protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` `json:"operationID" binding:"required"` - GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"` - GroupName string `gorm:"column:name;size:255" json:"groupName"` - Notification string `gorm:"column:notification;size:255" json:"notification"` - Introduction string `gorm:"column:introduction;size:255" json:"introduction"` - FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"` - CreateTime time.Time `gorm:"column:create_time;index:create_time"` - Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"` - Status int32 `gorm:"column:status"` - CreatorUserID string `gorm:"column:creator_user_id;size:64"` - GroupType int32 `gorm:"column:group_type"` - NeedVerification int32 `gorm:"column:need_verification"` - LookMemberInfo int32 `gorm:"column:look_member_info" json:"lookMemberInfo"` - ApplyMemberFriend int32 `gorm:"column:apply_member_friend" json:"applyMemberFriend"` - NotificationUpdateTime time.Time `gorm:"column:notification_update_time"` - NotificationUserID string `gorm:"column:notification_user_id;size:64"` - DB *gorm.DB `gorm:"-" json:"-"` -} +//type Group struct { +// //`json:"operationID" binding:"required"` +// //`protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` `json:"operationID" binding:"required"` +// GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"` +// GroupName string `gorm:"column:name;size:255" json:"groupName"` +// Notification string `gorm:"column:notification;size:255" json:"notification"` +// Introduction string `gorm:"column:introduction;size:255" json:"introduction"` +// FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"` +// CreateTime time.Time `gorm:"column:create_time;index:create_time"` +// Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"` +// Status int32 `gorm:"column:status"` +// CreatorUserID string `gorm:"column:creator_user_id;size:64"` +// GroupType int32 `gorm:"column:group_type"` +// NeedVerification int32 `gorm:"column:need_verification"` +// LookMemberInfo int32 `gorm:"column:look_member_info" json:"lookMemberInfo"` +// ApplyMemberFriend int32 `gorm:"column:apply_member_friend" json:"applyMemberFriend"` +// NotificationUpdateTime time.Time `gorm:"column:notification_update_time"` +// NotificationUserID string `gorm:"column:notification_user_id;size:64"` +// DB *gorm.DB `gorm:"-" json:"-"` +//} // message GroupMemberFullInfo { // string GroupID = 1 ;