Browse Source

Close #34: Create Payment entity and Refund entity in Payments module

pull/49/head
gdlcf88 6 years ago
parent
commit
4a157bd76e
  1. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj
  2. 10
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs
  3. 10
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs
  4. 9
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreateUpdatePaymentDto.cs
  5. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/GetPaymentListDto.cs
  6. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/IPaymentAppService.cs
  7. 10
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateUpdateRefundDto.cs
  8. 12
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/GetRefundListDto.cs
  9. 6
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs
  10. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj
  11. 75
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs
  12. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs
  13. 83
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs
  14. 11
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs
  15. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj
  16. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj
  17. 46
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs
  18. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundRepository.cs
  19. 38
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs
  20. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj
  21. 29
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEfCoreEntityExtensionMappings.cs
  22. 5
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs
  23. 18
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs
  24. 16
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs
  25. 9
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs
  26. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj
  27. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj
  28. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj
  29. 3
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj
  30. 23
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml
  31. 30
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml.cs
  32. 23
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml
  33. 30
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml.cs
  34. 30
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs
  35. 1
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsWebAutoMapperProfile.cs
  36. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj
  37. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj
  38. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj
  39. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj
  40. 2
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EShopSampleMigrationsDbContext.cs
  41. 3129
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200602074752_AddedPaymentAndRefundEntities.Designer.cs
  42. 32
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200602074752_AddedPaymentAndRefundEntities.cs
  43. 6
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs
  44. 2
      samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj
  45. 2
      samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj
  46. 2
      samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj
  47. 2
      samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj
  48. 42
      samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Application.Contracts" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.Application.Contracts" Version="0.1.8" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Authorization" Version="2.8.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />

10
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissionDefinitionProvider.cs

@ -11,14 +11,12 @@ namespace EasyAbp.EShop.Payments.Authorization
var moduleGroup = context.AddGroup(PaymentsPermissions.GroupName, L("Permission:Payments"));
var paymentPermission = moduleGroup.AddPermission(PaymentsPermissions.Payments.Default, L("Permission:Payments"));
paymentPermission.AddChild(PaymentsPermissions.Payments.Create, L("Permission:Create"));
paymentPermission.AddChild(PaymentsPermissions.Payments.Update, L("Permission:Update"));
paymentPermission.AddChild(PaymentsPermissions.Payments.Delete, L("Permission:Delete"));
paymentPermission.AddChild(PaymentsPermissions.Payments.Manage, L("Permission:Manage"));
paymentPermission.AddChild(PaymentsPermissions.Payments.CrossStore, L("Permission:CrossStore"));
var refundPermission = moduleGroup.AddPermission(PaymentsPermissions.Refunds.Default, L("Permission:Refunds"));
refundPermission.AddChild(PaymentsPermissions.Refunds.Create, L("Permission:Create"));
refundPermission.AddChild(PaymentsPermissions.Refunds.Update, L("Permission:Update"));
refundPermission.AddChild(PaymentsPermissions.Refunds.Delete, L("Permission:Delete"));
refundPermission.AddChild(PaymentsPermissions.Refunds.Manage, L("Permission:Manage"));
refundPermission.AddChild(PaymentsPermissions.Refunds.CrossStore, L("Permission:CrossStore"));
}
private static LocalizableString L(string name)

10
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Authorization/PaymentsPermissions.cs

@ -14,18 +14,16 @@ namespace EasyAbp.EShop.Payments.Authorization
public class Payments
{
public const string Default = GroupName + ".Payments";
public const string Update = Default + ".Update";
public const string Create = Default + ".Create";
public const string Delete = Default + ".Delete";
public const string Manage = Default + ".Manage";
public const string CrossStore = Default + ".CrossStore";
}
public class Refunds
{
public const string Default = GroupName + ".Refunds";
public const string Update = Default + ".Update";
public const string Create = Default + ".Create";
public const string Delete = Default + ".Delete";
public const string Manage = Default + ".Manage";
public const string CrossStore = Default + ".CrossStore";
}
}

9
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/CreateUpdatePaymentDto.cs

@ -1,9 +0,0 @@
using System;
using System.ComponentModel;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class CreateUpdatePaymentDto
{
public Guid? StoreId { get; set; }
}
}

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/Dtos/GetPaymentListDto.cs

@ -0,0 +1,12 @@
using System;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Payments.Dtos
{
public class GetPaymentListDto : PagedAndSortedResultRequestDto
{
public Guid? StoreId { get; set; }
public Guid? UserId { get; set; }
}
}

6
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/IPaymentAppService.cs

@ -9,9 +9,9 @@ namespace EasyAbp.EShop.Payments.Payments
ICrudAppService<
PaymentDto,
Guid,
PagedAndSortedResultRequestDto,
CreateUpdatePaymentDto,
CreateUpdatePaymentDto>
GetPaymentListDto,
object,
object>
{
}

10
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/CreateUpdateRefundDto.cs

@ -1,10 +0,0 @@
using System;
using System.ComponentModel;
namespace EasyAbp.EShop.Payments.Refunds.Dtos
{
public class CreateUpdateRefundDto
{
[DisplayName("RefundStoreId")]
public Guid? StoreId { get; set; }
}
}

12
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/Dtos/GetRefundListDto.cs

@ -0,0 +1,12 @@
using System;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Payments.Refunds.Dtos
{
public class GetRefundListDto : PagedAndSortedResultRequestDto
{
public Guid? StoreId { get; set; }
public Guid? UserId { get; set; }
}
}

6
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Refunds/IRefundAppService.cs

@ -9,9 +9,9 @@ namespace EasyAbp.EShop.Payments.Refunds
ICrudAppService<
RefundDto,
Guid,
PagedAndSortedResultRequestDto,
CreateUpdateRefundDto,
CreateUpdateRefundDto>
GetRefundListDto,
object,
object>
{
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Application" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.Application" Version="0.1.8" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="2.8.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Application.Contracts\EasyAbp.EShop.Orders.Application.Contracts.csproj" />

75
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs

@ -1,19 +1,23 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Authorization;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Payments.Dtos;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Users;
namespace EasyAbp.EShop.Payments.Payments
{
public class PaymentAppService : CrudAppService<Payment, PaymentDto, Guid, PagedAndSortedResultRequestDto, CreateUpdatePaymentDto, CreateUpdatePaymentDto>,
[Authorize]
public class PaymentAppService : CrudAppService<Payment, PaymentDto, Guid, GetPaymentListDto, object, object>,
IPaymentAppService
{
protected override string GetPolicyName { get; set; } = PaymentsPermissions.Payments.Default;
protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Payments.Default;
protected override string CreatePolicyName { get; set; } = PaymentsPermissions.Payments.Create;
protected override string UpdatePolicyName { get; set; } = PaymentsPermissions.Payments.Update;
protected override string DeletePolicyName { get; set; } = PaymentsPermissions.Payments.Delete;
private readonly IPaymentRepository _repository;
@ -21,5 +25,68 @@ namespace EasyAbp.EShop.Payments.Payments
{
_repository = repository;
}
public override async Task<PaymentDto> GetAsync(Guid id)
{
var payment = await base.GetAsync(id);
if (payment.UserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage);
// Todo: Check if current user is an admin of the store.
}
return payment;
}
protected override IQueryable<Payment> CreateFilteredQuery(GetPaymentListDto input)
{
var query = base.CreateFilteredQuery(input);
if (input.StoreId.HasValue)
{
query = query.Where(x => x.StoreId == input.StoreId.Value);
}
return query;
}
public override async Task<PagedResultDto<PaymentDto>> GetListAsync(GetPaymentListDto input)
{
if (input.UserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage);
if (input.StoreId.HasValue)
{
// Todo: Check if current user is an admin of the store.
}
else
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.CrossStore);
}
}
return await base.GetListAsync(input);
}
[RemoteService(false)]
public override Task<PaymentDto> CreateAsync(object input)
{
throw new NotSupportedException();
}
[RemoteService(false)]
public override Task<PaymentDto> UpdateAsync(Guid id, object input)
{
throw new NotSupportedException();
}
[RemoteService(false)]
public override Task DeleteAsync(Guid id)
{
throw new NotSupportedException();
}
}
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/PaymentsApplicationAutoMapperProfile.cs

@ -14,9 +14,7 @@ namespace EasyAbp.EShop.Payments
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<Payment, PaymentDto>();
CreateMap<CreateUpdatePaymentDto, Payment>(MemberList.Source);
CreateMap<Refund, RefundDto>();
CreateMap<CreateUpdateRefundDto, Refund>(MemberList.Source);
}
}
}

83
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs

@ -1,25 +1,98 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Authorization;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Refunds.Dtos;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Users;
namespace EasyAbp.EShop.Payments.Refunds
{
public class RefundAppService : CrudAppService<Refund, RefundDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateRefundDto, CreateUpdateRefundDto>,
[Authorize]
public class RefundAppService : CrudAppService<Refund, RefundDto, Guid, GetRefundListDto, object, object>,
IRefundAppService
{
protected override string GetPolicyName { get; set; } = PaymentsPermissions.Refunds.Default;
protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Refunds.Default;
protected override string CreatePolicyName { get; set; } = PaymentsPermissions.Refunds.Create;
protected override string UpdatePolicyName { get; set; } = PaymentsPermissions.Refunds.Update;
protected override string DeletePolicyName { get; set; } = PaymentsPermissions.Refunds.Delete;
private readonly IPaymentRepository _paymentRepository;
private readonly IRefundRepository _repository;
public RefundAppService(IRefundRepository repository) : base(repository)
public RefundAppService(
IPaymentRepository paymentRepository,
IRefundRepository repository) : base(repository)
{
_paymentRepository = paymentRepository;
_repository = repository;
}
public override async Task<RefundDto> GetAsync(Guid id)
{
var refund = await base.GetAsync(id);
var payment = await _paymentRepository.GetAsync(refund.PaymentId);
if (payment.UserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage);
// Todo: Check if current user is an admin of the store.
}
return refund;
}
protected override IQueryable<Refund> CreateFilteredQuery(GetRefundListDto input)
{
var query = input.UserId.HasValue ? _repository.GetQueryableByUserId(input.UserId.Value) : _repository;
if (input.StoreId.HasValue)
{
query = query.Where(x => x.StoreId == input.StoreId.Value);
}
return query;
}
public override async Task<PagedResultDto<RefundDto>> GetListAsync(GetRefundListDto input)
{
if (input.UserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage);
if (input.StoreId.HasValue)
{
// Todo: Check if current user is an admin of the store.
}
else
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.CrossStore);
}
}
return await base.GetListAsync(input);
}
[RemoteService(false)]
public override Task<RefundDto> CreateAsync(object input)
{
throw new NotSupportedException();
}
[RemoteService(false)]
public override Task<RefundDto> UpdateAsync(Guid id, object input)
{
throw new NotSupportedException();
}
[RemoteService(false)]
public override Task DeleteAsync(Guid id)
{
throw new NotSupportedException();
}
}
}

11
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/PaymentService/Payments/EShopOrderPaymentAuthorizer.cs

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Orders;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Users;
@ -59,7 +60,15 @@ namespace EasyAbp.PaymentService.Payments
}
}
return order.OrderStatus == OrderStatus.Pending;
if (order.OrderStatus != OrderStatus.Pending)
{
return false;
}
// Record the StoreId so EasyAbp.EShop.Payments.Payments.Payment entity can use it.
payment.SetProperty("StoreId", order.StoreId);
return true;
}
}
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.1.8" />
<PackageReference Include="Volo.Abp.Validation" Version="2.8.0" />
</ItemGroup>

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.Domain" Version="0.1.8" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="2.8.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Domain.Shared\EasyAbp.EShop.Stores.Domain.Shared.csproj" />

46
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/Payment.cs

@ -1,12 +1,54 @@
using System;
using PaymentServicePayment = EasyAbp.PaymentService.Payments.Payment;
using System.Collections.Generic;
using EasyAbp.PaymentService.Payments;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace EasyAbp.EShop.Payments.Payments
{
public class Payment : PaymentServicePayment
public class Payment : FullAuditedAggregateRoot<Guid>, IPayment
{
#region Base properties
public virtual Guid? TenantId { get; protected set; }
public virtual Guid UserId { get; protected set; }
[NotNull]
public virtual string PaymentMethod { get; protected set; }
[CanBeNull]
public virtual string PayeeAccount { get; protected set; }
[CanBeNull]
public virtual string ExternalTradingCode { get; protected set; }
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal OriginalPaymentAmount { get; protected set; }
public virtual decimal PaymentDiscount { get; protected set; }
public virtual decimal ActualPaymentAmount { get; protected set; }
public virtual decimal RefundAmount { get; protected set; }
public virtual DateTime? CompletionTime { get; protected set; }
public virtual DateTime? CancelledTime { get; protected set; }
public virtual List<PaymentItem> PaymentItems { get; protected set; }
#endregion
public virtual Guid? StoreId { get; protected set; }
private Payment()
{
}
public void SetStoreId(Guid? storeId)
{
StoreId = storeId;

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/IRefundRepository.cs

@ -1,9 +1,11 @@
using System;
using System.Linq;
using Volo.Abp.Domain.Repositories;
namespace EasyAbp.EShop.Payments.Refunds
{
public interface IRefundRepository : IRepository<Refund, Guid>
{
IQueryable<Refund> GetQueryableByUserId(Guid userId);
}
}

38
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/Refund.cs

@ -1,12 +1,46 @@
using System;
using PaymentServiceRefund = EasyAbp.PaymentService.Refunds.Refund;
using EasyAbp.PaymentService.Refunds;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace EasyAbp.EShop.Payments.Refunds
{
public class Refund : PaymentServiceRefund
public class Refund : FullAuditedAggregateRoot<Guid>, IRefund
{
#region Base properties
public virtual Guid? TenantId { get; protected set; }
public virtual Guid PaymentId { get; protected set; }
public virtual Guid PaymentItemId { get; protected set; }
[NotNull]
public virtual string RefundPaymentMethod { get; protected set; }
[NotNull]
public virtual string ExternalTradingCode { get; protected set; }
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal RefundAmount { get; protected set; }
[CanBeNull]
public virtual string CustomerRemark { get; protected set; }
[CanBeNull]
public virtual string StaffRemark { get; protected set; }
#endregion
public virtual Guid? StoreId { get; protected set; }
private Refund()
{
}
public void SetStoreId(Guid? storeId)
{
StoreId = storeId;

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.EntityFrameworkCore" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.EntityFrameworkCore" Version="0.1.8" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="2.8.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>

29
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEfCoreEntityExtensionMappings.cs

@ -0,0 +1,29 @@
using System;
using EasyAbp.PaymentService.Payments;
using EasyAbp.PaymentService.Refunds;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
public static class EShopPaymentsEfCoreEntityExtensionMappings
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
ObjectExtensionManager.Instance
.MapEfCoreProperty<Payment, Guid?>(
"StoreId"
);
ObjectExtensionManager.Instance
.MapEfCoreProperty<Refund, Guid?>(
"StoreId"
);
});
}
}
}

5
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/EShopPaymentsEntityFrameworkCoreModule.cs

@ -14,6 +14,11 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
)]
public class EShopPaymentsEntityFrameworkCoreModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
EShopPaymentsEfCoreEntityExtensionMappings.Configure();
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<PaymentsDbContext>(options =>

18
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContext.cs

@ -3,6 +3,8 @@ using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Refunds;
using EasyAbp.PaymentService;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
@ -25,6 +27,22 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
{
base.OnModelCreating(builder);
/* Configure the shared tables (with included modules) here */
builder.Entity<Payment>(b =>
{
b.ToTable(PaymentServiceDbProperties.DbTablePrefix + "Payments");
b.ConfigureByConvention();
});
builder.Entity<Refund>(b =>
{
b.ToTable(PaymentServiceDbProperties.DbTablePrefix + "Refunds");
b.ConfigureByConvention();
});
builder.ConfigureEShopPayments();
}
}

16
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/EntityFrameworkCore/PaymentsDbContextModelCreatingExtensions.cs

@ -43,21 +43,7 @@ namespace EasyAbp.EShop.Payments.EntityFrameworkCore
});
*/
builder.ConfigurePaymentService();
builder.Entity<Payment>(b =>
{
b.ToTable(options.TablePrefix + "Payments", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
});
builder.Entity<Refund>(b =>
{
b.ToTable(options.TablePrefix + "Refunds", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
});
EShopPaymentsEfCoreEntityExtensionMappings.Configure();
}
}
}

9
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs

@ -1,4 +1,5 @@
using System;
using System.Linq;
using EasyAbp.EShop.Payments.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
@ -10,5 +11,13 @@ namespace EasyAbp.EShop.Payments.Refunds
public RefundRepository(IDbContextProvider<PaymentsDbContext> dbContextProvider) : base(dbContextProvider)
{
}
public IQueryable<Refund> GetQueryableByUserId(Guid userId)
{
return from refund in DbContext.Refunds
join payment in DbContext.Payments on refund.PaymentId equals payment.Id
where payment.UserId == userId
select refund;
}
}
}

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.HttpApi.Client" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.HttpApi.Client" Version="0.1.8" />
<PackageReference Include="Volo.Abp.Http.Client" Version="2.8.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Application.Contracts\EasyAbp.EShop.Payments.Application.Contracts.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.HttpApi" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.HttpApi" Version="0.1.8" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="2.8.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Application.Contracts\EasyAbp.EShop.Payments.Application.Contracts.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.MongoDB" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.MongoDB" Version="0.1.8" />
<PackageReference Include="Volo.Abp.MongoDB" Version="2.8.0" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>

3
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj

@ -11,12 +11,13 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Web" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.Web" Version="0.1.8" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.8.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="2.8.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Application.Contracts\EasyAbp.EShop.Stores.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.HttpApi\EasyAbp.EShop.Payments.HttpApi.csproj" />
</ItemGroup>

23
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml

@ -11,6 +11,18 @@
PageLayout.Content.Title = L["Payment"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:Payment"].Value);
PageLayout.Content.MenuItemName = "Payment";
var cardTitle = @L["Payment"].Value;
if (Model.StoreName != null)
{
cardTitle += $" - {Model.StoreName}";
}
if (Model.UserName != null)
{
cardTitle += $" - {Model.UserName}";
}
}
@section scripts
@ -26,16 +38,7 @@
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["Payment"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-right">
@if (await Authorization.IsGrantedAsync(PaymentsPermissions.Payments.Create))
{
<abp-button id="NewPaymentButton"
text="@L["CreatePayment"].Value"
icon="plus"
button-type="Primary" />
}
<abp-card-title>@cardTitle</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>

30
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Payments/Payment/Index.cshtml.cs

@ -1,12 +1,40 @@
using System;
using System.Threading.Tasks;
using EasyAbp.EShop.Stores.Stores;
using Microsoft.AspNetCore.Mvc;
namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Payments.Payment
{
public class IndexModel : PaymentsPageModel
{
private readonly IStoreAppService _storeAppService;
[BindProperty(SupportsGet = true)]
public Guid? StoreId { get; set; }
[BindProperty(SupportsGet = true)]
public Guid? UserId { get; set; }
public string StoreName { get; set; }
public string UserName { get; set; }
public IndexModel(IStoreAppService storeAppService)
{
_storeAppService = storeAppService;
}
public async Task OnGetAsync()
{
await Task.CompletedTask;
if (StoreId.HasValue)
{
StoreName = (await _storeAppService.GetAsync(StoreId.Value)).Name;
}
if (UserId.HasValue)
{
// Todo: get username
}
}
}
}

23
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml

@ -11,6 +11,18 @@
PageLayout.Content.Title = L["Refund"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:Refund"].Value);
PageLayout.Content.MenuItemName = "Refund";
var cardTitle = @L["Refund"].Value;
if (Model.StoreName != null)
{
cardTitle += $" - {Model.StoreName}";
}
if (Model.UserName != null)
{
cardTitle += $" - {Model.UserName}";
}
}
@section scripts
@ -26,16 +38,7 @@
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@L["Refund"]</abp-card-title>
</abp-column>
<abp-column size-md="_6" class="text-right">
@if (await Authorization.IsGrantedAsync(PaymentsPermissions.Refunds.Create))
{
<abp-button id="NewRefundButton"
text="@L["CreateRefund"].Value"
icon="plus"
button-type="Primary" />
}
<abp-card-title>@cardTitle</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>

30
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/Pages/EShop/Payments/Refunds/Refund/Index.cshtml.cs

@ -1,12 +1,40 @@
using System;
using System.Threading.Tasks;
using EasyAbp.EShop.Stores.Stores;
using Microsoft.AspNetCore.Mvc;
namespace EasyAbp.EShop.Payments.Web.Pages.EShop.Payments.Refunds.Refund
{
public class IndexModel : PaymentsPageModel
{
private readonly IStoreAppService _storeAppService;
[BindProperty(SupportsGet = true)]
public Guid? StoreId { get; set; }
[BindProperty(SupportsGet = true)]
public Guid? UserId { get; set; }
public string StoreName { get; set; }
public string UserName { get; set; }
public IndexModel(IStoreAppService storeAppService)
{
_storeAppService = storeAppService;
}
public async Task OnGetAsync()
{
await Task.CompletedTask;
if (StoreId.HasValue)
{
StoreName = (await _storeAppService.GetAsync(StoreId.Value)).Name;
}
if (UserId.HasValue)
{
// Todo: get username
}
}
}
}

30
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsMenuContributor.cs

@ -15,6 +15,7 @@ using EasyAbp.EShop.Payments.Localization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using EasyAbp.EShop.Payments.Localization;
using EasyAbp.EShop.Stores.Stores;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.UI.Navigation;
@ -32,21 +33,36 @@ namespace EasyAbp.EShop.Payments.Web
private async Task ConfigureMainMenu(MenuConfigurationContext context)
{
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<PaymentsResource>>(); //Add main menu items.
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<PaymentsResource>>();
var paymentManagementMenuItem = new ApplicationMenuItem("PaymentManagement", l["Menu:PaymentManagement"]);
if (await authorizationService.IsGrantedAsync(PaymentsPermissions.Payments.Default))
var storeAppService = context.ServiceProvider.GetRequiredService<IStoreAppService>();
var defaultStore = (await storeAppService.GetDefaultAsync())?.Id;
if (await authorizationService.IsGrantedAsync(PaymentsPermissions.Payments.Manage))
{
context.Menu.AddItem(
new ApplicationMenuItem("Payments", l["Menu:Payments"], "/Payments/Payment")
paymentManagementMenuItem.AddItem(
new ApplicationMenuItem("Payments", l["Menu:Payments"], "/EShop/Payments/Payments/Payment?storeId=" + defaultStore)
);
}
if (await authorizationService.IsGrantedAsync(PaymentsPermissions.Refunds.Default))
if (await authorizationService.IsGrantedAsync(PaymentsPermissions.Refunds.Manage))
{
context.Menu.AddItem(
new ApplicationMenuItem("Refunds", l["Menu:Refunds"], "/Refunds/Refund")
paymentManagementMenuItem.AddItem(
new ApplicationMenuItem("Refunds", l["Menu:Refunds"], "/EShop/Payments/Refunds/Refund?storeId=" + defaultStore)
);
}
if (!paymentManagementMenuItem.Items.IsNullOrEmpty())
{
var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == "EasyAbpEShop",
() => new ApplicationMenuItem("EasyAbpEShop", l["Menu:EasyAbpEShop"]));
eShopMenuItem.Items.Add(paymentManagementMenuItem);
}
}
}
}

1
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/PaymentsWebAutoMapperProfile.cs

@ -10,7 +10,6 @@ namespace EasyAbp.EShop.Payments.Web
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<RefundDto, CreateUpdateRefundDto>();
}
}
}

2
samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application.Contracts" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application.Contracts" Version="0.1.8" />
<PackageReference Include="Volo.Abp.ObjectExtending" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj

@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Application" Version="0.1.8" />
<PackageReference Include="Volo.Abp.Account.Application" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain.Shared" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain.Shared" Version="0.1.8" />
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.IdentityServer.Domain.Shared" Version="2.8.0" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Domain" Version="0.1.8" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.2.0" />
<PackageReference Include="Volo.Abp.Identity.Domain" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EntityFrameworkCore/EShopSampleMigrationsDbContext.cs

@ -1,4 +1,5 @@
using EasyAbp.EShop.EntityFrameworkCore;
using EasyAbp.PaymentService.EntityFrameworkCore;
using EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
@ -46,6 +47,7 @@ namespace EShopSample.EntityFrameworkCore
builder.ConfigureEShopSample();
builder.ConfigureEShop();
builder.ConfigurePaymentService();
builder.ConfigurePaymentServiceWeChatPay();
}
}

3129
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200602074752_AddedPaymentAndRefundEntities.Designer.cs

File diff suppressed because it is too large

32
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200602074752_AddedPaymentAndRefundEntities.cs

@ -0,0 +1,32 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace EShopSample.Migrations
{
public partial class AddedPaymentAndRefundEntities : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "StoreId",
table: "PaymentServiceRefunds",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "StoreId",
table: "PaymentServicePayments",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "StoreId",
table: "PaymentServiceRefunds");
migrationBuilder.DropColumn(
name: "StoreId",
table: "PaymentServicePayments");
}
}
}

6
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs

@ -960,6 +960,9 @@ namespace EShopSample.Migrations
b.Property<decimal>("RefundAmount")
.HasColumnType("decimal(18,6)");
b.Property<Guid?>("StoreId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
@ -1108,6 +1111,9 @@ namespace EShopSample.Migrations
b.Property<string>("StaffRemark")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("StoreId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");

2
samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj

@ -10,7 +10,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\integration\EasyAbp.EShop\src\EasyAbp.EShop.EntityFrameworkCore\EasyAbp.EShop.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\EShopSample.Domain\EShopSample.Domain.csproj" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.EntityFrameworkCore" Version="0.1.8" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="2.8.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi.Client" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi.Client" Version="0.1.8" />
<PackageReference Include="Volo.Abp.Account.HttpApi.Client" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi.Client" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.HttpApi" Version="0.1.8" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="2.8.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="2.8.0" />

2
samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj

@ -45,7 +45,7 @@
<ProjectReference Include="..\EShopSample.Application\EShopSample.Application.csproj" />
<ProjectReference Include="..\EShopSample.HttpApi\EShopSample.HttpApi.csproj" />
<ProjectReference Include="..\EShopSample.EntityFrameworkCore.DbMigrations\EShopSample.EntityFrameworkCore.DbMigrations.csproj" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Web" Version="0.1.6" />
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Web" Version="0.1.8" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="2.8.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="2.8.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="2.8.0" />

42
samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs

@ -1,5 +1,6 @@
using System;
using System.IO;
using EasyAbp.EShop;
using EasyAbp.EShop.Baskets;
using EasyAbp.EShop.Baskets.Web;
using EasyAbp.EShop.Orders;
@ -104,14 +105,35 @@ namespace EShopSample.Web
{
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(typeof(EShopBasketsApplicationModule).Assembly);
options.ConventionalControllers.Create(typeof(EShopOrdersApplicationModule).Assembly);
options.ConventionalControllers.Create(typeof(EShopPaymentsApplicationModule).Assembly);
options.ConventionalControllers.Create(typeof(EShopProductsApplicationModule).Assembly);
options.ConventionalControllers.Create(typeof(EShopStoresApplicationModule).Assembly);
options.ConventionalControllers.Create(typeof(EShopBasketsApplicationModule).Assembly, opt =>
{
opt.RootPath = "eShop";
});
options.ConventionalControllers.Create(typeof(EShopOrdersApplicationModule).Assembly, opt =>
{
opt.RootPath = "eShop";
});
options.ConventionalControllers.Create(typeof(EShopPaymentsApplicationModule).Assembly, opt =>
{
opt.RootPath = "eShop";
});
options.ConventionalControllers.Create(typeof(EShopProductsApplicationModule).Assembly, opt =>
{
opt.RootPath = "eShop";
});
options.ConventionalControllers.Create(typeof(EShopStoresApplicationModule).Assembly, opt =>
{
opt.RootPath = "eShop";
});
options.ConventionalControllers.Create(typeof(PaymentServiceApplicationModule).Assembly);
options.ConventionalControllers.Create(typeof(PaymentServiceWeChatPayApplicationModule).Assembly);
options.ConventionalControllers.Create(typeof(PaymentServiceApplicationModule).Assembly, opt =>
{
opt.RootPath = "paymentService";
});
options.ConventionalControllers.Create(typeof(PaymentServiceWeChatPayApplicationModule).Assembly, opt =>
{
opt.RootPath = "paymentService";
});
});
}
@ -155,6 +177,12 @@ namespace EShopSample.Web
options.FileSets.ReplaceEmbeddedByPhysical<EShopSampleApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}EShopSample.Application"));
options.FileSets.ReplaceEmbeddedByPhysical<EShopSampleWebModule>(hostingEnvironment.ContentRootPath);
options.FileSets.ReplaceEmbeddedByPhysical<EShopDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}integration{Path.DirectorySeparatorChar}EasyAbp.EShop{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Domain.Shared"));
options.FileSets.ReplaceEmbeddedByPhysical<EShopDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}integration{Path.DirectorySeparatorChar}EasyAbp.EShop{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Domain"));
options.FileSets.ReplaceEmbeddedByPhysical<EShopApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}integration{Path.DirectorySeparatorChar}EasyAbp.EShop{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Application.Contracts"));
options.FileSets.ReplaceEmbeddedByPhysical<EShopApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}integration{Path.DirectorySeparatorChar}EasyAbp.EShop{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Application"));
options.FileSets.ReplaceEmbeddedByPhysical<EShopWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}integration{Path.DirectorySeparatorChar}EasyAbp.EShop{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Web"));
options.FileSets.ReplaceEmbeddedByPhysical<EShopBasketsDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}EasyAbp.EShop.Baskets{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Baskets.Domain.Shared"));
options.FileSets.ReplaceEmbeddedByPhysical<EShopBasketsDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}EasyAbp.EShop.Baskets{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Baskets.Domain"));
options.FileSets.ReplaceEmbeddedByPhysical<EShopBasketsApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}EasyAbp.EShop.Baskets{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Baskets.Application.Contracts"));

Loading…
Cancel
Save