PriLoopSetController.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using Vo;
  2. using Microsoft.AspNetCore.Mvc;
  3. using Model;
  4. using Services;
  5. using Model.Base;
  6. using Vo.Admin;
  7. using Mapster;
  8. using Infrastructure;
  9. namespace Controllers.Admin
  10. {
  11. /// <summary>
  12. /// PriLoopSet)Controller
  13. /// </summary>
  14. // [Route("${Router}$")]
  15. // [ApiExplorerSettings(GroupName = "PriLoopSet")]
  16. public class PriLoopSetController : BaseController
  17. {
  18. /// <summary>
  19. /// api分组接口
  20. /// </summary>
  21. private readonly IPriLoopSetService _PriLoopSetService;
  22. public PriLoopSetController(IPriLoopSetService PriLoopSetService)
  23. {
  24. _PriLoopSetService = PriLoopSetService;
  25. }
  26. /// <param name="page">分页参数</param>
  27. /// <summary>
  28. /// 列表
  29. /// </summary>
  30. /// <param name="page">分页对象</param>
  31. /// <param name="param">参数请求体</param>
  32. /// <returns>列表</returns>
  33. [HttpGet]
  34. [Route("/v1/pri/PriLoopSet/getPriLoopSetList")]
  35. public IActionResult getPriLoopSetList([FromQuery] PagerInfo page, [FromQuery] PriLoopSet param)
  36. {
  37. var response = _PriLoopSetService.getPriLoopSetList(page, param);
  38. return SUCCESS(response);
  39. }
  40. /// <summary>
  41. /// 详情
  42. /// </summary>
  43. /// <param name="param">参数请求体</param>
  44. /// <returns>详情</returns>
  45. [HttpGet]
  46. [Route("/v1/pri/PriLoopSet/getPriLoopSetQuery")]
  47. public IActionResult getPriLoopSetQuery([FromQuery] PriLoopSet param)
  48. {
  49. var response = _PriLoopSetService.GetFirst(m => m.id == param.id).Adapt<GetPriLoopSetQueryVo>();
  50. return SUCCESS(response);
  51. }
  52. /// <summary>
  53. /// 添加
  54. /// </summary>
  55. /// <param name="param">参数请求体</param>
  56. /// <returns>添加</returns>
  57. [HttpPost]
  58. [Route("/v1/pri/PriLoopSet/addPriLoopSet")]
  59. public IActionResult addPriLoopSet([FromBody] PriLoopSet param)
  60. {
  61. var modal = param.Adapt<PriLoopSet>().ToCreate(HttpContext);
  62. var response = _PriLoopSetService.Add(modal);
  63. return SUCCESS(response);
  64. }
  65. /// <summary>
  66. /// 修改
  67. /// </summary>
  68. /// <param name="param">参数请求体</param>
  69. /// <returns>修改</returns>
  70. [HttpPut]
  71. [Route("/v1/pri/PriLoopSet/updatePriLoopSet")]
  72. public IActionResult updatePriLoopSet([FromBody] PriLoopSet param)
  73. {
  74. var modal = param.Adapt<PriLoopSet>().ToCreate(HttpContext);
  75. var response = _PriLoopSetService.Update(modal);
  76. return SUCCESS(response);
  77. }
  78. /// <summary>
  79. /// 删除
  80. /// </summary>
  81. /// <param name="id">ID</param>
  82. /// <returns>删除</returns>
  83. [HttpDelete]
  84. [Route("/v1/pri/PriLoopSet/deletePriLoopSet/{id}")]
  85. public IActionResult deletePriLoopSet(int id)
  86. {
  87. var response = _PriLoopSetService.Delete(id);
  88. return SUCCESS(response);
  89. }
  90. /// <summary>
  91. /// 下拉框数据
  92. /// </summary>
  93. /// <param name="page">分页对象</param>
  94. /// <returns>下拉框数据</returns>
  95. [HttpGet]
  96. [Route("/v1/pri/PriLoopSet/getPriLoopSetDic")]
  97. public IActionResult getPriLoopSetDic([FromQuery] PagerInfo page)
  98. {
  99. var response = _PriLoopSetService.getPriLoopSetDic(page);
  100. return SUCCESS(response);
  101. }
  102. }
  103. }