PriLogController.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. using Common;
  10. namespace Controllers.Admin
  11. {
  12. /// <summary>
  13. /// PriLog)Controller
  14. /// </summary>
  15. // [ApiExplorerSettings(GroupName = "PriLog")]
  16. public class PriLogController : BaseController
  17. {
  18. /// <summary>
  19. /// api分组接口
  20. /// </summary>
  21. private readonly IPriLogService _PriLogService;
  22. public PriLogController(IPriLogService PriLogService)
  23. {
  24. _PriLogService = PriLogService;
  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/PriLog/getPriLogList")]
  35. public IActionResult getPriLogList([FromQuery] PagerInfo page, [FromQuery] PriLog param)
  36. {
  37. var response = _PriLogService.getPriLogList(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/PriLog/getPriLogQuery")]
  47. public IActionResult getPriLogQuery([FromQuery] PriLog param)
  48. {
  49. var response = _PriLogService.GetFirst(m => m.id == param.id).Adapt<GetPriLogQueryVo>();
  50. response.stepList = "{" + Function.CheckNull(response.stepList).TrimEnd(',') + "}";
  51. return SUCCESS(response);
  52. }
  53. /// <summary>
  54. /// 添加
  55. /// </summary>
  56. /// <param name="param">参数请求体</param>
  57. /// <returns>添加</returns>
  58. [HttpPost]
  59. [Route("/v1/pri/PriLog/addPriLog")]
  60. public IActionResult addPriLog([FromBody] PriLog param)
  61. {
  62. var modal = param.Adapt<PriLog>().ToCreate(HttpContext);
  63. var response = _PriLogService.Add(modal);
  64. return SUCCESS(response);
  65. }
  66. /// <summary>
  67. /// 修改
  68. /// </summary>
  69. /// <param name="param">参数请求体</param>
  70. /// <returns>修改</returns>
  71. [HttpPut]
  72. [Route("/v1/pri/PriLog/updatePriLog")]
  73. public IActionResult updatePriLog([FromBody] PriLog param)
  74. {
  75. var modal = param.Adapt<PriLog>().ToCreate(HttpContext);
  76. var response = _PriLogService.Update(modal);
  77. return SUCCESS(response);
  78. }
  79. /// <summary>
  80. /// 删除
  81. /// </summary>
  82. /// <param name="id">ID</param>
  83. /// <returns>删除</returns>
  84. [HttpDelete]
  85. [Route("/v1/pri/PriLog/deletePriLog/{id}")]
  86. public IActionResult deletePriLog(int id)
  87. {
  88. var response = _PriLogService.Delete(id);
  89. return SUCCESS(response);
  90. }
  91. }
  92. }