mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-19 00:09:02 +08:00
fcm ios push badge
This commit is contained in:
@@ -61,9 +61,10 @@ type SetConversationResp struct {
|
||||
}
|
||||
type ModifyConversationFieldReq struct {
|
||||
Conversation
|
||||
FieldType int32 `json:"fieldType" binding:"required"`
|
||||
UserIDList []string `json:"userIDList" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
FieldType int32 `json:"fieldType" binding:"required"`
|
||||
UserIDList []string `json:"userIDList" binding:"required"`
|
||||
BadgeUnreadCountSum int32 `json:"badgeUnreadCountSum"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type ModifyConversationFieldResp struct {
|
||||
CommResp
|
||||
|
||||
@@ -37,6 +37,7 @@ const (
|
||||
groupMaxSeq = "GROUP_MAX_SEQ:"
|
||||
groupMinSeq = "GROUP_MIN_SEQ:"
|
||||
sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:"
|
||||
userBadgeUnreadCountSum = "USER_BADGE_UNREAD_COUNT_SUM:"
|
||||
)
|
||||
|
||||
func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) {
|
||||
@@ -411,3 +412,12 @@ func (d *DataBases) GetFcmToken(account string, platformid int) (string, error)
|
||||
key := FcmToken + account + ":" + strconv.Itoa(platformid)
|
||||
return d.RDB.Get(context.Background(), key).Result()
|
||||
}
|
||||
func (d *DataBases) IncrUserBadgeUnreadCountSum(uid string) (int, error) {
|
||||
key := userBadgeUnreadCountSum + uid
|
||||
seq, err := d.RDB.Incr(context.Background(), key).Result()
|
||||
return int(seq), err
|
||||
}
|
||||
func (d *DataBases) SetUserBadgeUnreadCountSum(uid string, value int) error {
|
||||
key := userBadgeUnreadCountSum + uid
|
||||
return d.RDB.Set(context.Background(), key, value, 0).Err()
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ message ModifyConversationFieldReq{
|
||||
int32 fieldType = 2;
|
||||
repeated string userIDList = 3;
|
||||
string operationID = 4;
|
||||
int32 badgeUnreadCountSum = 5;
|
||||
}
|
||||
|
||||
message ModifyConversationFieldResp{
|
||||
|
||||
Reference in New Issue
Block a user