Commit eeffd79c authored by 黄奎's avatar 黄奎

新增配置

parent e0ff19cc
...@@ -161,18 +161,28 @@ namespace Mall.Common ...@@ -161,18 +161,28 @@ namespace Mall.Common
/// </summary> /// </summary>
/// <param name="key"></param> /// <param name="key"></param>
/// <returns></returns> /// <returns></returns>
public static string ReadConfigKey(string key) public static string ReadConfigKey(string key,string subKey="")
{ {
string valueStr = "";
try try
{ {
return Configuration.GetSection(key).Value; if (!string.IsNullOrWhiteSpace(subKey))
{
valueStr = Configuration.GetSection(key)[subKey].ToString();
}
else
{
valueStr = Configuration.GetSection(key).Value;
}
} }
catch catch
{ {
return "";
} }
return valueStr;
} }
/// <summary> /// <summary>
/// 阿里云oss域名 /// 阿里云oss域名
/// </summary> /// </summary>
......
...@@ -9,11 +9,10 @@ ...@@ -9,11 +9,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="3.0.0" /> <PackageReference Include="DotNetCore.CAP" Version="2.6.0" />
<PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.0" /> <PackageReference Include="DotNetCore.CAP.MongoDB" Version="2.6.0" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="3.0.0" /> <PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="2.6.0" />
<PackageReference Include="JWT" Version="5.3.1" /> <PackageReference Include="JWT" Version="5.3.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" /> <PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
</ItemGroup> </ItemGroup>
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" /> <ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
</ItemGroup> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions> <ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="https://json-schema.org/draft/2019-09/schema" /></VisualStudio></ProjectExtensions>
</Project> </Project>
...@@ -5,7 +5,6 @@ using System.Linq; ...@@ -5,7 +5,6 @@ using System.Linq;
using System.Text.Encodings.Web; using System.Text.Encodings.Web;
using System.Text.Unicode; using System.Text.Unicode;
using System.Threading.Tasks; using System.Threading.Tasks;
using DotNetCore.CAP.Messages;
using Mall.ThirdCore.Message; using Mall.ThirdCore.Message;
using Mall.WebApi.Filter; using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
...@@ -63,18 +62,14 @@ namespace Mall.WebApi ...@@ -63,18 +62,14 @@ namespace Mall.WebApi
services.AddCap(x => services.AddCap(x =>
{ {
x.UseMySql(config => x.UseMongoDB(Common.Config.ReadConfigKey("Mongo"));
{
config.ConnectionString = "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=cap;CharSet=utf8; Convert Zero Datetime=true;";
});
x.UseRabbitMQ(cfg => x.UseRabbitMQ(cfg =>
{ {
cfg.HostName = "47.96.25.130"; cfg.HostName = Common.Config.ReadConfigKey("RabbitMqConfig", "HostName");
cfg.VirtualHost = "/"; cfg.VirtualHost = Common.Config.ReadConfigKey("RabbitMqConfig", "VirtualHost");
cfg.Port = Convert.ToInt32(5672); cfg.Port = Convert.ToInt32(Common.Config.ReadConfigKey("RabbitMqConfig", "Port"));
cfg.UserName = "guest"; cfg.UserName = Common.Config.ReadConfigKey("RabbitMqConfig", "UserName");
cfg.Password = "viitto2019"; cfg.Password = Common.Config.ReadConfigKey("RabbitMqConfig", "Password");
}); });
//失败后的重试次数,默认50次;在FailedRetryInterval默认60秒的情况下,即默认重试50*60秒(50分钟)之后放弃失败重试 //失败后的重试次数,默认50次;在FailedRetryInterval默认60秒的情况下,即默认重试50*60秒(50分钟)之后放弃失败重试
x.FailedRetryCount = 10; x.FailedRetryCount = 10;
......
{ {
"ConnectionStrings": { "ConnectionStrings": {
"DefaultConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall_4;CharSet=utf8; Convert Zero Datetime=true; ", "DefaultConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall_3;CharSet=utf8; Convert Zero Datetime=true; ",
"DefaultConnectionPName": "MySql.Data.MySqlClient", "DefaultConnectionPName": "MySql.Data.MySqlClient",
"FinanceConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8; Convert Zero Datetime=true; ", "FinanceConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8; Convert Zero Datetime=true; ",
"FinanceConnectionPName": "MySql.Data.MySqlClient", "FinanceConnectionPName": "MySql.Data.MySqlClient",
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
"ViewFileSiteUrl": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com", "ViewFileSiteUrl": "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com",
"ImKey": "b612b31e837c79c68f141aeb719d2b20", "ImKey": "b612b31e837c79c68f141aeb719d2b20",
"ImSecret": "66000451fb72", "ImSecret": "66000451fb72",
//"Mongo": "mongodb://192.168.2.214:27017",
"Mongo": "mongodb://47.96.25.130:27017", "Mongo": "mongodb://47.96.25.130:27017",
"MongoDBName": "Mall", "MongoDBName": "Mall",
"ProjectUrl": "D:/project/GitProject/mallapp", "ProjectUrl": "D:/project/GitProject/mallapp",
...@@ -50,11 +49,13 @@ ...@@ -50,11 +49,13 @@
"PaymentFinanceApi": "http://testapi.oytour.com/api/Mall/InsertFinanceBatchForMallOut", "PaymentFinanceApi": "http://testapi.oytour.com/api/Mall/InsertFinanceBatchForMallOut",
"FinanceKey": "FinanceMallInsertToERPViitto2020", "FinanceKey": "FinanceMallInsertToERPViitto2020",
"SettlementRate": "0.60", "SettlementRate": "0.60",
//"RedisSetting": { "RabbitMqConfig": {
// "RedisServer": "192.168.2.214", "HostName": "47.96.25.130",
// "RedisPort": "6379", "VirtualHost": "/",
// "RedisPwd": "123456" "Port": 5672,
//}, "UserName": "guest",
"Password": "viitto2019"
},
"RedisSetting": { "RedisSetting": {
"RedisServer": "47.96.23.199", "RedisServer": "47.96.23.199",
"RedisPort": "6379", "RedisPort": "6379",
......
...@@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.WindowsService", "Mall ...@@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.WindowsService", "Mall
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Property", "Mall.Module.Property\Mall.Module.Property.csproj", "{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Property", "Mall.Module.Property\Mall.Module.Property.csproj", "{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.AOP", "Mall.AOP\Mall.AOP.csproj", "{231B6093-D5A7-4FEB-A624-7FACE432EA86}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -107,6 +109,10 @@ Global ...@@ -107,6 +109,10 @@ Global
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Debug|Any CPU.Build.0 = Debug|Any CPU {C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.ActiveCfg = Release|Any CPU {C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.Build.0 = Release|Any CPU {C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.Build.0 = Release|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Debug|Any CPU.Build.0 = Debug|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Release|Any CPU.ActiveCfg = Release|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment