AdoS8ConfigDetectionLogsController.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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. q.FactoryId = scope.FactoryId;
  26. var (total, list) = await _svc.GetPagedAsync(q);
  27. return Ok(new { total, page = q.Page, pageSize = q.PageSize, list });
  28. }
  29. }