first commit -push
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using RobotNet.RobotManager.Services.OpenACS;
|
||||
using RobotNet.RobotShares.OpenACS;
|
||||
using RobotNet.Shares;
|
||||
|
||||
namespace RobotNet.RobotManager.Controllers;
|
||||
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
public class TrafficACSRequestController(TrafficACS TrafficACS, Services.RobotManager RobotManager) : ControllerBase
|
||||
{
|
||||
[HttpPost]
|
||||
public async Task<MessageResult<bool>> UpdateTrafficSetting([FromBody] TrafficACSRequestModel model)
|
||||
=> model.Type switch
|
||||
{
|
||||
TrafficRequestType.IN => await TrafficACS.RequestIn(model.RobotId, model.ZoneId),
|
||||
TrafficRequestType.OUT => await TrafficACS.RequestOut(model.RobotId, model.ZoneId),
|
||||
_ => await TrafficACS.RequestOut(model.RobotId, model.ZoneId),
|
||||
};
|
||||
|
||||
[HttpGet]
|
||||
public RobotACSLockedDto[] GetRobotLocked() => RobotManager.GetRobotACSLocked();
|
||||
}
|
||||
Reference in New Issue
Block a user