PriPrizeInSetController.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. /// PriPrizeInSet)Controller
  13. /// </summary>
  14. // [Route("${Router}$")]
  15. // [ApiExplorerSettings(GroupName = "PriPrizeInSet")]
  16. public class PriPrizeInSetController : BaseController
  17. {
  18. /// <summary>
  19. /// api分组接口
  20. /// </summary>
  21. private readonly IPriPrizeInSetService _PriPrizeInSetService;
  22. public PriPrizeInSetController(IPriPrizeInSetService PriPrizeInSetService)
  23. {
  24. _PriPrizeInSetService = PriPrizeInSetService;
  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/PriPrizeInSet/getPriPrizeInSetList")]
  35. public IActionResult getPriPrizeInSetList([FromQuery] PagerInfo page, [FromQuery] PriPrizeInSet param)
  36. {
  37. var response = _PriPrizeInSetService.getPriPrizeInSetList(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/PriPrizeInSet/getPriPrizeInSetQuery")]
  47. public IActionResult getPriPrizeInSetQuery([FromQuery] PriPrizeInSet param)
  48. {
  49. var response = _PriPrizeInSetService.GetFirst(m => m.id == param.id).Adapt<GetPriPrizeInSetQueryVo>();
  50. return SUCCESS(response);
  51. }
  52. /// <summary>
  53. /// 添加
  54. /// </summary>
  55. /// <param name="param">参数请求体</param>
  56. /// <returns>添加</returns>
  57. [HttpPost]
  58. [Route("/v1/pri/PriPrizeInSet/addPriPrizeInSet")]
  59. public IActionResult addPriPrizeInSet([FromBody] PriPrizeInSet param)
  60. {
  61. var modal = param.Adapt<PriPrizeInSet>().ToCreate(HttpContext);
  62. var response = _PriPrizeInSetService.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/PriPrizeInSet/updatePriPrizeInSet")]
  72. public IActionResult updatePriPrizeInSet([FromBody] PriPrizeInSet param)
  73. {
  74. var modal = param.Adapt<PriPrizeInSet>().ToCreate(HttpContext);
  75. var response = _PriPrizeInSetService.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/PriPrizeInSet/deletePriPrizeInSet/{id}")]
  85. public IActionResult deletePriPrizeInSet(int id)
  86. {
  87. var response = _PriPrizeInSetService.Delete(id);
  88. return SUCCESS(response);
  89. }
  90. }
  91. }