by Robin at 20240726
This commit is contained in:
parent
34bbcdf627
commit
ae595246be
|
@ -36,6 +36,12 @@ const (
|
||||||
ContactCustomerService_Read = 1 //已读
|
ContactCustomerService_Read = 1 //已读
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 联系客服表是否自动回复
|
||||||
|
const (
|
||||||
|
ContactCustomerService_NotAutoResponsed = 0 //未读
|
||||||
|
ContactCustomerService_AutoResponsed = 1 //未读
|
||||||
|
)
|
||||||
|
|
||||||
// 图像审核表状态
|
// 图像审核表状态
|
||||||
const (
|
const (
|
||||||
ImageAudit_Created = 0 //已创建
|
ImageAudit_Created = 0 //已创建
|
||||||
|
|
|
@ -12,6 +12,7 @@ type ApiCreateReq struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ApiCreateData struct {
|
type ApiCreateData struct {
|
||||||
|
IsAutoResponsed int64 `json:"is_auto_responsed"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ApiCreateResp struct {
|
type ApiCreateResp struct {
|
||||||
|
|
|
@ -13,14 +13,18 @@ import (
|
||||||
|
|
||||||
func ApiCreateContactCustomerService(ctx *gin.Context) {
|
func ApiCreateContactCustomerService(ctx *gin.Context) {
|
||||||
req := ctx.MustGet("client_req").(*contact_customer_serviceproto.ApiCreateReq)
|
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 {
|
if ec != errcode.ErrCodeContactCustomerServiceSrvOk {
|
||||||
logger.Error("OpCreateContactCustomerService fail, req: %v, ec: %v", util.ToJson(req), ec)
|
logger.Error("OpCreateContactCustomerService fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||||
ReplyErrorMsg(ctx, "server error")
|
ReplyErrorMsg(ctx, "server error")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ReplyOk(ctx, nil)
|
data := &contact_customer_serviceproto.ApiCreateData{
|
||||||
|
IsAutoResponsed: isAutoResponsed,
|
||||||
|
}
|
||||||
|
|
||||||
|
ReplyOk(ctx, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ApiGetContactCustomerServiceListBySessionId(ctx *gin.Context) {
|
func ApiGetContactCustomerServiceListBySessionId(ctx *gin.Context) {
|
||||||
|
|
|
@ -1975,8 +1975,10 @@ func (s *Service) ApiGetRealNameAuthenticationListByMid(ctx *gin.Context, req *r
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContactCustomerService
|
// 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
|
ec = errcode.ErrCodeContactCustomerServiceSrvOk
|
||||||
|
isAutoResponsed = consts.ContactCustomerService_NotAutoResponsed
|
||||||
|
|
||||||
err := _DefaultContactCustomerService.OpCreate(ctx, &contact_customer_service_proto.OpCreateReq{
|
err := _DefaultContactCustomerService.OpCreate(ctx, &contact_customer_service_proto.OpCreateReq{
|
||||||
ContactCustomerService: req.ContactCustomerService,
|
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"))
|
err = apollo.GetJson(consts.AutoResponseKey, &cfg, apollo.ApolloOpts().SetNamespace("application"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("Apollo read failed : %v", err)
|
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
|
ec = errcode.ErrCodeContactCustomerServiceSrvFail
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
isAutoResponsed = consts.ContactCustomerService_AutoResponsed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue