Blame view

netcore/src/Modularity/Common/NCC.Common/Configuration/KeyVariable.cs 3 KB
de2bd2f9   “wangming”   项目初始化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
  using NCC.Common.Extension;
  using NCC.Dependency;
  using System.Collections.Generic;
  using System.IO;
  using System.Linq;
  
  namespace NCC.Common.Configuration
  {
      /// <summary>
      /// Key常量
      /// </summary>
      [SuppressSniffer]
      public class KeyVariable
      {
          /// <summary>
          /// 多租户模式
          /// </summary>
          public static bool MultiTenancy
          {
              get
              {
                  var flag = App.Configuration["NCC_App:MultiTenancy"];
                  return flag.ToBool();
              }
          }
  
          /// <summary>
          /// 系统文件路径
          /// </summary>
          public static string SystemPath
          {
              get
              {
                  return string.IsNullOrEmpty(App.Configuration["NCC_App:SystemPath"]) ? Directory.GetCurrentDirectory() : App.Configuration["NCC_App:SystemPath"];
              }
          }
  
          /// <summary>
          /// 命名空间
          /// </summary>
          public static List<string> AreasName
          {
              get
              {
                  return string.IsNullOrEmpty(App.Configuration["NCC_APP:CodeAreasName"]) ? new List<string>() : App.Configuration["NCC_APP:CodeAreasName"].Split(',').ToList();
              }
          }
  
          /// <summary>
          /// 允许上传图片类型
          /// </summary>
          public static List<string> AllowImageType
          {
              get
              {
                  return string.IsNullOrEmpty(App.Configuration["NCC_APP:AllowUploadImageType"]) ? new List<string>() : App.Configuration["NCC_APP:AllowUploadImageType"].Split(',').ToList();
              }
          }
  
          /// <summary>
          /// 允许上传文件类型
          /// </summary>
          public static List<string> AllowUploadFileType
          {
              get
              {
                  return string.IsNullOrEmpty(App.Configuration["NCC_APP:AllowUploadFileType"]) ? new List<string>() : App.Configuration["NCC_APP:AllowUploadFileType"].Split(',').ToList();
              }
          }
  
          /// <summary>
          /// 微信允许上传文件类型
          /// </summary>
          public static List<string> WeChatUploadFileType
          {
              get
              {
                  return string.IsNullOrEmpty(App.Configuration["NCC_APP:WeChatUploadFileType"]) ? new List<string>() : App.Configuration["NCC_APP:WeChatUploadFileType"].Split(',').ToList();
              }
          }
  
          /// <summary>
          /// MinIO
          /// </summary>
          public static string BucketName
          {
              get
              {
                  return string.IsNullOrEmpty(App.Configuration["NCC_APP:BucketName"]) ? "" : App.Configuration["NCC_APP:BucketName"];
              }
          }
  
          /// <summary>
          /// 文件储存类型
          /// </summary>
          public static string FileStoreType
          {
              get
              {
                  return string.IsNullOrEmpty(App.Configuration["NCC_APP:FileStoreType"]) ? "local" : App.Configuration["NCC_APP:FileStoreType"];
              }
          }
      }
  }