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
58fa7bb2
Commit
58fa7bb2
authored
Aug 06, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
14a15218
eeffd79c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
255 additions
and
180 deletions
+255
-180
Config.cs
Mall.Common/Config.cs
+13
-3
RB_FreeShipping_Extend.cs
Mall.Model/Extend/BaseSetUp/RB_FreeShipping_Extend.cs
+10
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+140
-65
Mall.ThirdCore.csproj
Mall.ThirdCore/Mall.ThirdCore.csproj
+0
-1
RabbitConfig.cs
Mall.ThirdCore/Mq/RabbitConfig.cs
+0
-44
RabbitMQService.cs
Mall.ThirdCore/Mq/RabbitMQService.cs
+0
-55
TestController.cs
Mall.WebApi/Controllers/CAP/TestController.cs
+52
-0
Mall.WebApi.csproj
Mall.WebApi/Mall.WebApi.csproj
+4
-2
Mall.WebApi.csproj.user
Mall.WebApi/Mall.WebApi.csproj.user
+1
-1
Startup.cs
Mall.WebApi/Startup.cs
+21
-2
appsettings.json
Mall.WebApi/appsettings.json
+8
-7
Mall.sln
Mall.sln
+6
-0
No files found.
Mall.Common/Config.cs
View file @
58fa7bb2
...
@@ -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>
p
rivate
static
string
ReadConfigKey
(
string
key
)
p
ublic
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>
...
...
Mall.Model/Extend/BaseSetUp/RB_FreeShipping_Extend.cs
View file @
58fa7bb2
...
@@ -33,4 +33,14 @@ namespace Mall.Model.Extend.BaseSetUp
...
@@ -33,4 +33,14 @@ namespace Mall.Model.Extend.BaseSetUp
/// </summary>
/// </summary>
public
int
CategoryId
{
get
;
set
;
}
public
int
CategoryId
{
get
;
set
;
}
}
}
/// <summary>
/// 包邮满足的订单商品
/// </summary>
public
class
FreeShippingGoodsDetail
{
public
int
FreeShipping
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
public
int
GoodsId
{
get
;
set
;
}
public
string
SpecificationKey
{
get
;
set
;
}
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
58fa7bb2
This diff is collapsed.
Click to expand it.
Mall.ThirdCore/Mall.ThirdCore.csproj
View file @
58fa7bb2
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
<PackageReference Include="Aliyun.Net.SDK.Core" Version="1.0.3" />
<PackageReference Include="Aliyun.Net.SDK.Core" Version="1.0.3" />
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.10.0" />
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="RabbitMQ.Client" Version="6.0.0" />
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.10" />
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.10" />
</ItemGroup>
</ItemGroup>
...
...
Mall.ThirdCore/Mq/RabbitConfig.cs
deleted
100644 → 0
View file @
14a15218
using
Aliyun.Acs.Core
;
using
Aliyun.Acs.Core.Exceptions
;
using
Aliyun.Acs.Core.Profile
;
using
Aliyun.Acs.Dysmsapi.Model.V20170525
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
Mall.ThirdCore.Commom
;
using
System
;
using
System.Threading
;
using
Mall.ThirdCore.Message
;
namespace
Mall.ThirdCore.Mq
{
/// <summary>
/// 消息队列配置文件
/// </summary>
public
class
RabbitConfig
{
/// <summary>
/// 主机名:ip地址
/// </summary>
public
string
HostName
{
get
;
set
;
}
/// <summary>
/// 端口
/// </summary>
public
int
Port
{
get
;
set
;
}
/// <summary>
/// 用户名
/// </summary>
public
string
UserName
{
get
;
set
;
}
/// <summary>
/// 密码
/// </summary>
public
string
Password
{
get
;
set
;
}
/// <summary>
/// 队列名称
/// </summary>
public
string
QueenName
{
get
;
set
;
}
}
}
Mall.ThirdCore/Mq/RabbitMQService.cs
deleted
100644 → 0
View file @
14a15218
using
RabbitMQ.Client
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.ThirdCore.Mq
{
/// <summary>
/// 消息队列帮助类
/// </summary>
public
class
RabbitMQService
{
/// <summary>
/// 获取连接
/// </summary>
/// <param name="rabbitConfig">连接配置实体</param>
/// <returns></returns>
public
static
ConnectionFactory
GetConnectionFactory
(
RabbitConfig
rabbitConfig
)
{
ConnectionFactory
factory
=
new
ConnectionFactory
{
HostName
=
rabbitConfig
.
HostName
,
//默认端口
Port
=
rabbitConfig
.
Port
,
UserName
=
rabbitConfig
.
UserName
,
Password
=
rabbitConfig
.
Password
};
return
factory
;
}
/// <summary>
/// 发送信息
/// </summary>
/// <param name="rabbitConfig"></param>
/// <param name="message"></param>
public
static
void
SendMessage
(
RabbitConfig
rabbitConfig
,
string
message
)
{
using
(
IConnection
conn
=
GetConnectionFactory
(
rabbitConfig
).
CreateConnection
())
{
using
(
IModel
channel
=
conn
.
CreateModel
())
{
//在MQ上定义一个持久化队列,如果名称相同不会重复创建
channel
.
QueueDeclare
(
rabbitConfig
.
QueenName
,
true
,
false
,
false
,
null
);
byte
[]
buffer
=
Encoding
.
UTF8
.
GetBytes
(
message
);
IBasicProperties
properties
=
channel
.
CreateBasicProperties
();
properties
.
DeliveryMode
=
2
;
channel
.
BasicPublish
(
""
,
rabbitConfig
.
QueenName
,
properties
,
buffer
);
}
}
}
}
}
Mall.WebApi/Controllers/CAP/TestController.cs
0 → 100644
View file @
58fa7bb2
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
namespace
Mall.WebApi.Controllers.CAP
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
TestController
:
BaseController
{
private
readonly
DotNetCore
.
CAP
.
ICapPublisher
_capBus
;
public
TestController
(
DotNetCore
.
CAP
.
ICapPublisher
capPublisher
)
{
this
.
_capBus
=
capPublisher
;
}
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
Get
()
{
ApiResult
apiResult
=
new
ApiResult
()
{
message
=
"操作成功"
,
resultCode
=
1
,
data
=
DateTime
.
Now
};
_capBus
.
Publish
(
"show.time"
,
Common
.
Plugin
.
JsonHelper
.
Serialize
(
apiResult
));
return
apiResult
;
}
[
NonAction
]
[
AllowAnonymous
]
[
DotNetCore
.
CAP
.
CapSubscribe
(
"show.time"
)]
public
void
CheckReceiveMessage
(
string
result
)
{
string
str
=
""
;
Console
.
WriteLine
(
result
);
}
}
}
\ No newline at end of file
Mall.WebApi/Mall.WebApi.csproj
View file @
58fa7bb2
...
@@ -9,8 +9,10 @@
...
@@ -9,8 +9,10 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="2.6.0" />
<PackageReference Include="DotNetCore.CAP.MongoDB" Version="2.6.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>
...
@@ -28,7 +30,7 @@
...
@@ -28,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>
Mall.WebApi/Mall.WebApi.csproj.user
View file @
58fa7bb2
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"Current"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Project
ToolsVersion=
"Current"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<PropertyGroup>
<Controller_SelectedScaffolderID>
Mvc
ControllerEmptyScaffolder
</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderID>
Api
ControllerEmptyScaffolder
</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>
root/Controller
</Controller_SelectedScaffolderCategoryPath>
<Controller_SelectedScaffolderCategoryPath>
root/Controller
</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>
600
</WebStackScaffolding_ControllerDialogWidth>
<WebStackScaffolding_ControllerDialogWidth>
600
</WebStackScaffolding_ControllerDialogWidth>
<WebStackScaffolding_IsLayoutPageSelected>
True
</WebStackScaffolding_IsLayoutPageSelected>
<WebStackScaffolding_IsLayoutPageSelected>
True
</WebStackScaffolding_IsLayoutPageSelected>
...
...
Mall.WebApi/Startup.cs
View file @
58fa7bb2
...
@@ -56,11 +56,30 @@ namespace Mall.WebApi
...
@@ -56,11 +56,30 @@ namespace Mall.WebApi
"http://yx.oytour.com"
,
"http://yx.oytour.com"
,
"http://mall.oytour.com"
,
"http://mall.oytour.com"
,
"http://testmall.oytour.com"
,
"http://testmall.oytour.com"
,
"http://yx.oytour.com"
,
"http://yx.oytour.com"
,
};
};
services
.
AddCors
(
options
=>
options
.
AddPolicy
(
"AllowCors"
,
policy
=>
policy
.
AllowAnyHeader
().
AllowAnyMethod
().
AllowCredentials
().
WithOrigins
(
corsArray
.
ToArray
())));
services
.
AddCors
(
options
=>
options
.
AddPolicy
(
"AllowCors"
,
policy
=>
policy
.
AllowAnyHeader
().
AllowAnyMethod
().
AllowCredentials
().
WithOrigins
(
corsArray
.
ToArray
())));
services
.
AddCap
(
x
=>
{
x
.
UseMongoDB
(
Common
.
Config
.
ReadConfigKey
(
"Mongo"
));
x
.
UseRabbitMQ
(
cfg
=>
{
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
;
//失败后的重拾间隔,默认60秒
x
.
FailedRetryInterval
=
10
;
//设置成功信息的删除时间默认24*3600秒
x
.
SucceedMessageExpiredAfter
=
3600
;
});
}
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public
void
Configure
(
IApplicationBuilder
app
,
IWebHostEnvironment
env
,
IHostApplicationLifetime
appLifetime
)
public
void
Configure
(
IApplicationBuilder
app
,
IWebHostEnvironment
env
,
IHostApplicationLifetime
appLifetime
)
...
@@ -78,12 +97,12 @@ namespace Mall.WebApi
...
@@ -78,12 +97,12 @@ namespace Mall.WebApi
app
.
UseAuthorization
();
app
.
UseAuthorization
();
app
.
UseEndpoints
(
endpoints
=>
app
.
UseEndpoints
(
endpoints
=>
{
{
endpoints
.
MapControllers
();
endpoints
.
MapControllers
();
});
});
System
.
WebHttpContext
.
HttpContext
.
Configure
(
app
.
ApplicationServices
.
GetRequiredService
<
Microsoft
.
AspNetCore
.
Http
.
IHttpContextAccessor
>());
System
.
WebHttpContext
.
HttpContext
.
Configure
(
app
.
ApplicationServices
.
GetRequiredService
<
Microsoft
.
AspNetCore
.
Http
.
IHttpContextAccessor
>());
//启动信息发送
//启动信息发送
Task
.
Run
(()
=>
MessageCore
.
Init
());
Task
.
Run
(()
=>
MessageCore
.
Init
());
...
...
Mall.WebApi/appsettings.json
View file @
58fa7bb2
{
{
"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"
,
...
...
Mall.sln
View file @
58fa7bb2
...
@@ -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
...
...
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