IwbCacheNames.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using Abp.Localization;
  4. using IwbZero;
  5. using IwbZero.Authorization.Base.Roles;
  6. using IwbZero.Authorization.Base.Users;
  7. namespace WeApp.Configuration
  8. {
  9. public class IwbCacheNames
  10. {
  11. public const string FunctionCache = "FunctionCache";
  12. public const string NavFunctionCache = "NavFunctionCache";
  13. public const string PackageInfoCache = "PackageInfoCache";
  14. public const string GroupInfoCache = "GroupInfoCache";
  15. public const string GroupRunningInfoCache = "GroupRunningInfoCache";
  16. public const string CampInfoCache = "CampInfoCache";
  17. public const string CampPortraitInfoCache = "CampPortraitInfoCache";
  18. public const string SceneInfoCache = "SceneInfoCache";
  19. public static readonly List<string> RefreshList = new List<string>()
  20. {
  21. PackageInfoCache,
  22. CampInfoCache,
  23. GroupInfoCache,
  24. GroupRunningInfoCache,
  25. SceneInfoCache,
  26. CampPortraitInfoCache,
  27. NavFunctionCache,
  28. FunctionCache,
  29. UserPermissionCacheItem.CacheStoreName,
  30. RolePermissionCacheItem.CacheStoreName,
  31. };
  32. public static List<SelectListItem> GetCacheList()
  33. {
  34. var sList = new List<SelectListItem> { new SelectListItem() { Value = "", Text = L("CacheAll") } };
  35. foreach (var l in RefreshList)
  36. {
  37. sList.Add(new SelectListItem() { Value = l, Text = L(l) });
  38. }
  39. return sList;
  40. }
  41. private static string L(string name)
  42. {
  43. var str = LocalizationHelper.GetSource(IwbZeroConsts.LocalizationSourceName).GetString(name);
  44. return str;
  45. }
  46. //public static List<CacheItem> Caches => new List<CacheItem>()
  47. //{
  48. // new CacheItem(FunctionCache),
  49. //};
  50. }
  51. //public class CacheItem
  52. //{
  53. // public CacheItem()
  54. // {
  55. // }
  56. // public CacheItem(string name, string displayName)
  57. // {
  58. // Name = name;
  59. // DisplayName = displayName;
  60. // }
  61. // public CacheItem(string name)
  62. // {
  63. // Name = name;
  64. // DisplayName = name;
  65. // }
  66. // public string Name { get; set; }
  67. // public string DisplayName { get; set; }
  68. //}
  69. }