admin/src/Oms.Domain/Shared/EnumDisplayNames.cs
zzh 793085607a refactor: 字节枚举整型落库并统一发布快照 Status
发布记录 Status 改为 EsSnapshotStatus(TINYINT),计费启用判断改用 EnableStatus;db.sql 与 migrate_enum_int_comments.sql 补全枚举字段注释及旧库迁移。
2026-07-22 10:22:54 +08:00

60 lines
1.7 KiB
C#

using Oms.Domain.CustomersAggregate.Enums;
using Oms.Domain.RechargeAggregate.Enums;
using Oms.Domain.Shared.Enums;
namespace Oms.Domain.Shared;
/// <summary>
/// 字节枚举展示名(与 t_dict 中文名称对齐,供 API 出参等使用)。
/// </summary>
public static class EnumDisplayNames
{
public static string Of(EsSnapshotStatus status) => status switch
{
EsSnapshotStatus.Active => "生效",
EsSnapshotStatus.Inactive => "失效",
_ => string.Empty
};
public static string Of(EnableStatus status) => status switch
{
EnableStatus.Disabled => "禁用",
EnableStatus.Enabled => "启用",
_ => string.Empty
};
public static string Of(CustomerStatus status) => status switch
{
CustomerStatus.Disabled => "禁用",
CustomerStatus.Normal => "正常",
CustomerStatus.Frozen => "冻结",
_ => string.Empty
};
public static string Of(CustomerGroup? group) => group switch
{
CustomerGroup.Normal => "普通客户",
CustomerGroup.Vip1 => "VIP1",
CustomerGroup.Vip2 => "VIP2",
CustomerGroup.Vip3 => "VIP3",
CustomerGroup.Vip4 => "VIP4",
CustomerGroup.Vip5 => "VIP5",
_ => string.Empty
};
public static string Of(RechargeStatus status) => status switch
{
RechargeStatus.Pending => "待审核",
RechargeStatus.Approved => "审核通过",
RechargeStatus.Rejected => "审核驳回",
_ => string.Empty
};
public static string Of(PayType payType) => payType switch
{
PayType.Wechat => "微信",
PayType.Alipay => "支付宝",
_ => string.Empty
};
}