PriConditionController.cs 3.1 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. /// PriCondition)Controller
  13. /// </summary>
  14. // [ApiExplorerSettings(GroupName = "PriCondition")]
  15. public class PriConditionController : BaseController
  16. {
  17. /// <summary>
  18. /// api分组接口
  19. /// </summary>
  20. private readonly IPriConditionService _PriConditionService;
  21. public PriConditionController(IPriConditionService PriConditionService)
  22. {
  23. _PriConditionService = PriConditionService;
  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/PriCondition/getPriConditionList")]
  34. public IActionResult getPriConditionList([FromQuery] PagerInfo page, [FromQuery] PriCondition param)
  35. {
  36. var response = _PriConditionService.getPriConditionList(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/PriCondition/getPriConditionQuery")]
  46. public IActionResult getPriConditionQuery([FromQuery] PriCondition param)
  47. {
  48. var response = _PriConditionService.GetFirst(m => m.id == param.id).Adapt<GetPriConditionQueryVo>();
  49. return SUCCESS(response);
  50. }
  51. /// <summary>
  52. /// 添加
  53. /// </summary>
  54. /// <param name="param">参数请求体</param>
  55. /// <returns>添加</returns>
  56. [HttpPost]
  57. [Route("/v1/pri/PriCondition/addPriCondition")]
  58. public IActionResult addPriCondition([FromBody] PriCondition param)
  59. {
  60. var modal = param.Adapt<PriCondition>().ToCreate(HttpContext);
  61. var response = _PriConditionService.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/PriCondition/updatePriCondition")]
  71. public IActionResult updatePriCondition([FromBody] PriCondition param)
  72. {
  73. var modal = param.Adapt<PriCondition>().ToCreate(HttpContext);
  74. var response = _PriConditionService.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/PriCondition/deletePriCondition/{id}")]
  84. public IActionResult deletePriCondition(int id)
  85. {
  86. var response = _PriConditionService.Delete(id);
  87. return SUCCESS(response);
  88. }
  89. }
  90. }