using Vo; using Microsoft.AspNetCore.Mvc; using Model; using Services; using Model.Base; using Vo.Admin; using Mapster; using Infrastructure; namespace Controllers.Admin { /// /// PriProject)Controller /// // [ApiExplorerSettings(GroupName = "PriProject")] public class PriProjectController : BaseController { /// /// api分组接口 /// private readonly IPriProjectService _PriProjectService; public PriProjectController(IPriProjectService PriProjectService) { _PriProjectService = PriProjectService; } /// 分页参数 /// /// 列表 /// /// 分页对象 /// 参数请求体 /// 列表 [HttpGet] [Route("/v1/pri/PriProject/getPriProjectList")] public IActionResult getPriProjectList([FromQuery] PagerInfo page, [FromQuery] PriProject param) { var response = _PriProjectService.getPriProjectList(page, param); return SUCCESS(response); } /// /// 详情 /// /// 参数请求体 /// 详情 [HttpGet] [Route("/v1/pri/PriProject/getPriProjectQuery")] public IActionResult getPriProjectQuery([FromQuery] PriProject param) { var response = _PriProjectService.GetFirst(m => m.id == param.id).Adapt(); return SUCCESS(response); } /// /// 添加 /// /// 参数请求体 /// 添加 [HttpPost] [Route("/v1/pri/PriProject/addPriProject")] public IActionResult addPriProject([FromBody] PriProject param) { var modal = param.Adapt().ToCreate(HttpContext); var response = _PriProjectService.Add(modal); return SUCCESS(response); } /// /// 修改 /// /// 参数请求体 /// 修改 [HttpPut] [Route("/v1/pri/PriProject/updatePriProject")] public IActionResult updatePriProject([FromBody] PriProject param) { var modal = param.Adapt().ToCreate(HttpContext); var response = _PriProjectService.Update(modal); return SUCCESS(response); } /// /// 删除 /// /// ID /// 删除 [HttpDelete] [Route("/v1/pri/PriProject/deletePriProject/{id}")] public IActionResult deletePriProject(int id) { var response = _PriProjectService.Delete(id); return SUCCESS(response); } /// 分页参数 /// /// 下拉框数据 /// /// 分页对象 /// 下拉框数据 [HttpGet] [Route("/v1/pri/PriProject/getPriProjectDic")] public IActionResult getPriProjectDic([FromQuery] PagerInfo page) { var response = _PriProjectService.getPriProjectDic(page); return SUCCESS(response); } } }