提交代码
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using HardwareControl.Core.SystemSetting;
|
||||
|
||||
namespace HardwareWeb.Models
|
||||
{
|
||||
/// <summary>系统参数配置的 Web 传输对象。</summary>
|
||||
public sealed record SystemConfigPayload(
|
||||
int ConfigId,
|
||||
string ConfigClass,
|
||||
string ConfigName,
|
||||
string ConfigValue,
|
||||
string ConfigDescript)
|
||||
{
|
||||
public static SystemConfigPayload From(SystemConfig config) =>
|
||||
new(
|
||||
config.ConfigId,
|
||||
config.ConfigClass ?? string.Empty,
|
||||
config.ConfigName ?? string.Empty,
|
||||
config.ConfigValue ?? string.Empty,
|
||||
config.ConfigDescript ?? string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>新增 / 更新系统参数的请求体。</summary>
|
||||
public sealed record SystemConfigUpsertRequest(
|
||||
string? ConfigClass,
|
||||
string? ConfigName,
|
||||
string? ConfigValue,
|
||||
string? ConfigDescript)
|
||||
{
|
||||
public SystemConfig ToEntity(int configId = 0) =>
|
||||
new()
|
||||
{
|
||||
ConfigId = configId,
|
||||
ConfigClass = ConfigClass ?? string.Empty,
|
||||
ConfigName = ConfigName ?? string.Empty,
|
||||
ConfigValue = ConfigValue ?? string.Empty,
|
||||
ConfigDescript = ConfigDescript ?? string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>管理员密码校验请求。</summary>
|
||||
public sealed record AdminAuthRequest(string? Password);
|
||||
|
||||
/// <summary>管理员密码校验通过后签发的令牌。</summary>
|
||||
public sealed record AdminAuthPayload(string Token, DateTimeOffset ExpiresAt);
|
||||
}
|
||||
Reference in New Issue
Block a user