Browse Source

Fix typo

pull/184/head
Jadyn 4 years ago
parent
commit
7e160fa0aa
  1. 2
      plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application.Contracts/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/Dtos/CreateOrderResultDto.cs
  2. 2
      plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application.Contracts/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/IFlashSalePlanAppService.cs
  3. 6
      plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppService.cs
  4. 8
      plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandler.cs
  5. 2
      plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.HttpApi/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanController.cs
  6. 14
      plugins/FlashSales/test/EasyAbp.EShop.Plugins.FlashSales.Application.Tests/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppServiceTests.cs
  7. 14
      plugins/FlashSales/test/EasyAbp.EShop.Plugins.FlashSales.Application.Tests/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandlerTest.cs

2
plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application.Contracts/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/Dtos/CreateOrderDto.cs → plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application.Contracts/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/Dtos/CreateOrderResultDto.cs

@ -3,7 +3,7 @@ using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Plugins.FlashSales.FlashSalePlans.Dtos;
public class CreateOrderDto : ExtensibleEntityDto
public class CreateOrderResultDto : ExtensibleEntityDto
{
public bool IsSuccess { get; set; }

2
plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application.Contracts/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/IFlashSalePlanAppService.cs

@ -15,5 +15,5 @@ public interface IFlashSalePlanAppService :
{
Task<FlashSalePlanPreOrderDto> PreOrderAsync(Guid id);
Task<CreateOrderDto> OrderAsync(Guid id, CreateOrderInput input);
Task<CreateOrderResultDto> OrderAsync(Guid id, CreateOrderInput input);
}

6
plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppService.cs

@ -216,7 +216,7 @@ public class FlashSalePlanAppService :
return new FlashSalePlanPreOrderDto { ExpiresTime = Clock.Normalize(expiresTime.LocalDateTime), ExpiresInSeconds = Options.PreOrderExpires.TotalSeconds };
}
public virtual async Task<CreateOrderDto> OrderAsync(Guid id, CreateOrderInput input)
public virtual async Task<CreateOrderResultDto> OrderAsync(Guid id, CreateOrderInput input)
{
var preOrderCache = await GetPreOrderCacheAsync(id);
if (preOrderCache == null)
@ -259,7 +259,7 @@ public class FlashSalePlanAppService :
plan.TenantId, preOrderCache.InventoryProviderName,
plan.StoreId, plan.ProductId, plan.ProductSkuId, 1, true))
{
return new CreateOrderDto() { IsSuccess = false };
return new CreateOrderResultDto() { IsSuccess = false };
}
var result = await CreatePendingFlashSaleResultAsync(plan, userId, async (existsResultId) =>
@ -278,7 +278,7 @@ public class FlashSalePlanAppService :
await DistributedEventBus.PublishAsync(createFlashSaleOrderEto);
return new CreateOrderDto() { IsSuccess = true, FlashSaleResultId = result.Id };
return new CreateOrderResultDto() { IsSuccess = true, FlashSaleResultId = result.Id };
}
#region PreOrderCache

8
plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/RollBackInventoryCreateFlashSaleOrderCompleteEventHandler.cs → plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandler.cs

@ -10,20 +10,20 @@ using Volo.Abp.EventBus.Distributed;
namespace EasyAbp.EShop.Plugins.FlashSales.FlashSalePlans;
public class RollBackInventoryCreateFlashSaleOrderCompleteEventHandler : IDistributedEventHandler<CreateFlashSaleOrderCompleteEto>, ITransientDependency
public class ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandler : IDistributedEventHandler<CreateFlashSaleOrderCompleteEto>, ITransientDependency
{
protected IFlashSaleInventoryManager FlashSaleInventoryManager { get; }
protected IDistributedCache DistributedCache { get; }
protected IFlashSalePlanRepository FlashSalePlanRepository { get; }
protected IProductAppService ProductAppService { get; }
protected ILogger<RollBackInventoryCreateFlashSaleOrderCompleteEventHandler> Logger { get; }
protected ILogger<ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandler> Logger { get; }
public RollBackInventoryCreateFlashSaleOrderCompleteEventHandler(
public ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandler(
IFlashSaleInventoryManager flashSaleInventoryManager,
IDistributedCache distributedCache,
IFlashSalePlanRepository flashSalePlanRepository,
IProductAppService productAppService,
ILogger<RollBackInventoryCreateFlashSaleOrderCompleteEventHandler> logger)
ILogger<ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandler> logger)
{
FlashSaleInventoryManager = flashSaleInventoryManager;
DistributedCache = distributedCache;

2
plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.HttpApi/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanController.cs

@ -58,7 +58,7 @@ public class FlashSalePlanController :
}
[HttpPost("{id}/order")]
public virtual Task<CreateOrderDto> OrderAsync(Guid id, CreateOrderInput input)
public virtual Task<CreateOrderResultDto> OrderAsync(Guid id, CreateOrderInput input)
{
return Service.OrderAsync(id, input);
}

14
plugins/FlashSales/test/EasyAbp.EShop.Plugins.FlashSales.Application.Tests/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppServiceTests.cs

@ -140,7 +140,7 @@ public class FlashSalePlanAppServiceTests : FlashSalesApplicationTestBase
}
[Fact]
public async Task CreateAsync_Should_Throw_Expcetion_When_Validate_Product_Failed()
public async Task CreateAsync_Should_Throw_Exception_When_Validate_Product_Failed()
{
var createDto = new FlashSalePlanCreateDto()
{
@ -197,7 +197,7 @@ public class FlashSalePlanAppServiceTests : FlashSalesApplicationTestBase
}
[Fact]
public async Task UpdateAsync_Should_Throw_Expcetion_When_Validate_Product_Failed()
public async Task UpdateAsync_Should_Throw_Exception_When_Validate_Product_Failed()
{
var createDto = new FlashSalePlanCreateDto()
{
@ -230,7 +230,7 @@ public class FlashSalePlanAppServiceTests : FlashSalesApplicationTestBase
}
[Fact]
public async Task UpdateAsync_Should_Throw_Expcetion_When_Has_Result_And_Change_Product()
public async Task UpdateAsync_Should_Throw_Exception_When_Has_Result_And_Change_Product()
{
var createDto = new FlashSalePlanCreateDto()
{
@ -274,7 +274,7 @@ public class FlashSalePlanAppServiceTests : FlashSalesApplicationTestBase
}
[Fact]
public async Task DeleteAsync_Should_Throw_Expcetion_When_Has_Result()
public async Task DeleteAsync_Should_Throw_Exception_When_Has_Result()
{
var createDto = new FlashSalePlanCreateDto()
{
@ -362,10 +362,10 @@ public class FlashSalePlanAppServiceTests : FlashSalesApplicationTestBase
};
await AppService.PreOrderAsync(plan.Id);
var isSucess = await AppService.OrderAsync(plan.Id, createOrderInput);
var createOrderDto = await AppService.OrderAsync(plan.Id, createOrderInput);
isSucess.IsSuccess.ShouldBe(true);
isSucess.FlashSaleResultId.ShouldNotBeNull();
createOrderDto.IsSuccess.ShouldBe(true);
createOrderDto.FlashSaleResultId.ShouldNotBeNull();
await DistributedEventBus.Received().PublishAsync(Arg.Is<CreateFlashSaleOrderEto>(eto =>
eto.TenantId == plan.TenantId &&
eto.StoreId == plan.StoreId &&

14
plugins/FlashSales/test/EasyAbp.EShop.Plugins.FlashSales.Application.Tests/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/RollBackInventoryCreateFlashSaleOrderCompleteEventHandlerTest.cs → plugins/FlashSales/test/EasyAbp.EShop.Plugins.FlashSales.Application.Tests/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandlerTest.cs

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EasyAbp.Eshop.Products.Products;
using EasyAbp.EShop.Plugins.FlashSales.FlashSaleResults;
@ -13,17 +10,14 @@ using Microsoft.Extensions.DependencyInjection.Extensions;
using NSubstitute;
using NSubstitute.ReceivedExtensions;
using Shouldly;
using Volo.Abp;
using Volo.Abp.Caching;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Users;
using Xunit;
namespace EasyAbp.EShop.Plugins.FlashSales.FlashSalePlans;
public class RollBackInventoryCreateFlashSaleOrderCompleteEventHandlerTest : FlashSalesApplicationTestBase
public class ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandlerTest : FlashSalesApplicationTestBase
{
protected RollBackInventoryCreateFlashSaleOrderCompleteEventHandler EventHandler { get; }
protected ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandler EventHandler { get; }
protected IDistributedCache DistributedCache { get; }
@ -31,9 +25,9 @@ public class RollBackInventoryCreateFlashSaleOrderCompleteEventHandlerTest : Fla
private ProductDto Product1 { get; set; }
public RollBackInventoryCreateFlashSaleOrderCompleteEventHandlerTest()
public ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandlerTest()
{
EventHandler = GetRequiredService<RollBackInventoryCreateFlashSaleOrderCompleteEventHandler>();
EventHandler = GetRequiredService<ProcessInvalidHashTokenCreateFlashSaleOrderCompleteEventHandler>();
DistributedCache = GetRequiredService<IDistributedCache>();
FlashSaleInventoryManager = GetRequiredService<IFlashSaleInventoryManager>();
}
Loading…
Cancel
Save