|
|
@ -149,6 +149,8 @@ namespace Shentun.WebPeis.Persons |
|
|
[UnitOfWork(IsDisabled = false)] |
|
|
[UnitOfWork(IsDisabled = false)] |
|
|
public async Task<UserTokenDto> CreateAsync(CreatePersonDto input) |
|
|
public async Task<UserTokenDto> CreateAsync(CreatePersonDto input) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if(input == null) throw new UserFriendlyException("input参数不能为空"); |
|
|
|
|
|
|
|
|
using (var unitOfWork = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) |
|
|
using (var unitOfWork = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) |
|
|
{ |
|
|
{ |
|
|
var entity = ObjectMapper.Map<CreatePersonDto, Person>(input); |
|
|
var entity = ObjectMapper.Map<CreatePersonDto, Person>(input); |
|
|
@ -252,6 +254,8 @@ namespace Shentun.WebPeis.Persons |
|
|
[HttpPost("api/app/Person/Update")] |
|
|
[HttpPost("api/app/Person/Update")] |
|
|
public async Task<PersonDto> UpdateAsync(UpdatePersonDto input) |
|
|
public async Task<PersonDto> UpdateAsync(UpdatePersonDto input) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (input == null) throw new UserFriendlyException("input参数不能为空"); |
|
|
|
|
|
|
|
|
var entity = ObjectMapper.Map<UpdatePersonDto, Person>(input); |
|
|
var entity = ObjectMapper.Map<UpdatePersonDto, Person>(input); |
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(input.MobileTelephone)) |
|
|
if (string.IsNullOrWhiteSpace(input.MobileTelephone)) |
|
|
@ -294,7 +298,7 @@ namespace Shentun.WebPeis.Persons |
|
|
[HttpPost("api/app/Person/CreatePersonKinship")] |
|
|
[HttpPost("api/app/Person/CreatePersonKinship")] |
|
|
public async Task CreatePersonKinshipAsync(CreatePersonKinshipDto input) |
|
|
public async Task CreatePersonKinshipAsync(CreatePersonKinshipDto input) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
if (input == null) throw new UserFriendlyException("input参数不能为空"); |
|
|
var entity = ObjectMapper.Map<CreatePersonKinshipDto, Person>(input); |
|
|
var entity = ObjectMapper.Map<CreatePersonKinshipDto, Person>(input); |
|
|
if (string.IsNullOrWhiteSpace(input.KinshipId)) |
|
|
if (string.IsNullOrWhiteSpace(input.KinshipId)) |
|
|
{ |
|
|
{ |
|
|
|