You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
1.2 KiB

package allhelp
import (
"yunyan/comm"
"yunyan/pb"
)
// ListChatSummaries 按日期范围列出聊天总结
// @Summary 列表每日聊天总结
// @Description 按日期范围查询当前用户的每日聊天总结列表
// @Tags Allhelp
// @Accept json
// @Produce json
// @Security BearerAuth
// @Param user body pb.AllhelpListChatSummariesReq true "请求数据"
// @Success 200 {object} comm.HttpResult{data=pb.AllhelpListChatSummariesResp} "响应数据"
// @Router /api/home/allhelp_listchatsummaries [post]
func (this *apiComp) ListChatSummaries(session comm.IUserSession, req *pb.AllhelpListChatSummariesReq) (resp *pb.AllhelpListChatSummariesResp, errdata *pb.ErrorData) {
uid := session.GetUserId()
if uid == "" {
errdata = &pb.ErrorData{Code: pb.ErrorCode_ReqParameterError, Message: "用户未登录"}
return
}
page := req.Page
if page <= 0 {
page = 1
}
size := req.Size
if size <= 0 {
size = 20
}
list, total, err := this.module.model.listChatSummaries(uid, req.StartDate, req.EndDate, page, size)
if err != nil {
this.module.Errorln("ListChatSummaries error:", err)
errdata = &pb.ErrorData{Code: pb.ErrorCode_DBError, Message: "查询失败"}
return
}
resp = &pb.AllhelpListChatSummariesResp{Records: list, Total: total}
return
}