AppReportRecordController.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. /// AppReportRecord)Controller
  13. /// </summary>
  14. // [Route("${Router}$")]
  15. // [ApiExplorerSettings(GroupName = "AppReportRecord")]
  16. public class AppReportRecordController : BaseController
  17. {
  18. /// <summary>
  19. /// api分组接口
  20. /// </summary>
  21. private readonly IAppReportRecordService _AppReportRecordService;
  22. public AppReportRecordController(IAppReportRecordService AppReportRecordService)
  23. {
  24. _AppReportRecordService = AppReportRecordService;
  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/api/AppReportRecord/getAppReportRecordList")]
  35. public IActionResult getAppReportRecordList([FromQuery] PagerInfo page, [FromQuery] AppReportRecord param)
  36. {
  37. var response = _AppReportRecordService.getAppReportRecordList(page, param);
  38. return SUCCESS(response);
  39. }
  40. [HttpGet]
  41. [Route("/noauth/tt")]
  42. public IActionResult tt([FromQuery] PagerInfo page, [FromQuery] AppReportRecord param)
  43. {
  44. var response = _AppReportRecordService.getAppReportRecordList(page, param);
  45. return SUCCESS(response);
  46. }
  47. /// <summary>
  48. /// 详情
  49. /// </summary>
  50. /// <param name="param">参数请求体</param>
  51. /// <returns>详情</returns>
  52. [HttpGet]
  53. [Route("/v1/api/AppReportRecord/getAppReportRecordQuery")]
  54. public IActionResult getAppReportRecordQuery([FromQuery] AppReportRecord param)
  55. {
  56. var response = _AppReportRecordService.GetFirst(m => m.id == param.id).Adapt<GetAppReportRecordQueryVo>();
  57. return SUCCESS(response);
  58. }
  59. /// <summary>
  60. /// 添加
  61. /// </summary>
  62. /// <param name="param">参数请求体</param>
  63. /// <returns>添加</returns>
  64. [HttpPost]
  65. [Route("/v1/api/AppReportRecord/addAppReportRecord")]
  66. public IActionResult addAppReportRecord([FromBody] AppReportRecord param)
  67. {
  68. param.createTime = DateTime.Now;
  69. var modal = param.Adapt<AppReportRecord>().ToCreate(HttpContext);
  70. var response = _AppReportRecordService.Insertable(modal).SplitTable().ExecuteReturnSnowflakeId();
  71. return SUCCESS(response);
  72. }
  73. [HttpGet]
  74. [Route("/noauth/aa")]
  75. public IActionResult aa(DateTime t)
  76. {
  77. var modal = new AppReportRecord()
  78. {
  79. createTime = t,
  80. appVersion = "1",
  81. userTag = "1",
  82. pageTitle = "1",
  83. pageUrl = "1",
  84. userSysInfo = "1",
  85. deviceSize = "1",
  86. reportType = "1",
  87. reportData = "1",
  88. };
  89. var response = _AppReportRecordService.Insertable(modal).SplitTable().ExecuteReturnSnowflakeId();
  90. return SUCCESS(response);
  91. }
  92. /// <summary>
  93. /// 修改
  94. /// </summary>
  95. /// <param name="param">参数请求体</param>
  96. /// <returns>修改</returns>
  97. [HttpPut]
  98. [Route("/v1/api/AppReportRecord/updateAppReportRecord")]
  99. public IActionResult updateAppReportRecord([FromBody] AppReportRecord param)
  100. {
  101. var modal = param.Adapt<AppReportRecord>().ToCreate(HttpContext);
  102. var response = _AppReportRecordService.Update(modal, true);
  103. return SUCCESS(response);
  104. }
  105. /// <summary>
  106. /// 删除
  107. /// </summary>
  108. /// <param name="id">ID</param>
  109. /// <returns>删除</returns>
  110. [HttpDelete]
  111. [Route("/v1/api/AppReportRecord/deleteAppReportRecord/{id}")]
  112. public IActionResult deleteAppReportRecord(int id)
  113. {
  114. var response = _AppReportRecordService.Delete(id);
  115. return SUCCESS(response);
  116. }
  117. }
  118. }