添加供应商定义模块
This commit is contained in:
@@ -7,8 +7,8 @@ using Yi.Framework.Interface.ERP;
|
||||
namespace Yi.Framework.ApiMicroservice.Controllers.ERP
|
||||
{
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class SupplierController:ControllerBase
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class SupplierController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<SupplierController> _logger;
|
||||
private readonly ISupplierService _supplierService;
|
||||
@@ -19,15 +19,64 @@ namespace Yi.Framework.ApiMicroservice.Controllers.ERP
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查
|
||||
/// 分页查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result<List<SupplierGetListOutput>>> GetList()
|
||||
public async Task<Result> PageList([FromQuery] SupplierCreateUpdateInput input, [FromQuery] PageParModel page)
|
||||
{
|
||||
var result = await _supplierService.GetListAsync();
|
||||
var result = await _supplierService.PageListAsync(input, page);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
return Result<List<SupplierGetListOutput>>.Success().SetData(result);
|
||||
/// <summary>
|
||||
/// 单查
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> GetById(long id)
|
||||
{
|
||||
var result = await _supplierService.GetByIdAsync(id);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<Result> Create(SupplierCreateUpdateInput input)
|
||||
{
|
||||
var result = await _supplierService.CreateAsync(input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[Route("{id}")]
|
||||
public async Task<Result> Update(long id, SupplierCreateUpdateInput input)
|
||||
{
|
||||
var result = await _supplierService.UpdateAsync(id, input);
|
||||
return Result.Success().SetData(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete]
|
||||
public async Task<Result> Del(List<long> ids)
|
||||
{
|
||||
await _supplierService.DeleteAsync(ids);
|
||||
return Result.Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user