You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.4 KiB
65 lines
1.4 KiB
using Coldairarrow.Business.MDS;
|
|
using Coldairarrow.Entity.MDS;
|
|
using Coldairarrow.Util;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Coldairarrow.Api.Controllers.MDS
|
|
{
|
|
[Route("/MDS/[controller]/[action]")]
|
|
public class userController : BaseApiController
|
|
{
|
|
#region DI
|
|
|
|
public userController(IuserBusiness userBus)
|
|
{
|
|
_userBus = userBus;
|
|
}
|
|
|
|
IuserBusiness _userBus { get; }
|
|
|
|
#endregion
|
|
|
|
#region 获取
|
|
|
|
[HttpPost]
|
|
public async Task<PageResult<user>> GetDataList(PageInput<ConditionDTO> input)
|
|
{
|
|
return await _userBus.GetDataListAsync(input);
|
|
}
|
|
|
|
[HttpPost]
|
|
public async Task<user> GetTheData(IdInputDTO input)
|
|
{
|
|
return await _userBus.GetTheDataAsync(input.id);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 提交
|
|
|
|
[HttpPost]
|
|
public async Task SaveData(user data)
|
|
{
|
|
if (data.Id.IsNullOrEmpty())
|
|
{
|
|
InitEntity(data);
|
|
|
|
await _userBus.AddDataAsync(data);
|
|
}
|
|
else
|
|
{
|
|
await _userBus.UpdateDataAsync(data);
|
|
}
|
|
}
|
|
|
|
[HttpPost]
|
|
public async Task DeleteData(List<string> ids)
|
|
{
|
|
await _userBus.DeleteDataAsync(ids);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|