修改邮件发送

This commit is contained in:
2022-05-30 09:00:44 +08:00
parent a1e06f6536
commit d3af4696c2
7 changed files with 10 additions and 132 deletions
@@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Contracts
Task<LoginReturnDTO> GetSiteSurveyInfo(Guid trialSiteSurveyId, Guid trialId);
Task<PageOutput<TrialSiteSurveyView>> GetTrialSiteSurveyList(TrialSiteSurveyQueryDTO surveyQueryDTO);
Task<TrialSurveyInitInfo> GetTrialSurveyInitInfo(Guid trialId);
Task<IResponseOutput> SendVerifyCode(SiteSurveySendVerifyCode userInfo, [FromServices] IMailVerificationService _mailVerificationService);
Task<IResponseOutput> SendVerifyCode(SiteSurveySendVerifyCode userInfo);
//Task<IResponseOutput> TrialSurveyLock(Guid trialSiteSurveyId, bool isLock);
//IResponseOutput TrialSurveySubmmit(Guid trialId, Guid trialSiteSurveyId);
Task<IResponseOutput> VerifySendCode(LoginDto userInfo, [FromServices] ITokenService _tokenService);
@@ -30,9 +30,12 @@ namespace IRaCIS.Core.Application.Contracts
private readonly IRepository<TrialUser> _trialUserRepository;
private readonly ITokenService _tokenService;
private readonly IMailVerificationService _mailVerificationService;
public TrialSiteSurveyService(IRepository<TrialSiteSurvey> trialSiteSurveyRepository, IRepository<TrialUser> trialUserRepository, IRepository<TrialSiteUserSurvey> trialSiteUserSurveyRepository,
IRepository<User> userRepository, IRepository<TrialSite> trialSiteRepository, ITokenService tokenService)
IRepository<User> userRepository, IRepository<TrialSite> trialSiteRepository,
ITokenService tokenService,
IMailVerificationService mailVerificationService)
{
_trialSiteSurveyRepository = trialSiteSurveyRepository;
_trialSiteUserSurveyRepository = trialSiteUserSurveyRepository;
@@ -40,6 +43,7 @@ namespace IRaCIS.Core.Application.Contracts
_trialUserRepository = trialUserRepository;
_trialSiteRepository = trialSiteRepository;
_tokenService = tokenService;
_mailVerificationService = mailVerificationService;
}
private object lockObj { get; set; } = new object();
@@ -51,7 +55,7 @@ namespace IRaCIS.Core.Application.Contracts
/// <param name="_mailVerificationService"></param>
/// <returns></returns>
[AllowAnonymous]
public async Task<IResponseOutput> SendVerifyCode(SiteSurveySendVerifyCode userInfo, [FromServices] IMailVerificationService _mailVerificationService)
public async Task<IResponseOutput> SendVerifyCode(SiteSurveySendVerifyCode userInfo)
{
var verificationType = VerifyType.Email;
//检查手机或者邮箱是否有效
@@ -745,7 +749,7 @@ namespace IRaCIS.Core.Application.Contracts
}
public async Task<IResponseOutput> SendSiteSurveyUserJoinEmail(TrialSiteUserSurveyJoinCommand joinCommand, [FromServices] IMailVerificationService _mailVerificationService)
public async Task<IResponseOutput> SendSiteSurveyUserJoinEmail(TrialSiteUserSurveyJoinCommand joinCommand)
{
var trialSiteSurvey = (await _trialSiteSurveyRepository.Where(t => t.Id == joinCommand.TrialSiteSurveyId).FirstOrDefaultAsync()).IfNullThrowException();