Show group notification editor

pull/255/head
skiffer-git 3 years ago
parent fb4cef7ccb
commit 2d110deb09

@ -145,10 +145,10 @@ func main() {
chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg)
}
//Manager
managementGroup := r.Group("/manager")
{
managementGroup.POST("/delete_user", manage.DeleteUser) //1
}
//managementGroup := r.Group("/manager")
//{
// managementGroup.POST("/delete_user", manage.DeleteUser) //1
//}
//Conversation
conversationGroup := r.Group("/conversation")
{ //1

@ -243,13 +243,18 @@ func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJo
owner, err2 := imdb.GetGroupOwnerInfoByGroupID(v)
group, err := imdb.GetGroupInfoByGroupID(v)
if num > 0 && owner != nil && err2 == nil && group != nil && err == nil {
if group.Status == constant.GroupStatusDismissed {
log.NewError(req.OperationID, "constant.GroupStatusDismissed ", group)
continue
}
utils.CopyStructFields(&groupNode, group)
groupNode.CreateTime = uint32(group.CreateTime.Unix())
groupNode.MemberCount = uint32(num)
groupNode.NotificationUpdateTime = uint32(group.NotificationUpdateTime.Unix())
groupNode.MemberCount = num
groupNode.OwnerUserID = owner.UserID
resp.GroupList = append(resp.GroupList, &groupNode)
} else {
log.NewError(req.OperationID, "check nil ", num, owner, err, group)
log.NewError(req.OperationID, "check nil ", num, owner, err, group, err2)
continue
}
log.NewDebug(req.OperationID, "joinedGroup ", groupNode)
@ -1129,6 +1134,10 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf
//only administrators can set group information
var groupInfo db.Group
utils.CopyStructFields(&groupInfo, req.GroupInfoForSet)
if req.GroupInfoForSet.Notification != "" {
groupInfo.NotificationUserID = req.OpUserID
groupInfo.NotificationUpdateTime = time.Now()
}
err = imdb.SetGroupInfo(groupInfo)
if err != nil {
log.NewError(req.OperationID, "SetGroupInfo failed ", err.Error(), groupInfo)

@ -77,19 +77,21 @@ func (FriendRequest) TableName() string {
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"`
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"`
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"`
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"`
}
//message GroupMemberFullInfo {

@ -98,6 +98,7 @@ func GroupDBCopyOpenIM(dst *open_im_sdk.GroupInfo, src *db.Group) error {
return utils.Wrap(err, "")
}
dst.CreateTime = uint32(src.CreateTime.Unix())
dst.NotificationUpdateTime = uint32(src.NotificationUpdateTime.Unix())
return nil
}

File diff suppressed because it is too large Load Diff

@ -23,6 +23,8 @@ message GroupInfo{
int32 needVerification = 13;
int32 lookMemberInfo =14;
int32 applyMemberFriend = 15;
uint32 notificationUpdateTime = 16;
string notificationUserID = 17;
}
message GroupInfoForSet{

Loading…
Cancel
Save