|
|
|
@ -55,7 +55,7 @@ namespace Myshipping.Core.Service
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/DjyUserMailAccount/add")]
|
|
|
|
|
public async Task Add(AddDjyUserMailAccountInput input)
|
|
|
|
|
public async Task<long> Add(AddDjyUserMailAccountInput input)
|
|
|
|
|
{
|
|
|
|
|
var cc = _rep.AsQueryable().Filter(null, true).Count(x => x.MailAccount == input.MailAccount);
|
|
|
|
|
if (cc > 0)
|
|
|
|
@ -65,6 +65,7 @@ namespace Myshipping.Core.Service
|
|
|
|
|
|
|
|
|
|
var entity = input.Adapt<DjyUserMailAccount>();
|
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
|
return entity.Id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -73,7 +74,7 @@ namespace Myshipping.Core.Service
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("/DjyUserMailAccount/edit")]
|
|
|
|
|
public async Task Update(UpdateDjyUserMailAccountInput input)
|
|
|
|
|
public async Task<long> Update(UpdateDjyUserMailAccountInput input)
|
|
|
|
|
{
|
|
|
|
|
var cc = _rep.AsQueryable().Filter(null, true).Count(x => x.MailAccount == input.MailAccount && x.Id != input.Id);
|
|
|
|
|
if (cc > 0)
|
|
|
|
@ -83,6 +84,7 @@ namespace Myshipping.Core.Service
|
|
|
|
|
|
|
|
|
|
var entity = input.Adapt<DjyUserMailAccount>();
|
|
|
|
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
return entity.Id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|