Merge pull request 'by Robin at 20240730; add delay' (#657) from feat-IRONFANS-166-Robin into test
Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/657
This commit is contained in:
commit
3d89cdb07c
|
@ -3,5 +3,6 @@ package apollostruct
|
||||||
type AutoResponseCfg struct {
|
type AutoResponseCfg struct {
|
||||||
StartTime string `json:"start_time"`
|
StartTime string `json:"start_time"`
|
||||||
EndTime string `json:"end_time"`
|
EndTime string `json:"end_time"`
|
||||||
|
Delay int64 `json:"delay"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -2031,6 +2031,8 @@ func (s *Service) ApiCreateContactCustomerService(ctx *gin.Context, req *contact
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if createTimes.CreateTimes == 0 {
|
if createTimes.CreateTimes == 0 {
|
||||||
|
go func() {
|
||||||
|
time.Sleep(time.Duration(cfg.Delay) * time.Second)
|
||||||
err := _DefaultContactCustomerService.OpCreate(ctx, &contact_customer_service_proto.OpCreateReq{
|
err := _DefaultContactCustomerService.OpCreate(ctx, &contact_customer_service_proto.OpCreateReq{
|
||||||
ContactCustomerService: &dbstruct.ContactCustomerService{
|
ContactCustomerService: &dbstruct.ContactCustomerService{
|
||||||
SessionId: req.ContactCustomerService.SessionId,
|
SessionId: req.ContactCustomerService.SessionId,
|
||||||
|
@ -2041,9 +2043,8 @@ func (s *Service) ApiCreateContactCustomerService(ctx *gin.Context, req *contact
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
|
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
|
||||||
ec = errcode.ErrCodeContactCustomerServiceSrvFail
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
isAutoResponsed = consts.ContactCustomerService_AutoResponsed
|
isAutoResponsed = consts.ContactCustomerService_AutoResponsed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue