perf(chat): 分页客服会话并拆分统计查询
This commit is contained in:
@@ -25,6 +25,27 @@ func (h *Handler) AdminList(c *gin.Context) {
|
||||
response.OK(c, result)
|
||||
}
|
||||
|
||||
func (h *Handler) AdminCounts(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
response.Unauthorized(c, "缺少管理员上下文")
|
||||
return
|
||||
}
|
||||
principal := Principal{Type: "admin", ID: adminID}
|
||||
result, err := h.service.AdminConversationCounts(
|
||||
c.Request.Context(),
|
||||
principal,
|
||||
c.DefaultQuery("filter", "all"),
|
||||
c.DefaultQuery("stage", "all"),
|
||||
c.Query("keyword"),
|
||||
)
|
||||
if err != nil {
|
||||
writeChatError(c, err)
|
||||
return
|
||||
}
|
||||
response.OK(c, result)
|
||||
}
|
||||
|
||||
func (h *Handler) AdminDetail(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user