|
|
@ -1,4 +1,8 @@
|
|
|
|
|
|
|
|
using Autofac;
|
|
|
|
using Entity.Constant;
|
|
|
|
using Entity.Constant;
|
|
|
|
|
|
|
|
using HybirdFrameworkCore.Autofac;
|
|
|
|
|
|
|
|
using Service.Station;
|
|
|
|
|
|
|
|
using Service.System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Service.Init;
|
|
|
|
namespace Service.Init;
|
|
|
|
|
|
|
|
|
|
|
@ -13,7 +17,94 @@ public class StaticStationInfo
|
|
|
|
|
|
|
|
|
|
|
|
public static StationConstant.StationModel StationModel;
|
|
|
|
public static StationConstant.StationModel StationModel;
|
|
|
|
|
|
|
|
|
|
|
|
public static string StationName;
|
|
|
|
public static string StationName
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => Resolve(StationParamConst.StationName);
|
|
|
|
|
|
|
|
set => Set(StationParamConst.StationName, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string StationNo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => Resolve(StationParamConst.StationNo);
|
|
|
|
|
|
|
|
set => Set(StationParamConst.StationNo, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region cloud
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string CloudServerIp
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => Resolve(StationParamConst.CloudServerIp);
|
|
|
|
|
|
|
|
set => Set(StationParamConst.CloudServerIp, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static int CloudServerPort
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => int.Parse(Resolve(StationParamConst.CloudServerPort));
|
|
|
|
|
|
|
|
set => Set(StationParamConst.CloudServerPort, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string CloudClientId
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => Resolve(StationParamConst.CloudClientId);
|
|
|
|
|
|
|
|
set => Set(StationParamConst.CloudClientId, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string CloudUsername
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => Resolve(StationParamConst.CloudUsername);
|
|
|
|
|
|
|
|
set => Set(StationParamConst.CloudUsername, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string CloudPassword
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => Resolve(StationParamConst.CloudPassword);
|
|
|
|
|
|
|
|
set => Set(StationParamConst.CloudPassword, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string CloudSubTopic
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => Resolve(StationParamConst.CloudSubTopic);
|
|
|
|
|
|
|
|
set => Set(StationParamConst.CloudSubTopic, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string CloudPubTopic
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
get => Resolve(StationParamConst.CloudPubTopic);
|
|
|
|
|
|
|
|
set => Set(StationParamConst.CloudPubTopic, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region db method
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static SysConfigService _sysConfigService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static string Resolve(string key)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_sysConfigService == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_sysConfigService = AppInfo.Container.Resolve<SysConfigService>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string? s = _sysConfigService.Get(key);
|
|
|
|
|
|
|
|
if (s != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "33000";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void Set(string key, object value)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_sysConfigService == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_sysConfigService = AppInfo.Container.Resolve<SysConfigService>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_sysConfigService.Set(key, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static string StationNo;
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|