mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-01 07:35:58 +08:00
set IsMsgDestruct
This commit is contained in:
@@ -93,5 +93,5 @@ func (c *ConversationGorm) GetConversationsByConversationID(ctx context.Context,
|
||||
}
|
||||
|
||||
func (c *ConversationGorm) GetConversationIDsNeedDestruct(ctx context.Context) (conversations []*relation.ConversationModel, err error) {
|
||||
return conversations, utils.Wrap(c.db(ctx).Where("UNIX_TIMESTAMP(NOW()) > (msg_destruct_time + UNIX_TIMESTAMP(latest_msg_destruct_time)) && msg_destruct_time != 0").Error, "")
|
||||
return conversations, utils.Wrap(c.db(ctx).Where("is_msg_destruct = 1 && UNIX_TIMESTAMP(NOW()) > (msg_destruct_time + UNIX_TIMESTAMP(latest_msg_destruct_time)) && msg_destruct_time != 0").Error, "")
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ type ConversationModel struct {
|
||||
MaxSeq int64 `gorm:"column:max_seq" json:"maxSeq"`
|
||||
MinSeq int64 `gorm:"column:min_seq" json:"minSeq"`
|
||||
CreateTime time.Time `gorm:"column:create_time;index:create_time;autoCreateTime"`
|
||||
MsgDestructTime int64 `gorm:"column:msg_destruct_time;default:0"`
|
||||
IsMsgDestruct bool `gorm:"column:is_msg_destruct;default:false"`
|
||||
MsgDestructTime int64 `gorm:"column:msg_destruct_time;default:604800"`
|
||||
LatestMsgDestructTime time.Time `gorm:"column:latest_msg_destruct_time;autoCreateTime"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user