fix(chat): 修复一键清理未读失败
This commit is contained in:
@@ -82,6 +82,19 @@ func (h *Handler) AdminMarkRead(c *gin.Context) {
|
||||
h.markRead(c, Principal{Type: "admin", ID: adminID})
|
||||
}
|
||||
|
||||
func (h *Handler) AdminMarkAllRead(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
response.Unauthorized(c, "缺少管理员上下文")
|
||||
return
|
||||
}
|
||||
if err := h.service.MarkAllAdminConversationsRead(c.Request.Context(), adminID); err != nil {
|
||||
writeChatError(c, err)
|
||||
return
|
||||
}
|
||||
response.OK(c, gin.H{"read": true})
|
||||
}
|
||||
|
||||
func (h *Handler) AdminTransfer(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user