using Vo; using Microsoft.AspNetCore.Mvc; using Model; using Services; using Model.Base; using Vo.Admin; using Mapster; using Infrastructure; namespace Controllers.Admin { /// /// PriReturnField)Controller /// // [ApiExplorerSettings(GroupName = "PriReturnField")] public class PriReturnFieldController : BaseController { /// /// api分组接口 /// private readonly IPriReturnFieldService _PriReturnFieldService; public PriReturnFieldController(IPriReturnFieldService PriReturnFieldService) { _PriReturnFieldService = PriReturnFieldService; } /// 分页参数 /// /// 列表 /// /// 分页对象 /// 参数请求体 /// 列表 [HttpGet] [Route("/v1/pri/PriReturnField/getPriReturnFieldList")] public IActionResult getPriReturnFieldList([FromQuery] PagerInfo page, [FromQuery] PriReturnField param) { var response = _PriReturnFieldService.getPriReturnFieldList(page, param); return SUCCESS(response); } /// /// 详情 /// /// 参数请求体 /// 详情 [HttpGet] [Route("/v1/pri/PriReturnField/getPriReturnFieldQuery")] public IActionResult getPriReturnFieldQuery([FromQuery] PriReturnField param) { var response = _PriReturnFieldService.GetFirst(m => m.id == param.id).Adapt(); return SUCCESS(response); } /// /// 添加 /// /// 参数请求体 /// 添加 [HttpPost] [Route("/v1/pri/PriReturnField/addPriReturnField")] public IActionResult addPriReturnField([FromBody] PriReturnField param) { var modal = param.Adapt().ToCreate(HttpContext); var response = _PriReturnFieldService.Add(modal); return SUCCESS(response); } /// /// 修改 /// /// 参数请求体 /// 修改 [HttpPut] [Route("/v1/pri/PriReturnField/updatePriReturnField")] public IActionResult updatePriReturnField([FromBody] PriReturnField param) { var modal = param.Adapt().ToCreate(HttpContext); var response = _PriReturnFieldService.Update(modal); return SUCCESS(response); } /// /// 删除 /// /// ID /// 删除 [HttpDelete] [Route("/v1/pri/PriReturnField/deletePriReturnField/{id}")] public IActionResult deletePriReturnField(int id) { var response = _PriReturnFieldService.Delete(id); return SUCCESS(response); } } }