| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using Admin.NET.Plugin.AiDOP.Dto.S8;
- using Admin.NET.Plugin.AiDOP.Infrastructure.S8;
- using Admin.NET.Plugin.AiDOP.Service.S8;
- namespace Admin.NET.Plugin.AiDOP.Controllers.S8;
- /// <summary>
- /// S8 配置页:操作员(员工)↔ 系统账号绑定 / 可绑账号查询。
- /// 入口收口在 /aidop/s8/config/roles,与 S8 配置中心同源。
- /// </summary>
- [ApiController]
- [Route("api/aidop/s8/config")]
- [NonUnify]
- public class AdoS8ConfigBindingsController : ControllerBase
- {
- private readonly S8OperatorBindingService _svc;
- public AdoS8ConfigBindingsController(S8OperatorBindingService svc) => _svc = svc;
- [HttpGet("operator-bindings")]
- public async Task<IActionResult> ListAsync(
- [FromQuery] long? factoryRefId = null,
- [FromQuery] string? bindStatus = null,
- [FromQuery] string? keyword = null)
- => Ok(await _svc.ListAsync(factoryRefId, bindStatus, keyword));
- [HttpPost("operator-bindings")]
- public async Task<IActionResult> BindAsync([FromBody] AdoS8OperatorBindingCreateDto body)
- {
- try { return Ok(await _svc.BindAsync(body)); }
- catch (S8BizException ex) { return BadRequest(new { message = ex.Message }); }
- }
- [HttpDelete("operator-bindings/{employeeId:long}")]
- public async Task<IActionResult> UnbindAsync(long employeeId)
- {
- try { await _svc.UnbindAsync(employeeId); return Ok(new { employeeId }); }
- catch (S8BizException ex) { return BadRequest(new { message = ex.Message }); }
- }
- [HttpGet("sys-users")]
- public async Task<IActionResult> SysUsersAsync(
- [FromQuery] string? keyword = null,
- [FromQuery] long? excludeEmployeeId = null)
- => Ok(await _svc.ListSysUsersAsync(keyword, excludeEmployeeId));
- }
|