mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-07 18:45:58 +08:00
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package base_info
|
||||
|
||||
import (
|
||||
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||
)
|
||||
|
||||
@@ -135,7 +136,7 @@ type QuitGroupResp struct {
|
||||
}
|
||||
|
||||
type SetGroupInfoReq struct {
|
||||
open_im_sdk.GroupInfo
|
||||
imdb.Group
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type SetGroupInfoResp struct {
|
||||
|
||||
@@ -79,7 +79,7 @@ func GetGroupMemberInfoByGroupIDAndUserID(groupID, userID string) (*GroupMember,
|
||||
return nil, err
|
||||
}
|
||||
var groupMember GroupMember
|
||||
err = dbConn.Table("group_member").Where("group_id=? and user_id=? limit 1", groupID, userID).Find(&groupMember).Error
|
||||
err = dbConn.Table("group_member").Where("group_id=? and user_id=? ", groupID, userID).Limit(1).Find(&groupMember).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -91,7 +91,7 @@ func DeleteGroupMemberByGroupIDAndUserID(groupID, userID string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = dbConn.Table("group_member").Where("group_id=? and user_id=? limit 1", groupID, userID).Delete(&GroupMember{}).Error
|
||||
err = dbConn.Table("group_member").Where("group_id=? and user_id=? ", groupID, userID).Delete(&GroupMember{}).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -52,6 +52,6 @@ func SetGroupInfo(groupInfo Group) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = dbConn.Table("friend_request").Where("group_id=?", groupInfo.GroupID).Update(&groupInfo).Error
|
||||
err = dbConn.Table("group").Where("group_id=?", groupInfo.GroupID).Update(&groupInfo).Error
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -63,17 +63,19 @@ type FriendRequest struct {
|
||||
//}
|
||||
// open_im_sdk.GroupInfo (OwnerUserID , MemberCount )> imdb.Group
|
||||
type Group struct {
|
||||
GroupID string `gorm:"column:group_id;primaryKey;"`
|
||||
GroupName string `gorm:"column:name"`
|
||||
Notification string `gorm:"column:notification"`
|
||||
Introduction string `gorm:"column:introduction"`
|
||||
FaceUrl string `gorm:"column:face_url"`
|
||||
//`json:"operationID" binding:"required"`
|
||||
//`protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` `json:"operationID" binding:"required"`
|
||||
GroupID string `gorm:"column:group_id;primaryKey;" json:"groupID" binding:"required"`
|
||||
GroupName string `gorm:"column:name" json:"groupName"`
|
||||
Notification string `gorm:"column:notification" json:"notification"`
|
||||
Introduction string `gorm:"column:introduction" json:"introduction"`
|
||||
FaceUrl string `gorm:"column:face_url" json:"faceUrl"`
|
||||
|
||||
CreateTime time.Time `gorm:"column:create_time"`
|
||||
Status int32 `gorm:"column:status"`
|
||||
CreatorUserID string `gorm:"column:creator_user_id"`
|
||||
GroupType int32 `gorm:"column:group_type"`
|
||||
Ex string `gorm:"column:ex"`
|
||||
Ex string `gorm:"column:ex" json:"ex"`
|
||||
}
|
||||
|
||||
//message GroupMemberFullInfo {
|
||||
|
||||
Reference in New Issue
Block a user