PriPrizeInTableController.cs 3.7 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. /// PriPrizeInTable)Controller
  13. /// </summary>
  14. // [ApiExplorerSettings(GroupName = "PriPrizeInTable")]
  15. public class PriPrizeInTableController : BaseController
  16. {
  17. /// <summary>
  18. /// api分组接口
  19. /// </summary>
  20. private readonly IPriPrizeInTableService _PriPrizeInTableService;
  21. public PriPrizeInTableController(IPriPrizeInTableService PriPrizeInTableService)
  22. {
  23. _PriPrizeInTableService = PriPrizeInTableService;
  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/PriPrizeInTable/getPriPrizeInTableList")]
  34. public IActionResult getPriPrizeInTableList([FromQuery] PagerInfo page, [FromQuery] PriPrizeInTable param)
  35. {
  36. var response = _PriPrizeInTableService.getPriPrizeInTableList(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/PriPrizeInTable/getPriPrizeInTableQuery")]
  46. public IActionResult getPriPrizeInTableQuery([FromQuery] PriPrizeInTable param)
  47. {
  48. var response = _PriPrizeInTableService.GetFirst(m => m.id == param.id).Adapt<GetPriPrizeInTableQueryVo>();
  49. return SUCCESS(response);
  50. }
  51. /// <summary>
  52. /// 添加
  53. /// </summary>
  54. /// <param name="param">参数请求体</param>
  55. /// <returns>添加</returns>
  56. [HttpPost]
  57. [Route("/v1/pri/PriPrizeInTable/addPriPrizeInTable")]
  58. public IActionResult addPriPrizeInTable([FromBody] PriPrizeInTable param)
  59. {
  60. var modal = param.Adapt<PriPrizeInTable>().ToCreate(HttpContext);
  61. var response = _PriPrizeInTableService.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/PriPrizeInTable/updatePriPrizeInTable")]
  71. public IActionResult updatePriPrizeInTable([FromBody] PriPrizeInTable param)
  72. {
  73. var modal = param.Adapt<PriPrizeInTable>().ToCreate(HttpContext);
  74. var response = _PriPrizeInTableService.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/PriPrizeInTable/deletePriPrizeInTable/{id}")]
  84. public IActionResult deletePriPrizeInTable(int id)
  85. {
  86. var response = _PriPrizeInTableService.Delete(id);
  87. return SUCCESS(response);
  88. }
  89. /// <param name="page">分页参数</param>
  90. /// <summary>
  91. /// 下拉框数据
  92. /// </summary>
  93. /// <param name="page">分页对象</param>
  94. /// <returns>下拉框数据</returns>
  95. [HttpGet]
  96. [Route("/v1/pri/PriPrizeInTable/getPriPrizeInTableDic")]
  97. public IActionResult getPriPrizeInTableDic([FromQuery] PagerInfo page)
  98. {
  99. var response = _PriPrizeInTableService.getPriPrizeInTableDic(page);
  100. return SUCCESS(response);
  101. }
  102. }
  103. }