by Robin at 20240726

This commit is contained in:
Leufolium 2024-07-26 12:58:48 +08:00
parent 34bbcdf627
commit ae595246be
4 changed files with 19 additions and 4 deletions

View File

@ -36,6 +36,12 @@ const (
ContactCustomerService_Read = 1 //已读
)
// 联系客服表是否自动回复
const (
ContactCustomerService_NotAutoResponsed = 0 //未读
ContactCustomerService_AutoResponsed = 1 //未读
)
// 图像审核表状态
const (
ImageAudit_Created = 0 //已创建

View File

@ -12,6 +12,7 @@ type ApiCreateReq struct {
}
type ApiCreateData struct {
IsAutoResponsed int64 `json:"is_auto_responsed"`
}
type ApiCreateResp struct {

View File

@ -13,14 +13,18 @@ import (
func ApiCreateContactCustomerService(ctx *gin.Context) {
req := ctx.MustGet("client_req").(*contact_customer_serviceproto.ApiCreateReq)
ec := service.DefaultService.ApiCreateContactCustomerService(ctx, req)
isAutoResponsed, ec := service.DefaultService.ApiCreateContactCustomerService(ctx, req)
if ec != errcode.ErrCodeContactCustomerServiceSrvOk {
logger.Error("OpCreateContactCustomerService fail, req: %v, ec: %v", util.ToJson(req), ec)
ReplyErrorMsg(ctx, "server error")
return
}
ReplyOk(ctx, nil)
data := &contact_customer_serviceproto.ApiCreateData{
IsAutoResponsed: isAutoResponsed,
}
ReplyOk(ctx, data)
}
func ApiGetContactCustomerServiceListBySessionId(ctx *gin.Context) {

View File

@ -1975,8 +1975,10 @@ func (s *Service) ApiGetRealNameAuthenticationListByMid(ctx *gin.Context, req *r
}
// ContactCustomerService
func (s *Service) ApiCreateContactCustomerService(ctx *gin.Context, req *contact_customer_service_proto.ApiCreateReq) (ec errcode.ErrCode) {
func (s *Service) ApiCreateContactCustomerService(ctx *gin.Context, req *contact_customer_service_proto.ApiCreateReq) (isAutoResponsed int64, ec errcode.ErrCode) {
ec = errcode.ErrCodeContactCustomerServiceSrvOk
isAutoResponsed = consts.ContactCustomerService_NotAutoResponsed
err := _DefaultContactCustomerService.OpCreate(ctx, &contact_customer_service_proto.OpCreateReq{
ContactCustomerService: req.ContactCustomerService,
})
@ -2003,7 +2005,8 @@ func (s *Service) ApiCreateContactCustomerService(ctx *gin.Context, req *contact
err = apollo.GetJson(consts.AutoResponseKey, &cfg, apollo.ApolloOpts().SetNamespace("application"))
if err != nil {
logger.Error("Apollo read failed : %v", err)
return errcode.ErrCodeApolloReadFail
ec = errcode.ErrCodeApolloReadFail
return
}
//如果在自动回复时间段,则创建一条自动回复信息
@ -2032,6 +2035,7 @@ func (s *Service) ApiCreateContactCustomerService(ctx *gin.Context, req *contact
ec = errcode.ErrCodeContactCustomerServiceSrvFail
return
}
isAutoResponsed = consts.ContactCustomerService_AutoResponsed
}
}
return