使用新框架与技术代替旧框架与技术,实现涂装车间后道标签扫码程序
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace RIZO_Application.Infrastructure.Model
|
||||
{
|
||||
public class AppSettings
|
||||
{
|
||||
public string? AppName { get; set; }
|
||||
public string? Version { get; set; }
|
||||
public int MaxRecords { get; set; }
|
||||
public string? ApiEndpoint { get; set; }
|
||||
|
||||
public bool ShowDbLog { get; set; }
|
||||
|
||||
// 静态实例
|
||||
public static AppSettings? Current { get; private set; }
|
||||
|
||||
// 初始化方法
|
||||
public static void Initialize(IConfiguration configuration)
|
||||
{
|
||||
Current = configuration.GetSection("AppSettings").Get<AppSettings>();
|
||||
}
|
||||
}
|
||||
|
||||
public class ConnectionStrings
|
||||
{
|
||||
public string? DefaultConnection { get; set; }
|
||||
|
||||
// 静态实例
|
||||
public static ConnectionStrings? Current { get; private set; }
|
||||
|
||||
// 初始化方法
|
||||
public static void Initialize(IConfiguration configuration)
|
||||
{
|
||||
Current = configuration.GetSection("ConnectionStrings").Get<ConnectionStrings>();
|
||||
}
|
||||
}
|
||||
|
||||
public class DbConfigs
|
||||
{
|
||||
public string? Conn { get; set; }
|
||||
public int DbType { get; set; }
|
||||
public string? ConfigId { get; set; }
|
||||
public bool IsAutoCloseConnection { get; set; }
|
||||
public string? DbName { get; set; }
|
||||
|
||||
// 静态实例
|
||||
public static List<DbConfigs>? Current { get; private set; }
|
||||
|
||||
// 初始化方法
|
||||
public static void Initialize(IConfiguration configuration)
|
||||
{
|
||||
Current = configuration.GetSection("dbConfigs").Get<List<DbConfigs>>();
|
||||
}
|
||||
}
|
||||
// 站点配置
|
||||
public class SiteConfigs
|
||||
{
|
||||
public string? SiteName { get; set; }
|
||||
public bool? IsPrintMain { get; set; }
|
||||
public static SiteConfigs? Current { get; set; }
|
||||
public static void Initialize(IConfiguration configuration)
|
||||
{
|
||||
Current = configuration.GetSection("SiteConfigs").Get<SiteConfigs>();
|
||||
}
|
||||
}
|
||||
// 扫码枪配置
|
||||
public class SerialConfigs
|
||||
{
|
||||
public string? ComName { get; set; }
|
||||
public int? BaudRate { get; set; }
|
||||
public static SerialConfigs? Current { get; set; }
|
||||
public static void Initialize(IConfiguration configuration)
|
||||
{
|
||||
Current = configuration.GetSection("SerialConfigs").Get<SerialConfigs>();
|
||||
}
|
||||
}
|
||||
// mqtt配置
|
||||
public class MqttConfigs
|
||||
{
|
||||
public string? ServerUrl { get; set; }
|
||||
public string? ClientId { get; set; }
|
||||
public string? Topic { get; set; }
|
||||
public string? UserName { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public static MqttConfigs? Current { get; set; }
|
||||
public static void Initialize(IConfiguration configuration)
|
||||
{
|
||||
Current = configuration.GetSection("MqttConfigs").Get<MqttConfigs>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user