using LY.App.Model;
using LY.App.Service;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace LY.App.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class PositionController : ControllerBase
{
private readonly PositionService _positionService;
public PositionController(PositionService positionService)
{
_positionService = positionService;
}
///
/// 获取列表
///
///
///
[HttpGet("list")]
public async Task Get(PositionQueryInput input)
{
var positions = _positionService.GetList(input);
return Ok(positions);
}
///
/// 删除
///
///
///
[HttpDelete("delete")]
public async Task Delete(long id)
{
var position = await _positionService.Delete(id);
return Ok(position);
}
///
/// 新增
///
///
///
[HttpPost("add")]
public async Task Add(AddPosition input)
{
var result = await _positionService.MainAdd(input);
return Ok(result);
}
///
/// 更新
///
///
///
[HttpPost("update")]
public async Task update(UpdatePosition input)
{
var result = await _positionService.Update(input);
return Ok(result);
}
}
}