@@ -229,6 +229,20 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public string EmailOrPhone { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class UseUserIDGetDoctorIDOutDto
|
||||
{
|
||||
public Guid? DoctorID { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class UseUserIDGetDoctorIDInDto
|
||||
{
|
||||
public Guid UserID { get; set; }
|
||||
}
|
||||
|
||||
public class VerifyEmialGetDoctorInfoOutDto
|
||||
{
|
||||
public Guid? DoctorId { get; set; }
|
||||
|
||||
@@ -18,6 +18,8 @@ using Microsoft.VisualBasic;
|
||||
using MimeKit;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using static MassTransit.ValidationResultExtensions;
|
||||
using DocumentFormat.OpenXml.Vml.Spreadsheet;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
@@ -68,6 +70,50 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过UserId获取Doctorid
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<UseUserIDGetDoctorIDOutDto> UseUserIDGetDoctorID(UseUserIDGetDoctorIDInDto inDto)
|
||||
{
|
||||
|
||||
var userinfo = await _userRepository.Where(x => x.Id == inDto.UserID).FirstOrDefaultAsync();
|
||||
|
||||
if (userinfo != null && userinfo.DoctorId != null)
|
||||
{
|
||||
return new UseUserIDGetDoctorIDOutDto()
|
||||
{
|
||||
|
||||
DoctorID = userinfo.DoctorId
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Doctor doctor = new Doctor()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
var info = await _doctorRepository.AddAsync(doctor, true);
|
||||
|
||||
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.UserID, x => new User()
|
||||
{
|
||||
|
||||
DoctorId = info.Id
|
||||
});
|
||||
|
||||
return new UseUserIDGetDoctorIDOutDto()
|
||||
{
|
||||
|
||||
DoctorID = info.Id
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证邮箱验证码 获取医生信息Id
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user