Browse Source

配置推送地址

lcl 1 month ago
parent
commit
8da3b9e196
4 changed files with 16 additions and 14 deletions
  1. 1 0
      Config/Base.cs
  2. 7 7
      Util/Queue/PosPushHelper.cs
  3. 7 7
      Util/Queue/PosRePushHelper.cs
  4. 1 0
      appsettings.Development.json

+ 1 - 0
Config/Base.cs

@@ -12,6 +12,7 @@ namespace AppConfig
         public static string JavaStatSqlConnStr = ConfigurationManager.AppSettings["JavaStatSqlConnStr"].ToString();
         public static string Host = Library.ConfigurationManager.AppSettings["Host"].ToString();
         public static string SourceHost = Library.ConfigurationManager.AppSettings["SourceHost"].ToString();
+        public static string JavaPushHost = Library.ConfigurationManager.AppSettings["JavaPushHost"].ToString();
         public static string Database = Library.ConfigurationManager.AppSettings["Database"].ToString();
         public static string defaultImage = Library.ConfigurationManager.AppSettings["Host"].ToString() + "/skin/app/default/static/images/default.jpg";
         #region 数据库结构

+ 7 - 7
Util/Queue/PosPushHelper.cs

@@ -88,13 +88,13 @@ namespace MySystem
             JsonData jsonObj = JsonMapper.ToObject(content);
             string dataType = jsonObj["data_type"].ToString();
             string dataContent = jsonObj["data_content"].ToJson();
-            if(dataType == "bind") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/binding";
-            if(dataType == "un_bind") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/unbind";
-            if(dataType == "trade") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/trade";
-            if(dataType == "deposit") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/cash";
-            if(dataType == "active") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/extActData";
-            if(dataType == "qr_bind") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/saveHaoDaQrCodeMchInfo";
-            if(dataType == "lkb_trade") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/lkbTrade";
+            if(dataType == "bind") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/binding";
+            if(dataType == "un_bind") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/unbind";
+            if(dataType == "trade") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/trade";
+            if(dataType == "deposit") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/cash";
+            if(dataType == "active") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/extActData";
+            if(dataType == "qr_bind") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/saveHaoDaQrCodeMchInfo";
+            if(dataType == "lkb_trade") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/lkbTrade";
             function.WriteLog("url:" + url, "统一推送日志");
             string encryptContent = AesEncrypt(dataContent);
             encryptContent = Convert.ToBase64String(Encoding.UTF8.GetBytes(encryptContent));

+ 7 - 7
Util/Queue/PosRePushHelper.cs

@@ -52,13 +52,13 @@ namespace MySystem
             foreach(PushPosRecord sub in list)
             {
                 string dataType = sub.DataType;
-                if(dataType == "bind") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/binding";
-                if(dataType == "un_bind") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/unbind";
-                if(dataType == "trade") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/trade";
-                if(dataType == "deposit") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/cash";
-                if(dataType == "active") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/extActData";
-                if(dataType == "qr_bind") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/saveHaoDaQrCodeMchInfo";
-                if(dataType == "lkb_trade") url = "https://apigateway.kexiaoshuang.com/v1/kxs/statServer/sp/lkbTrade";
+                if(dataType == "bind") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/binding";
+                if(dataType == "un_bind") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/unbind";
+                if(dataType == "trade") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/trade";
+                if(dataType == "deposit") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/cash";
+                if(dataType == "active") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/extActData";
+                if(dataType == "qr_bind") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/saveHaoDaQrCodeMchInfo";
+                if(dataType == "lkb_trade") url = AppConfig.Base.JavaPushHost + "v1/kxs/statServer/sp/lkbTrade";
                 string res = PostWebRequest(url, sub.EncryptContent, new Dictionary<string, string>());
                 if(res.Contains("\"status\""))
                 {

+ 1 - 0
appsettings.Development.json

@@ -11,6 +11,7 @@
     "Host": "",
     "OssHost": "",
     "SourceHost": "",
+    "JavaPushHost": "http://gateway.kexiaoshuang.com/",
     "Database": "KxsPushServer",
     "SqlConnStr": "server=47.108.62.166;port=3306;user=KxsPushServer;password=0j3sEGdlvOsgGbat;database=KxsPushServer;charset=utf8;",
     "SourceSqlConnStr": "server=47.108.62.166;port=3306;user=root;password=HDlNs1ZpG5iR9D9I;database=KxsMainServer;charset=utf8;",