fix chore
This commit is contained in:
220
Atomx.Common/Constants/CacheKeys.cs
Normal file
220
Atomx.Common/Constants/CacheKeys.cs
Normal file
@@ -0,0 +1,220 @@
|
||||
namespace Atomx.Common.Constants
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 系统缓存 key
|
||||
/// </summary>
|
||||
public class CacheKeys {
|
||||
/// <summary>
|
||||
/// 管理系统菜单缓存 key
|
||||
/// </summary>
|
||||
public const string AdminMenu = "Config.AdminMenu";
|
||||
|
||||
/// <summary>
|
||||
/// 角色权限缓存KEY
|
||||
/// </summary>
|
||||
public const string Roles = "Config.Roles";
|
||||
|
||||
/// <summary>
|
||||
/// 权限缓存KEY
|
||||
/// </summary>
|
||||
public const string Permissions = "Config.Permissions";
|
||||
|
||||
/// <summary>
|
||||
/// 常规设置缓存
|
||||
/// </summary>
|
||||
public const string GeneralConfig = "Config.General";
|
||||
|
||||
/// <summary>
|
||||
/// 邮件服务设置
|
||||
/// </summary>
|
||||
public const string EmailConfig = "Config.EmailServer";
|
||||
|
||||
/// <summary>
|
||||
/// 忘记交易密码邮件内容模板
|
||||
/// </summary>
|
||||
public const string ForgetTransactionPasswordEmailTemplateConfig = "Config.ForgetTransactionPasswordEmailTemplate";
|
||||
|
||||
/// <summary>
|
||||
/// 忘记密码邮件内容模板
|
||||
/// </summary>
|
||||
public const string ForgetPasswordEmailTemplateConfig = "Config.ForgetPasswordEmailTemplate";
|
||||
|
||||
/// <summary>
|
||||
/// 注册激活邮件
|
||||
/// </summary>
|
||||
public const string RegisterActiveEmailTemplateConfig = "Config.RegisterActiveEmailTemplate";
|
||||
|
||||
/// <summary>
|
||||
/// 制造商缓存信息
|
||||
/// </summary>
|
||||
public const string Manufacturers = "Manufacturers";
|
||||
|
||||
/// <summary>
|
||||
/// 产品分类缓存信息
|
||||
/// </summary>
|
||||
public const string ProductCategories = "Product.Categories";
|
||||
|
||||
/// <summary>
|
||||
/// 产品分类缓存信息
|
||||
/// </summary>
|
||||
public const string ProductNewList = "Product.NewList";
|
||||
|
||||
/// <summary>
|
||||
/// 产品分类缓存信息
|
||||
/// </summary>
|
||||
public const string ProductNewListPrefix = "Product.NewList.";
|
||||
|
||||
/// <summary>
|
||||
/// 产品分类缓存信息
|
||||
/// </summary>
|
||||
public const string ProductHotList = "Product.HotList";
|
||||
|
||||
/// <summary>
|
||||
/// 产品精选
|
||||
/// </summary>
|
||||
public const string ProductFeaturedList = "Product.FeaturedList";
|
||||
|
||||
/// <summary>
|
||||
/// 产品分类缓存信息
|
||||
/// </summary>
|
||||
public const string ProductHotListPrefix = "Product.HotList.";
|
||||
|
||||
/// <summary>
|
||||
/// 产品分类缓存信息
|
||||
/// </summary>
|
||||
public const string MarketingProduct = "Marketing.Product";
|
||||
|
||||
/// <summary>
|
||||
/// 内容分类缓存信息
|
||||
/// </summary>
|
||||
public const string ContentCategories = "Content.Categories";
|
||||
|
||||
public const string Area = "Area";
|
||||
|
||||
/// <summary>
|
||||
/// 国家数据缓存
|
||||
/// </summary>
|
||||
public const string Country = "Area.Country";
|
||||
|
||||
/// <summary>
|
||||
/// 省州数据缓存
|
||||
/// </summary>
|
||||
public const string Province = "Area.Province";
|
||||
|
||||
/// <summary>
|
||||
/// 城市数据缓存
|
||||
/// </summary>
|
||||
public const string City = "Area.City";
|
||||
|
||||
/// <summary>
|
||||
/// 地区数据
|
||||
/// </summary>
|
||||
public const string Regions = "Regions";
|
||||
|
||||
/// <summary>
|
||||
/// 地区树数据
|
||||
/// </summary>
|
||||
public const string RegionTree = "RegionTree";
|
||||
|
||||
/// <summary>
|
||||
/// 语言数据
|
||||
/// </summary>
|
||||
public const string Languages = "Languages";
|
||||
|
||||
/// <summary>
|
||||
/// 语言数据
|
||||
/// </summary>
|
||||
public const string LocalizedPropertyPrefix = "LocalizedProperty.";
|
||||
|
||||
/// <summary>
|
||||
/// 店铺套餐包
|
||||
/// </summary>
|
||||
public const string StorePackage = "StorePackage";
|
||||
|
||||
/// <summary>
|
||||
/// 店铺数据集
|
||||
/// </summary>
|
||||
public const string Stores = "Stores";
|
||||
|
||||
/// <summary>
|
||||
/// 店铺数据集
|
||||
/// </summary>
|
||||
public const string StorePrefix = "Store.";
|
||||
|
||||
/// <summary>
|
||||
/// 支付通道
|
||||
/// </summary>
|
||||
public const string PaymentChannels = "Payment.Channels";
|
||||
|
||||
/// <summary>
|
||||
/// 货币信息
|
||||
/// </summary>
|
||||
public const string Currencies = "Currencies";
|
||||
|
||||
/// <summary>
|
||||
/// 货币信息
|
||||
/// </summary>
|
||||
public const string CurrencyChannel = "CurrencyChannel";
|
||||
|
||||
/// <summary>
|
||||
/// 产品属性
|
||||
/// </summary>
|
||||
public const string ProductAttributes = "Product.Attributes";
|
||||
|
||||
/// <summary>
|
||||
/// 产品属性预设值
|
||||
/// </summary>
|
||||
public const string ProductAttributeOptionsPrefix = "Product.AttributeOption.";
|
||||
|
||||
// <summary>
|
||||
/// 行为日志类型
|
||||
/// </summary>
|
||||
public const string ActionLogType = "ActionLogType";
|
||||
|
||||
// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
public const string ContentPrefix = "Content.";
|
||||
|
||||
/// <summary>
|
||||
/// 产品
|
||||
/// </summary>
|
||||
public const string ProductPrefix = "Product.";
|
||||
|
||||
/// <summary>
|
||||
/// 产品
|
||||
/// </summary>
|
||||
public const string DailyBestSellProductPrefix = "Product.DailyBestSell.";
|
||||
|
||||
/// <summary>
|
||||
/// 客服
|
||||
/// </summary>
|
||||
public const string CustomerServicePrefix = "CustomerService.";
|
||||
|
||||
/// <summary>
|
||||
/// 用户信息
|
||||
/// </summary>
|
||||
public const string UserPrefix = "User.";
|
||||
|
||||
/// <summary>
|
||||
/// 代理信息
|
||||
/// </summary>
|
||||
public const string AgencyPrefix = "Agency.";
|
||||
|
||||
/// <summary>
|
||||
/// 店铺等级
|
||||
/// </summary>
|
||||
public const string StoreLevel = "StoreLevel";
|
||||
|
||||
/// <summary>
|
||||
/// 用户本地化
|
||||
/// </summary>
|
||||
public const string LocalizationPrefix = "Localization.";
|
||||
|
||||
/// <summary>
|
||||
/// 本地化文本资源缓存
|
||||
/// </summary>
|
||||
public const string LocaleResourcePrefix = "LocaleResource.";
|
||||
}
|
||||
}
|
||||
13
Atomx.Common/Constants/ClaimKeys.cs
Normal file
13
Atomx.Common/Constants/ClaimKeys.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Atomx.Common.Constants
|
||||
{
|
||||
public static class ClaimKeys
|
||||
{
|
||||
public const string Id = "id";
|
||||
public const string CorporationId = "cid";
|
||||
public const string Name = "name";
|
||||
public const string Email = "email";
|
||||
public const string Mobile = "mobile";
|
||||
public const string Role = "r";
|
||||
public const string Permission = "p";
|
||||
}
|
||||
}
|
||||
67
Atomx.Common/Constants/Permissions.cs
Normal file
67
Atomx.Common/Constants/Permissions.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
namespace Atomx.Common.Constants
|
||||
{
|
||||
public static class Permissions
|
||||
{
|
||||
public static class Role
|
||||
{
|
||||
public const string View = "Role.View";
|
||||
public const string Create = "Role.Create";
|
||||
public const string Edit = "Role.Edit";
|
||||
public const string Delete = "Role.Delete";
|
||||
public const string Export = "Role.Export";
|
||||
}
|
||||
|
||||
public static class User
|
||||
{
|
||||
public const string View = "User.View";
|
||||
public const string Create = "User.Create";
|
||||
public const string Edit = "User.Edit";
|
||||
public const string Delete = "User.Delete";
|
||||
public const string Export = "User.Export";
|
||||
}
|
||||
|
||||
public static class Admin
|
||||
{
|
||||
public const string View = "Admin.View";
|
||||
public const string Create = "Admin.Create";
|
||||
public const string Edit = "Admin.Edit";
|
||||
public const string Delete = "Admin.Delete";
|
||||
public const string Export = "Admin.Export";
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, string> PermissionDescriptions = new()
|
||||
{
|
||||
{ "User", "用户管理" },
|
||||
{ "User.View", "查看用户列表和详情" },
|
||||
{ "User.Create", "创建新用户" },
|
||||
{ "User.Edit", "编辑用户信息" },
|
||||
{ "User.Delete", "删除用户" },
|
||||
{ "User.Export", "导出用户数据" },
|
||||
|
||||
{ "Role", "角色管理" },
|
||||
{ "Role.View", "查看角色列表和详情" },
|
||||
{ "Role.Create", "创建新角色" },
|
||||
{ "Role.Edit", "编辑角色信息" },
|
||||
{ "Role.Delete", "删除角色" },
|
||||
{ "Role.Export", "导出角色数据" },
|
||||
|
||||
{ "System", "系统管理" },
|
||||
{ "Content", "内容管理" },
|
||||
{ "Reports", "报表管理" }
|
||||
};
|
||||
|
||||
public static List<string> GetAllPermissions()
|
||||
{
|
||||
return typeof(Permissions)
|
||||
.GetNestedTypes().SelectMany(t => t.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.FlattenHierarchy))
|
||||
.Where(fi => fi.IsLiteral && !fi.IsInitOnly && fi.FieldType == typeof(string))
|
||||
.Select(fi => (string)fi.GetValue(null)!)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static string GetPermissionDescription(string permission)
|
||||
{
|
||||
return PermissionDescriptions.ContainsKey(permission) ? PermissionDescriptions[permission] : permission;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Atomx.Common/Constants/StorageKeys.cs
Normal file
13
Atomx.Common/Constants/StorageKeys.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Atomx.Common.Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// 本地/浏览器存储键名,客户端与服务端共享常量以保证一致性
|
||||
/// - 在 WASM 中用于 Blazored.LocalStorage
|
||||
/// - Key 名称与现有 AuthHeaderHandler 保持一致: "accessToken", "refreshToken"
|
||||
/// </summary>
|
||||
public static class StorageKeys
|
||||
{
|
||||
public const string AccessToken = "accessToken";
|
||||
public const string RefreshToken = "refreshToken";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user