123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- using System.Numerics;
- namespace Edge.Core.Domain.FccStationInfo.Input
- {
- public class StationInfoInput
- {
- /// <summary>
- /// id
- /// </summary>
- public long? Id { get; set; }
- /// <summary>
- /// 云端站点 id
- /// </summary>
- public string? BuildId { get; set; }
- /// <summary>
- /// 站点名称
- /// </summary>
- public string? Name { get; set; }
- /// <summary>
- /// 客户端id
- /// </summary>
- public string SecretId { get; set; }
- /// <summary>
- /// 与云端加密的 key
- /// </summary>
- public string AcessKey { get; set; }
- /// <summary>
- /// 经度
- /// </summary>
- public decimal? Longitude { get; set; }
- /// <summary>
- /// 纬度
- /// </summary>
- public decimal? Latitude { get; set; }
- /// <summary>
- /// 小程序链接地址
- /// </summary>
- public string? SmallProgram { get; set; }
- /// <summary>
- /// 云端地址
- /// </summary>
- public string? CloudService { get; set; }
- /// <summary>
- /// 云端 MQTT 地址
- /// </summary>
- public string? MqttService { get; set; }
- /// <summary>
- /// icard 数据库连接地址
- /// </summary>
- public string? IcardService { get; set; }
- /// <summary>
- /// 本地 fcc 与油机 socket 通讯端口
- /// </summary>
- public string? ServicePort { get; set; }
- /// <summary>
- /// 本地 fcc 与 fcc 页面 webSocket 端口
- /// </summary>
- public string? WebSocketPort { get; set; }
- public FccStationInfo? ToComponent()
- {
- if (IsNotNorm()) return null;
- return new FccStationInfo()
- {
- BuildId = this.BuildId,
- Name = this.Name != null ? this.Name : "",
- SecretId = this.SecretId,
- AcessKey = this.AcessKey,
- Longitude = (decimal)(this.Longitude != null ? this.Longitude : new decimal(0)),
- Latitude = (decimal)(this.Latitude != null ? this.Latitude : new decimal(0)),
- SmallProgram = this.SmallProgram,
- CloudService = this.CloudService,
- MqttService = this.MqttService,
- IcardService = this.IcardService != null ? this.IcardService : "",
- ServicePort = this.ServicePort,
- WebSocketPort = this.WebSocketPort
- };
- }
- public bool IsNotNorm()
- {
- return string.IsNullOrEmpty(BuildId) || !Longitude.HasValue || !Latitude.HasValue || string.IsNullOrEmpty(SmallProgram) || string.IsNullOrEmpty(CloudService)
- || string.IsNullOrEmpty(MqttService) || string.IsNullOrEmpty(ServicePort) || string.IsNullOrEmpty(WebSocketPort);
- }
- }
- }
|