Browse Source

AppConfiguration增加IsYiBin等属性

xf 8 months ago
parent
commit
f2a4b924ea
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/Hotline/Configurations/AppConfiguration.cs

+ 6 - 0
src/Hotline/Configurations/AppConfiguration.cs

@@ -13,6 +13,12 @@ namespace Hotline.Configurations
         public ZiGongConfiguration ZiGong { get; set; }
         public LuZhouConfiguration LuZhou { get; set; }
 
+        public bool IsYiBin => CheckScopeIs(AppDefaults.AppScope.YiBin);
+        public bool IsZiGong => CheckScopeIs(AppDefaults.AppScope.ZiGong);
+        public bool IsLuZhou => CheckScopeIs(AppDefaults.AppScope.LuZhou);
+
+        private bool CheckScopeIs(string appscope) => string.CompareOrdinal(AppScope, appscope) == 0;
+
         public DefaultAppScopeConfiguration GetDefaultAppScopeConfiguration()
         {
             return AppScope switch