修改
continuous-integration/drone/push Build is passing

This commit is contained in:
he
2024-11-21 15:16:54 +08:00
parent 6c434e2ace
commit ece6832bb8
4 changed files with 59 additions and 4 deletions
@@ -223,6 +223,16 @@ namespace IRaCIS.Core.Application.Contracts
}
public class UseEmialGetDoctorInfoOutDto
{
public Guid DoctorId { get; set; }
}
public class UseEmialGetDoctorInfoInDto
{
public string EmailOrPhone { get; set; }
}
public class VerifyEmialGetDoctorInfoInDto
{
public string VerificationCode { get; set; }
@@ -20,6 +20,7 @@ using Newtonsoft.Json;
using System.Text.RegularExpressions;
using static MassTransit.ValidationResultExtensions;
using DocumentFormat.OpenXml.Vml.Spreadsheet;
using IdentityModel.OidcClient;
namespace IRaCIS.Core.Application.Contracts
{
@@ -114,6 +115,45 @@ namespace IRaCIS.Core.Application.Contracts
}
/// <summary>
/// 根据邮箱获取DoctorId 没有的话创建一个
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<UseEmialGetDoctorInfoOutDto> UseEmialGetDoctorInfo(UseEmialGetDoctorInfoInDto inDto)
{
var dockerInfo = await _doctorRepository.Where(t => t.EMail == inDto.EmailOrPhone || t.Phone == inDto.EmailOrPhone).FirstOrDefaultAsync();
if (dockerInfo != null)
{
return new UseEmialGetDoctorInfoOutDto()
{
DoctorId = dockerInfo.Id
};
}
else
{
Doctor doctor = new Doctor()
{
EMail = inDto.EmailOrPhone,
IsVirtual = true,
AcceptingNewTrial = false,
ActivelyReading = false,
CooperateStatus = ContractorStatusEnum.Noncooperation,
ReviewStatus = ReviewerInformationConfirmStatus.ConfirmRefuse
};
var info = await _doctorRepository.AddAsync(doctor, true);
return new UseEmialGetDoctorInfoOutDto()
{
DoctorId = info.Id
};
}
}
/// <summary>
/// 验证邮箱验证码 获取医生信息Id
/// </summary>