Merge pull request 'conf-IRONFANS-210' (#760) from conf-IRONFANS-210 into test
Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/760
This commit is contained in:
commit
c60194c221
|
@ -322,6 +322,13 @@ const (
|
|||
VideoManuallyReview_Rejected = 2 //已复审拒绝
|
||||
)
|
||||
|
||||
// 邮件
|
||||
const (
|
||||
Email_Created = 0 // 已创建
|
||||
Email_Success = 1 // 已发送
|
||||
Email_Fail = 2 // 发送失败
|
||||
)
|
||||
|
||||
// 系统通知表的已读状态
|
||||
const (
|
||||
Notification_NotRead = 0 //未读
|
||||
|
|
|
@ -4256,6 +4256,7 @@ func (s *Service) ApiSendRavenIQTestResultAsEmail(ctx *gin.Context, req *emailpr
|
|||
req.Email.From = goproto.String(emailInfoCfg.Address)
|
||||
req.Email.Subject = goproto.String(emailContentCfg.Subject)
|
||||
req.Email.Text = goproto.String(emailContentCfg.Text)
|
||||
req.Email.Status = goproto.Int64(consts.Email_Created)
|
||||
|
||||
err = _DefaultEmail.OpCreate(ctx, &emailproto.OpCreateReq{
|
||||
BaseRequest: req.BaseRequest,
|
||||
|
@ -4275,12 +4276,28 @@ func (s *Service) ApiSendRavenIQTestResultAsEmail(ctx *gin.Context, req *emailpr
|
|||
return
|
||||
}
|
||||
|
||||
err = email.SendRavenIQTestResult(req.Email, emailInfoCfg.Host, emailInfoCfg.Port, emailInfoCfg.Address, emailInfoCfg.Password)
|
||||
if err != nil {
|
||||
logger.Error("SendRavenIQTestResult fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeEmailSrvFail
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
err = email.SendRavenIQTestResult(req.Email, emailInfoCfg.Host, emailInfoCfg.Port, emailInfoCfg.Address, emailInfoCfg.Password)
|
||||
if err != nil {
|
||||
logger.Error("SendRavenIQTestResult fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
// 更新状态为失败
|
||||
_DefaultEmail.OpUpdate(ctx, &emailproto.OpUpdateReq{
|
||||
Email: &dbstruct.Email{
|
||||
Id: req.Id,
|
||||
Status: goproto.Int64(consts.Email_Fail),
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
// 更新状态为成功
|
||||
_DefaultEmail.OpUpdate(ctx, &emailproto.OpUpdateReq{
|
||||
Email: &dbstruct.Email{
|
||||
Id: req.Id,
|
||||
Status: goproto.Int64(consts.Email_Success),
|
||||
},
|
||||
})
|
||||
}()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ type Email struct {
|
|||
Subject *string `json:"subject" bson:"subject"` // 标题
|
||||
Text *string `json:"text" bson:"text"` // 文本
|
||||
MediaComponent *MediaComponent `json:"media_component" bson:"media_component"` // 媒体
|
||||
Status *int64 `json:"status" bson:"status"` // 状态
|
||||
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
|
||||
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
|
||||
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
|
||||
|
|
Loading…
Reference in New Issue