AdoS8ConfigDetectionLogsController.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. using Admin.NET.Plugin.AiDOP.Infrastructure.S8;
  2. using Admin.NET.Plugin.AiDOP.Const.S8;
  3. using Admin.NET.Plugin.AiDOP.Dto.S8;
  4. using Admin.NET.Plugin.AiDOP.Infrastructure;
  5. using Admin.NET.Plugin.AiDOP.Service.S8;
  6. namespace Admin.NET.Plugin.AiDOP.Controllers.S8;
  7. [ApiController]
  8. [Route("api/aidop/s8/config/detection-logs")]
  9. [NonUnify]
  10. public class AdoS8ConfigDetectionLogsController : ControllerBase
  11. {
  12. private readonly S8DetectionLogQueryService _svc;
  13. private readonly S8TrustedScopeResolver _scope;
  14. public AdoS8ConfigDetectionLogsController(S8DetectionLogQueryService svc, S8TrustedScopeResolver scope)
  15. {
  16. _svc = svc;
  17. _scope = scope;
  18. }
  19. [HttpGet]
  20. [S8Permission(S8PermissionCatalog.ConfigRead)]
  21. public async Task<IActionResult> GetPagedAsync([FromQuery] AdoS8DetectionLogQueryDto q)
  22. {
  23. var scope = await _scope.ResolveAsync();
  24. q.TenantId = scope.TenantId;
  25. var (total, list) = await _svc.GetPagedAsync(q);
  26. return Ok(new { total, page = q.Page, pageSize = q.PageSize, list });
  27. }
  28. }