PriProjectParamController.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. /// PriProjectParam)Controller
  13. /// </summary>
  14. // [ApiExplorerSettings(GroupName = "PriProjectParam")]
  15. public class PriProjectParamController : BaseController
  16. {
  17. /// <summary>
  18. /// api分组接口
  19. /// </summary>
  20. private readonly IPriProjectParamService _PriProjectParamService;
  21. public PriProjectParamController(IPriProjectParamService PriProjectParamService)
  22. {
  23. _PriProjectParamService = PriProjectParamService;
  24. }
  25. /// <param name="page">分页参数</param>
  26. /// <summary>
  27. /// 列表
  28. /// </summary>
  29. /// <param name="page">分页对象</param>
  30. /// <param name="param">参数请求体</param>
  31. /// <returns>列表</returns>
  32. [HttpGet]
  33. [Route("/v1/pri/PriProjectParam/getPriProjectParamList")]
  34. public IActionResult getPriProjectParamList([FromQuery] PagerInfo page, [FromQuery] PriProjectParam param)
  35. {
  36. var response = _PriProjectParamService.getPriProjectParamList(page, param);
  37. return SUCCESS(response);
  38. }
  39. /// <summary>
  40. /// 详情
  41. /// </summary>
  42. /// <param name="param">参数请求体</param>
  43. /// <returns>详情</returns>
  44. [HttpGet]
  45. [Route("/v1/pri/PriProjectParam/getPriProjectParamQuery")]
  46. public IActionResult getPriProjectParamQuery([FromQuery] PriProjectParam param)
  47. {
  48. var response = _PriProjectParamService.GetFirst(m => m.id == param.id).Adapt<GetPriProjectParamQueryVo>();
  49. return SUCCESS(response);
  50. }
  51. /// <summary>
  52. /// 添加
  53. /// </summary>
  54. /// <param name="param">参数请求体</param>
  55. /// <returns>添加</returns>
  56. [HttpPost]
  57. [Route("/v1/pri/PriProjectParam/addPriProjectParam")]
  58. public IActionResult addPriProjectParam([FromBody] PriProjectParam param)
  59. {
  60. var modal = param.Adapt<PriProjectParam>().ToCreate(HttpContext);
  61. var response = _PriProjectParamService.Add(modal);
  62. return SUCCESS(response);
  63. }
  64. /// <summary>
  65. /// 修改
  66. /// </summary>
  67. /// <param name="param">参数请求体</param>
  68. /// <returns>修改</returns>
  69. [HttpPut]
  70. [Route("/v1/pri/PriProjectParam/updatePriProjectParam")]
  71. public IActionResult updatePriProjectParam([FromBody] PriProjectParam param)
  72. {
  73. var modal = param.Adapt<PriProjectParam>().ToCreate(HttpContext);
  74. var response = _PriProjectParamService.Update(modal);
  75. return SUCCESS(response);
  76. }
  77. /// <summary>
  78. /// 删除
  79. /// </summary>
  80. /// <param name="id">ID</param>
  81. /// <returns>删除</returns>
  82. [HttpDelete]
  83. [Route("/v1/pri/PriProjectParam/deletePriProjectParam/{id}")]
  84. public IActionResult deletePriProjectParam(int id)
  85. {
  86. var response = _PriProjectParamService.Delete(id);
  87. return SUCCESS(response);
  88. }
  89. }
  90. }