| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using Admin.NET.Plugin.AiDOP.Entity.S8;
- using Admin.NET.Plugin.AiDOP.Service.S8;
- namespace Admin.NET.Plugin.AiDOP.Controllers.S8;
- [ApiController]
- [Route("api/aidop/s8/config/notification-layers")]
- [NonUnify]
- public class AdoS8ConfigNotificationLayersController : ControllerBase
- {
- private readonly S8NotificationLayerService _svc;
- public AdoS8ConfigNotificationLayersController(S8NotificationLayerService svc) => _svc = svc;
- [HttpGet]
- public async Task<IActionResult> ListAsync([FromQuery] long tenantId = 1, [FromQuery] long factoryId = 1) =>
- Ok(await _svc.ListAsync(tenantId, factoryId));
- [HttpPost]
- public async Task<IActionResult> CreateAsync([FromBody] AdoS8NotificationLayer body)
- {
- try { return Ok(await _svc.CreateAsync(body)); }
- catch (S8BizException ex) { return BadRequest(new { message = ex.Message }); }
- }
- [HttpPut("{id:long}")]
- public async Task<IActionResult> UpdateAsync(long id, [FromBody] AdoS8NotificationLayer body)
- {
- try { return Ok(await _svc.UpdateAsync(id, body)); }
- catch (S8BizException ex) { return BadRequest(new { message = ex.Message }); }
- }
- [HttpDelete("{id:long}")]
- public async Task<IActionResult> DeleteAsync(long id)
- {
- await _svc.DeleteAsync(id);
- return Ok();
- }
- }
|