using Admin.NET.Plugin.AiDOP.Infrastructure; using Admin.NET.Plugin.AiDOP.Service.S8; namespace Admin.NET.Plugin.AiDOP.Controllers.S8; [ApiController] [Route("api/aidop/s8/config")] [NonUnify] public class AdoS8DimensionController : ControllerBase { private readonly S8DimensionService _svc; private readonly S8TrustedScopeResolver _scope; public AdoS8DimensionController(S8DimensionService svc, S8TrustedScopeResolver scope) { _svc = svc; _scope = scope; } [HttpGet("dimensions")] public async Task GetDimensionsAsync( [FromQuery] long tenantId = 1, [FromQuery] long factoryId = 1) { // Compatibility-only. Security scope is resolved server-side. _ = tenantId; _ = factoryId; var scope = await _scope.ResolveAsync(); return Ok(await _svc.GetDimensionsAsync(scope.TenantId, scope.FactoryId)); } [HttpGet("dimension-nodes")] public async Task GetDimensionNodesAsync( [FromQuery] long tenantId = 1, [FromQuery] long factoryId = 1, [FromQuery] string? dimensionCode = null) { // Compatibility-only. Security scope is resolved server-side. _ = tenantId; _ = factoryId; var scope = await _scope.ResolveAsync(); return Ok(await _svc.GetDimensionNodesAsync(scope.TenantId, scope.FactoryId, dimensionCode)); } }