Browse Source

完成GetProxyDomainList接口

linhong 3 years ago
parent
commit
f4743d35f7

+ 1 - 4
Excutor/GetProxyDomainListExcutor.cs

@@ -14,10 +14,7 @@ namespace LJProxy.Excutor
         {
             GetProxyDomainListResponse rslt = new GetProxyDomainListResponse();
             rslt.ErrMsg = "";
-            //TODO:get domain list from config file?
-            rslt.DomainList = new List<string>() {
-                "192.168.0.94","192.168.0"
-            };
+            rslt.DomainList = GlobalVar.Setting.ProxyDomainList;
             return new JsonResult(rslt);
         }
         

+ 14 - 1
GlobalVar/GlobalVar.cs

@@ -8,6 +8,8 @@ using System.Linq;
 using System.Threading.Tasks;
 using Newtonsoft.Json.Linq;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using LJProxy.Settings;
 
 namespace LJProxy
 {
@@ -19,7 +21,7 @@ namespace LJProxy
             InitExcutorMap();
         }
 
-        public static void InitExcutorMap()
+        private static void InitExcutorMap()
         {
             excutorManager = new ExcutorManager();
 
@@ -40,5 +42,16 @@ namespace LJProxy
             var result = excutorManager.DoExcute( request, requestState);
             return new Tuple<bool, IActionResult>(true, result);
         }
+
+        public static AppSettings Setting { get; private set; }
+
+        public static void InitSetting(IConfiguration configuration)
+        {
+            Setting = new AppSettings();
+            Setting.L1SvrCRPUrl = configuration.GetSection("L1SvrCRPUrl")?.Value;
+            Setting.L1SvrPROUrl = configuration.GetSection("L1SvrPROUrl")?.Value;
+            Setting.ProxyDomainList = configuration.GetSection("ProxyDomainList").GetChildren().Select(c => c.Value).ToList();
+        }
+
     }
 }

+ 1 - 1
LJLib.Net.SPI.Com/LJResponse.cs

@@ -14,7 +14,7 @@ namespace LJLib.Net.SPI.Com
         /// <summary>
         /// 异常详细信息
         /// </summary>
-        public string DebugMsg { get; set; }
+        //public string DebugMsg { get; set; }
 
     }
 }

+ 1 - 1
LJProxy.csproj.user

@@ -4,6 +4,6 @@
     <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
     <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
     <ShowAllFiles>false</ShowAllFiles>
-    <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
+    <NameOfLastUsedPublishProfile>F:\projects\LJProxy\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
   </PropertyGroup>
 </Project>

+ 33 - 0
Models/AppLogin.cs

@@ -0,0 +1,33 @@
+using LJLib.Net.SPI.Com;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace LJProxy.Models
+{
+    public class AppLoginRequest:LJRequest 
+    {
+        /// <summary>
+        /// 用户编号
+        /// </summary>
+        public string userid { get; set; }
+        /// <summary>
+        /// 密码
+        /// </summary>
+        public string password { get; set; }
+    }
+
+    public class AppLoginResponse : LJResponse
+    {
+        /// <summary>
+        /// 用户唯一标识
+        /// </summary>
+        public string token { get; set; }
+        /// <summary>
+        /// 用户名称
+        /// </summary>
+        public string username { get; set; }
+    }
+
+}

+ 46 - 0
Models/GetAppUserInfo.cs

@@ -0,0 +1,46 @@
+using LJLib.Net.SPI.Com;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace LJProxy.Models
+{
+    public class GetAppUserInfoRequest:LJRequest
+    {
+        public string fundid { get; set; }
+        public string oldToken { get; set; }
+    }
+
+    public class GetAppUserInfoResponse : LJResponse
+    {
+        /// <summary>
+        /// 用户功能ID列表
+        /// </summary>
+        public string rsltFunids { get; set; }
+        /// <summary>
+        /// 用户语言
+        /// </summary>
+        public string langcode { get; set; }
+
+        //以下格式未定
+        /// <summary>
+        /// 用户权限列表
+        /// </summary>
+        public string userPower { get; set; }
+        /// <summary>
+        /// 用户时区
+        /// </summary>
+        public string timezone { get; set; }
+        /// <summary>
+        /// 用户所在工组的工序技能
+        /// </summary>
+        public string usercando { get; set; }
+        /// <summary>
+        /// 系统基础标签
+        /// </summary>
+        public string[] basicLabel { get; set; }
+    }
+
+
+}

+ 1 - 0
Settings/AppSettings.cs

@@ -9,5 +9,6 @@ namespace LJProxy.Settings
     {
         public string L1SvrCRPUrl { get; set; }
         public string L1SvrPROUrl { get; set; }
+        public List<string> ProxyDomainList { get; set; }
     }
 }

+ 1 - 0
Startup.cs

@@ -30,6 +30,7 @@ namespace LJProxy
                 //opt.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver();
             });
             services.Configure<AppSettings>(Configuration.GetSection("Appsettings"));
+            GlobalVar.InitSetting(Configuration.GetSection("Appsettings"));
         }
 
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

+ 2 - 1
appsettings.json

@@ -1,7 +1,8 @@
 {
   "Appsettings": {
     "L1SvrCRPUrl": "127.0.0.1:30032",
-    "L1SvrPROUrl": "192.168.0.93:30032"
+    "L1SvrPROUrl": "192.168.0.93:30032",
+    "ProxyDomainList": ["192.168.0.94","l1mes.futuralimited.com"]
   },
   "Logging": {
     "LogLevel": {