AdoS8ConfigMonitorDictionaryController.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Admin.NET.Plugin.AiDOP.Dto.S8;
  2. using Admin.NET.Plugin.AiDOP.Infrastructure;
  3. using Admin.NET.Plugin.AiDOP.Service.S8;
  4. namespace Admin.NET.Plugin.AiDOP.Controllers.S8;
  5. [ApiController]
  6. [Route("api/aidop/s8/config/monitor-options")]
  7. [NonUnify]
  8. public class AdoS8ConfigMonitorDictionaryController : ControllerBase
  9. {
  10. private readonly S8MonitorDictionaryService _svc;
  11. private readonly S8TrustedScopeResolver _scope;
  12. public AdoS8ConfigMonitorDictionaryController(S8MonitorDictionaryService svc, S8TrustedScopeResolver scope)
  13. {
  14. _svc = svc;
  15. _scope = scope;
  16. }
  17. /// <summary>
  18. /// 监控对象/指标只读字典。返回结构与前端 BUSINESS_MONITOR_OPTIONS 同形。
  19. /// CONFIG-MONITOR-DICT-READONLY-SEED-1。
  20. /// </summary>
  21. [HttpGet]
  22. public async Task<IActionResult> GetOptionsAsync(
  23. [FromQuery] long tenantId = 1,
  24. [FromQuery] long factoryId = 1)
  25. {
  26. // Compatibility-only. Security scope is resolved server-side.
  27. _ = tenantId; _ = factoryId;
  28. var scope = await _scope.ResolveAsync();
  29. return Ok(await _svc.GetOptionsAsync(scope.TenantId, scope.FactoryId));
  30. }
  31. }