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.
 
 
 
 
 
 

35 lines
1.1 KiB

package allhelp
import (
"yunyan/comm"
"yunyan/pb"
)
// DelChatSummary 删除指定总结记录
// @Summary 删除每日聊天总结
// @Description 删除当前用户的指定总结记录
// @Tags Allhelp
// @Accept json
// @Produce json
// @Security BearerAuth
// @Param user body pb.AllhelpDelChatSummaryReq true "请求数据"
// @Success 200 {object} comm.HttpResult{data=pb.AllhelpDelChatSummaryResp} "响应数据"
// @Router /api/home/allhelp_delchatsummary [post]
func (this *apiComp) DelChatSummary(session comm.IUserSession, req *pb.AllhelpDelChatSummaryReq) (resp *pb.AllhelpDelChatSummaryResp, errdata *pb.ErrorData) {
uid := session.GetUserId()
if uid == "" {
errdata = &pb.ErrorData{Code: pb.ErrorCode_ReqParameterError, Message: "用户未登录"}
return
}
if req.Id == 0 {
errdata = &pb.ErrorData{Code: pb.ErrorCode_ReqParameterError, Message: "id 无效"}
return
}
if err := this.module.model.delChatSummary(uid, req.Id); err != nil {
this.module.Errorln("DelChatSummary error:", err)
errdata = &pb.ErrorData{Code: pb.ErrorCode_DBError, Message: "删除失败"}
return
}
resp = &pb.AllhelpDelChatSummaryResp{}
return
}