Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
eeffd79c
Commit
eeffd79c
authored
Aug 06, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增配置
parent
e0ff19cc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
26 deletions
+37
-26
Config.cs
Mall.Common/Config.cs
+13
-3
Mall.WebApi.csproj
Mall.WebApi/Mall.WebApi.csproj
+4
-5
Startup.cs
Mall.WebApi/Startup.cs
+6
-11
appsettings.json
Mall.WebApi/appsettings.json
+8
-7
Mall.sln
Mall.sln
+6
-0
No files found.
Mall.Common/Config.cs
View file @
eeffd79c
...
...
@@ -161,18 +161,28 @@ namespace Mall.Common
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public
static
string
ReadConfigKey
(
string
key
)
public
static
string
ReadConfigKey
(
string
key
,
string
subKey
=
""
)
{
string
valueStr
=
""
;
try
{
return
Configuration
.
GetSection
(
key
).
Value
;
if
(!
string
.
IsNullOrWhiteSpace
(
subKey
))
{
valueStr
=
Configuration
.
GetSection
(
key
)[
subKey
].
ToString
();
}
else
{
valueStr
=
Configuration
.
GetSection
(
key
).
Value
;
}
}
catch
{
return
""
;
}
return
valueStr
;
}
/// <summary>
/// 阿里云oss域名
/// </summary>
...
...
Mall.WebApi/Mall.WebApi.csproj
View file @
eeffd79c
...
...
@@ -9,11 +9,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="
3.0
.0" />
<PackageReference Include="DotNetCore.CAP.M
ySql" Version="3.0
.0" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="
3.0
.0" />
<PackageReference Include="DotNetCore.CAP" Version="
2.6
.0" />
<PackageReference Include="DotNetCore.CAP.M
ongoDB" Version="2.6
.0" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="
2.6
.0" />
<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" />
</ItemGroup>
...
...
@@ -31,7 +30,7 @@
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
</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>
Mall.WebApi/Startup.cs
View file @
eeffd79c
...
...
@@ -5,7 +5,6 @@ using System.Linq;
using
System.Text.Encodings.Web
;
using
System.Text.Unicode
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Messages
;
using
Mall.ThirdCore.Message
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Builder
;
...
...
@@ -63,18 +62,14 @@ namespace Mall.WebApi
services
.
AddCap
(
x
=>
{
x
.
UseMySql
(
config
=>
{
config
.
ConnectionString
=
"server=192.168.2.214;user id=reborn;password=Reborn@2018;database=cap;CharSet=utf8; Convert Zero Datetime=true;"
;
});
x
.
UseMongoDB
(
Common
.
Config
.
ReadConfigKey
(
"Mongo"
));
x
.
UseRabbitMQ
(
cfg
=>
{
cfg
.
HostName
=
"47.96.25.130"
;
cfg
.
VirtualHost
=
"/"
;
cfg
.
Port
=
Convert
.
ToInt32
(
5672
);
cfg
.
UserName
=
"guest"
;
cfg
.
Password
=
"viitto2019"
;
cfg
.
HostName
=
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"HostName"
)
;
cfg
.
VirtualHost
=
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"VirtualHost"
)
;
cfg
.
Port
=
Convert
.
ToInt32
(
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"Port"
)
);
cfg
.
UserName
=
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"UserName"
)
;
cfg
.
Password
=
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"Password"
)
;
});
//失败后的重试次数,默认50次;在FailedRetryInterval默认60秒的情况下,即默认重试50*60秒(50分钟)之后放弃失败重试
x
.
FailedRetryCount
=
10
;
...
...
Mall.WebApi/appsettings.json
View file @
eeffd79c
{
"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"
,
"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"
,
...
...
@@ -25,7 +25,6 @@
"ViewFileSiteUrl"
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com"
,
"ImKey"
:
"b612b31e837c79c68f141aeb719d2b20"
,
"ImSecret"
:
"66000451fb72"
,
//
"Mongo"
:
"mongodb://192.168.2.214:27017"
,
"Mongo"
:
"mongodb://47.96.25.130:27017"
,
"MongoDBName"
:
"Mall"
,
"ProjectUrl"
:
"D:/project/GitProject/mallapp"
,
...
...
@@ -50,11 +49,13 @@
"PaymentFinanceApi"
:
"http://testapi.oytour.com/api/Mall/InsertFinanceBatchForMallOut"
,
"FinanceKey"
:
"FinanceMallInsertToERPViitto2020"
,
"SettlementRate"
:
"0.60"
,
//
"RedisSetting"
:
{
//
"RedisServer"
:
"192.168.2.214"
,
//
"RedisPort"
:
"6379"
,
//
"RedisPwd"
:
"123456"
//
},
"RabbitMqConfig"
:
{
"HostName"
:
"47.96.25.130"
,
"VirtualHost"
:
"/"
,
"Port"
:
5672
,
"UserName"
:
"guest"
,
"Password"
:
"viitto2019"
},
"RedisSetting"
:
{
"RedisServer"
:
"47.96.23.199"
,
"RedisPort"
:
"6379"
,
...
...
Mall.sln
View file @
eeffd79c
...
...
@@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.WindowsService", "Mall
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Property", "Mall.Module.Property\Mall.Module.Property.csproj", "{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.AOP", "Mall.AOP\Mall.AOP.csproj", "{231B6093-D5A7-4FEB-A624-7FACE432EA86}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
...
...
@@ -107,6 +109,10 @@ Global
{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.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
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment