Skip to content

Commit

Permalink
Merge branch 'dev' of gogs/module-shop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
gogs authored and Gogs committed Nov 19, 2020
2 parents ae25923 + ebdd104 commit 48e574a
Show file tree
Hide file tree
Showing 101 changed files with 804 additions and 1,448 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ModuleShop完全免费并且开源

### 项目结构

![商品](https://gogs.circle.ac.cn/gogs/data/raw/master/images/devenv_2019-07-06_20-48-19.png)
![商品]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/devenv_2019-07-06_20-48-19.png)

## 后台前端

Expand All @@ -36,10 +36,10 @@ ModuleShop完全免费并且开源

### 项目截图

![商品](https://gogs.circle.ac.cn/gogs/data/raw/master/images/chrome_2019-07-06_20-59-32.png)
![商品](https://gogs.circle.ac.cn/gogs/data/raw/master/images/chrome_2019-07-06_20-59-21.png)
![订单](https://gogs.circle.ac.cn/gogs/data/raw/master/images/chrome_2019-07-06_20-59-55.png)
![首页显示配置](https://gogs.circle.ac.cn/gogs/data/raw/master/images/chrome_2019-07-06_21-00-04.png)
![商品]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/chrome_2019-07-06_20-59-32.png)
![商品]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/chrome_2019-07-06_20-59-21.png)
![订单]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/chrome_2019-07-06_20-59-55.png)
![首页显示配置]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/chrome_2019-07-06_21-00-04.png)

### 功能列表

Expand All @@ -57,25 +57,25 @@ ModuleShop完全免费并且开源

在线预览(天网商城):

![小程序码](https://gogs.circle.ac.cn/gogs/data/raw/master/images/shop_mp_8.jpg)
![小程序码]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/shop_mp_8.jpg)

### 项目截图

![首页](https://gogs.circle.ac.cn/gogs/data/raw/master/images/wechatdevtools_2019-07-06_21-05-55.png)
![首页]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/wechatdevtools_2019-07-06_21-05-55.png)

![分类](https://gogs.circle.ac.cn/gogs/data/raw/master/images/wechatdevtools_2019-07-06_21-06-27.png)
![分类]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/wechatdevtools_2019-07-06_21-06-27.png)

![购物车](https://gogs.circle.ac.cn/gogs/data/raw/master/images/wechatdevtools_2019-07-06_21-07-05.png)
![购物车]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/wechatdevtools_2019-07-06_21-07-05.png)

![商品详情](https://gogs.circle.ac.cn/gogs/data/raw/master/images/wechatdevtools_2019-07-07_01-42-31.png)
![商品详情]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/wechatdevtools_2019-07-07_01-42-31.png)

![订单列表](https://gogs.circle.ac.cn/gogs/data/raw/master/images/wechatdevtools_2019-07-07_01-32-17.png)
![订单列表]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/wechatdevtools_2019-07-07_01-32-17.png)

![订单详情](https://gogs.circle.ac.cn/gogs/data/raw/master/images/wechatdevtools_2019-07-06_21-07-35.png)
![订单详情]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/wechatdevtools_2019-07-06_21-07-35.png)

![评价](https://gogs.circle.ac.cn/gogs/data/raw/master/images/wechatdevtools_2019-07-07_01-41-17.png)
![评价]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/wechatdevtools_2019-07-07_01-41-17.png)

![我的](https://gogs.circle.ac.cn/gogs/data/raw/master/images/wechatdevtools_2019-07-07_01-35-29.png)
![我的]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/wechatdevtools_2019-07-07_01-35-29.png)


### 功能列表
Expand Down Expand Up @@ -137,4 +137,4 @@ ModuleShop完全免费并且开源

[ModuleShop交流群](https://jq.qq.com/?_wv=1027&k=5AUnOw5 "ModuleShop交流群(863275860)")(863275860)

![ModuleShop交流群二维码](https://gogs.circle.ac.cn/gogs/data/raw/master/images/863275860_8_8.png)
![ModuleShop交流群二维码]( https://gz-1253581958.cos.ap-guangzhou.myqcloud.com/data/images/863275860_8_8.png)
18 changes: 2 additions & 16 deletions Shop.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.168
# Visual Studio Version 16
VisualStudioVersion = 16.0.30711.63
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0BC982E9-6A28-4C28-8AC9-0B4431064F9D}"
EndProject
Expand Down Expand Up @@ -35,12 +35,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop.Module.ShoppingCart",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop.Module.Core.MiniProgram", "src\Modules\Shop.Module.Core.MiniProgram\Shop.Module.Core.MiniProgram.csproj", "{A2469090-CF84-4B18-91F3-D1D61FA2D1B9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop.Module.RabbitMQ", "src\Modules\Shop.Module.RabbitMQ\Shop.Module.RabbitMQ.csproj", "{1A4CEC3B-7F68-405E-955E-082BFC3BB26E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MQ", "MQ", "{169A12D7-296F-46B0-9EEF-C3A576D05428}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop.Module.MQ", "src\Modules\Shop.Module.MQ\Shop.Module.MQ.csproj", "{A52480D5-2473-439A-9C7D-1CF3865DD37C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop.Module.Reviews", "src\Modules\Shop.Module.Reviews\Shop.Module.Reviews.csproj", "{547196CC-28BC-4893-9920-F34CF5719906}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{69D7DF55-97BF-42E9-A63E-65FB6C6B9E82}"
Expand Down Expand Up @@ -168,14 +164,6 @@ Global
{A2469090-CF84-4B18-91F3-D1D61FA2D1B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2469090-CF84-4B18-91F3-D1D61FA2D1B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2469090-CF84-4B18-91F3-D1D61FA2D1B9}.Release|Any CPU.Build.0 = Release|Any CPU
{1A4CEC3B-7F68-405E-955E-082BFC3BB26E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A4CEC3B-7F68-405E-955E-082BFC3BB26E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A4CEC3B-7F68-405E-955E-082BFC3BB26E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A4CEC3B-7F68-405E-955E-082BFC3BB26E}.Release|Any CPU.Build.0 = Release|Any CPU
{A52480D5-2473-439A-9C7D-1CF3865DD37C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A52480D5-2473-439A-9C7D-1CF3865DD37C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A52480D5-2473-439A-9C7D-1CF3865DD37C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A52480D5-2473-439A-9C7D-1CF3865DD37C}.Release|Any CPU.Build.0 = Release|Any CPU
{547196CC-28BC-4893-9920-F34CF5719906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{547196CC-28BC-4893-9920-F34CF5719906}.Debug|Any CPU.Build.0 = Debug|Any CPU
{547196CC-28BC-4893-9920-F34CF5719906}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -284,9 +272,7 @@ Global
{DCE7B6B6-4617-4063-8E55-AA2B0F7C7BE2} = {C6E59042-550D-4E07-B339-5791E066AB8F}
{C2ACBD35-964A-4E61-8BAD-784414BA36B9} = {39FAE76F-2C55-49B0-95D3-9321AB6CB6D3}
{A2469090-CF84-4B18-91F3-D1D61FA2D1B9} = {9ABB371E-6E15-4FA8-AE40-785F67DD136A}
{1A4CEC3B-7F68-405E-955E-082BFC3BB26E} = {169A12D7-296F-46B0-9EEF-C3A576D05428}
{169A12D7-296F-46B0-9EEF-C3A576D05428} = {39FAE76F-2C55-49B0-95D3-9321AB6CB6D3}
{A52480D5-2473-439A-9C7D-1CF3865DD37C} = {169A12D7-296F-46B0-9EEF-C3A576D05428}
{547196CC-28BC-4893-9920-F34CF5719906} = {39FAE76F-2C55-49B0-95D3-9321AB6CB6D3}
{69D7DF55-97BF-42E9-A63E-65FB6C6B9E82} = {39FAE76F-2C55-49B0-95D3-9321AB6CB6D3}
{AC8FCA58-B8D9-434D-A93E-83F77A8E1555} = {69D7DF55-97BF-42E9-A63E-65FB6C6B9E82}
Expand Down
4 changes: 0 additions & 4 deletions docker-compose.dcproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@
<None Include="docker-compose.yml" />
<None Include=".dockerignore" />
</ItemGroup>
<ItemGroup>
<Folder Include="新文件夹1\" />
<Folder Include="新文件夹\" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/Shop.Module.Catalog/ModuleInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void ConfigureServices(IServiceCollection serviceCollection)
serviceCollection.AddTransient<INotificationHandler<EntityViewed>, EntityViewedHandler>();
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{

}
Expand Down
11 changes: 10 additions & 1 deletion src/Modules/Shop.Module.Catalog/Services/CategoryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,22 @@ public async Task<Result<StandardTableResult<CategoryResult>>> List(StandardTabl
Id = category.Id,
IsPublished = category.IsPublished,
IncludeInMenu = category.IncludeInMenu,
Name = IncludeParentName(all.FirstOrDefault(c => c.Id == category.Id)),
//Name = IncludeParentName(all.FirstOrDefault(c => c.Id == category.Id)),
DisplayOrder = category.DisplayOrder,
ParentId = category.ParentId,
CreatedOn = category.CreatedOn,
UpdatedOn = category.UpdatedOn
});

// TODO .NET CORE 3.1
if (gridData?.List?.Count() > 0)
{
gridData.List.ToList().ForEach(c =>
{
c.Name = IncludeParentName(all.FirstOrDefault(x => x.Id == c.Id));
});
}

return Result.Ok(gridData);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Modules/Shop.Module.Catalog/Services/ProductService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using Shop.Module.Core.Abstractions.Models;
using Shop.Module.Inventory.Abstractions.Entities;
using Shop.Module.MQ.Abstractions.Data;
using Shop.Module.MQ.Abstractions.Models;
using Shop.Module.MQ.Abstractions.Services;
using Shop.Module.Orders.Abstractions.Entities;
using System;
Expand Down Expand Up @@ -152,7 +151,7 @@ public async Task<GoodsGetResult> GetGoodsByCache(int id)

if (user != null)
{
await _mqService.DirectSend(QueueKeys.ProductView, new ProductViewed()
await _mqService.Send(QueueKeys.ProductView, new ProductViewed()
{
UserId = user.Id,
EntityId = result.Id,
Expand Down
14 changes: 4 additions & 10 deletions src/Modules/Shop.Module.Catalog/Shop.Module.Catalog.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Models\**" />
<EmbeddedResource Remove="Models\**" />
<None Remove="Models\**" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Controllers\StockHistoryApiController.cs" />
Expand All @@ -19,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@ public interface IWorkContext
Task<User> GetCurrentUserOrNullAsync();

Task<User> GetCurrentOrThrowAsync();

/// <summary>
/// 验证令牌并自动续签
/// </summary>
/// <param name="userId"></param>
/// <param name="token"></param>
/// <param name="statusCode"></param>
/// <param name="path"></param>
/// <returns></returns>
bool ValidateToken(int userId, string token, out int statusCode, string path = "");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ namespace Shop.Module.Core.Abstractions.Services
{
public interface IAccountService
{
Task<LoginResult> LoginWithSignInCheck(User user);
/// <summary>
/// 验证并获取最后一条验证码
/// </summary>
/// <param name="phone"></param>
/// <param name="captcha"></param>
/// <returns></returns>
Task<SmsSend> ValidateGetLastSms(string phone, string captcha);
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="StackExchange.Redis" Version="2.0.601" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.10" />
<PackageReference Include="StackExchange.Redis" Version="2.2.4" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Shop.Infrastructure\Shop.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Shop.Infrastructure\Shop.Infrastructure.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public class UserQueryResult

public DateTime UpdatedOn { get; set; }

public IList<int> RoleIds { get; set; } = new List<int>();
public IEnumerable<int> RoleIds { get; set; } = new List<int>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Shop.Module.Core.Abstractions.Services;
using Shop.Module.Core.MiniProgram.Models;
using Shop.Module.MQ.Abstractions.Data;
using Shop.Module.MQ.Abstractions.Services;
using Shop.Module.Orders.Abstractions.Events;
Expand All @@ -20,15 +22,18 @@ public class MpPayApiController : ControllerBase
private readonly IWeChatPayNotifyClient _client;
private readonly IMQService _mqService;
private readonly ILogger _logger;
private readonly IAppSettingService _appSettingService;

public MpPayApiController(
IWeChatPayNotifyClient client,
IMQService mqService,
ILogger<MpPayApiController> logger)
ILogger<MpPayApiController> logger,
IAppSettingService appSettingService)
{
_client = client;
_mqService = mqService;
_logger = logger;
_appSettingService = appSettingService;
}

[AllowAnonymous]
Expand All @@ -37,16 +42,25 @@ public async Task<IActionResult> NotifyByOrderNo(string no)
{
try
{
var notify = await _client.ExecuteAsync<WeChatPayUnifiedOrderNotify>(Request);
var config = await _appSettingService.Get<MiniProgramOptions>();
var opt = new WeChatPayOptions()
{
AppId = config.AppId,
MchId = config.MchId,
Secret = config.AppSecret,
Key = config.Key
};

var notify = await _client.ExecuteAsync<WeChatPayUnifiedOrderNotify>(Request, opt);
if (notify.ReturnCode == "SUCCESS")
{
if (notify.ResultCode == "SUCCESS")
{
await _mqService.DirectSend(QueueKeys.PaymentReceived, new PaymentReceived()
await _mqService.Send(QueueKeys.PaymentReceived, new PaymentReceived()
{
Note = "微信支付成功结果通知",
OrderNo = no,
PaymentFeeAmount = int.Parse(notify.TotalFee) / 100M,
PaymentFeeAmount = notify.TotalFee / 100M,
PaymentMethod = PaymentMethod.WeChat,
PaymentOn = DateTime.ParseExact(notify.TimeEnd, "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture)
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void ConfigureServices(IServiceCollection services)
});
services.AddScoped<IPaymentService, PaymentService>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{

}
Expand Down
Loading

0 comments on commit 48e574a

Please sign in to comment.