Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace RobotNet10.FleetManager.Services.OpenACS;
public class TrafficRequestType
{
public static string IN => "in";
public static string OUT => "out";
}
public class TrafficACSRequestBody(string agvId, string trafficZoneId, string inOut)
{
[JsonPropertyName("agvid")]
[Required]
public string AgvId { get; set; } = agvId;
[JsonPropertyName("area")]
[Required]
public string TrafficZoneId { get; set; } = trafficZoneId;
[JsonPropertyName("inout")]
[Required]
public string InOut { get; set; } = inOut;
}
public class TrafficACSRequest
{
[JsonPropertyName("header")]
[Required]
public ACSHeader Header { get; set; } = new("TRAFFIC_REQ", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
[JsonPropertyName("body")]
[Required]
public TrafficACSRequestBody Body { get; set; }
public TrafficACSRequest(string agvId, string trafficZoneId, string inOut)
{
if (string.IsNullOrWhiteSpace(agvId))
throw new ArgumentException("AGV ID không thể rỗng.", nameof(agvId));
if (string.IsNullOrWhiteSpace(trafficZoneId))
throw new ArgumentException("Traffic Zone ID không thể rỗng.", nameof(trafficZoneId));
if (string.IsNullOrWhiteSpace(inOut))
throw new ArgumentException("In OUT không thể rỗng.", nameof(inOut));
Body = new(agvId, trafficZoneId, inOut);
}
}