refactor(cache): remove deprecated unread count methods and keys
Clean up the codebase by removing unused and deprecated unread count functionality in `ConversationCache` and associated Redis key generators. This follows the transition to sequence-based unread calculation. - Remove `IncrementUnread`, `ClearUnread`, `GetUnreadCountFromHash`, `GetAllUnreadCounts`, and `GetTotalUnread` from `ConversationCache`. - Remove `PrefixUnreadHash` and `PrefixUnreadTotal` constants and `UnreadHashKey`/`UnreadTotalKey` helper functions. - Remove unused `isValidContentType` helper in `MessageHandler`.
This commit is contained in:
@@ -653,16 +653,6 @@ func (h *MessageHandler) DeleteMessage(c *gin.Context) {
|
||||
response.SuccessWithMessage(c, "message deleted", nil)
|
||||
}
|
||||
|
||||
// 辅助函数:验证内容类型
|
||||
func isValidContentType(contentType model.ContentType) bool {
|
||||
switch contentType {
|
||||
case model.ContentTypeText, model.ContentTypeImage, model.ContentTypeVideo, model.ContentTypeAudio, model.ContentTypeFile:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// 辅助函数:获取会话参与者信息
|
||||
func (h *MessageHandler) getConversationParticipants(ctx context.Context, conversationID string, currentUserID string) ([]*model.User, error) {
|
||||
// 从repository获取参与者列表
|
||||
|
||||
Reference in New Issue
Block a user