mirror of https://github.com/EasyAbp/EShop.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.5 KiB
3.5 KiB
EShop.Plugins.FlashSales
A flash-sales plugin for EShop.
Installation
-
Install the following NuGet packages. (see how)
- EasyAbp.EShop.Orders.Plugins.FlashSales.Application (install at EasyAbp.EShop.Orders.Application location)
- EasyAbp.EShop.Products.Plugins.FlashSales.Application (install at EasyAbp.EShop.Products.Application location)
- EasyAbp.EShop.Plugins.FlashSales.Application
- EasyAbp.EShop.Plugins.FlashSales.Application.Contracts
- EasyAbp.EShop.Plugins.FlashSales.Domain
- EasyAbp.EShop.Plugins.FlashSales.Domain.Shared
- EasyAbp.EShop.Plugins.FlashSales.EntityFrameworkCore
- EasyAbp.EShop.Plugins.FlashSales.HttpApi
- EasyAbp.EShop.Plugins.FlashSales.HttpApi.Client
- (Optional) EasyAbp.EShop.Plugins.FlashSales.MongoDB
- (Optional) EasyAbp.EShop.Plugins.FlashSales.Web
- (Optional) EasyAbp.EShop.Products.Plugins.FlashSales.Application.Contracts (install at EasyAbp.EShop.Products.Application.Contracts location)
- (Optional) EasyAbp.EShop.Products.Plugins.FlashSales.HttpApi (install at EasyAbp.EShop.Products.HttpApi location)
- (Optional) EasyAbp.EShop.Products.Plugins.FlashSales.HttpApi.Client (install at EasyAbp.EShop.Products.HttpApi.Client location)
-
Add
DependsOn(typeof(EShopXxxModule))attribute to configure the module dependencies. (see how) -
Add
builder.ConfigureEShopPluginsFlashSales();to theOnModelCreating()method in MyProjectDbContext.cs. -
Add EF Core migrations and update your database. See: ABP document.
Usage
Admins
- Create a published flash-sale plan.
Customers
- Use
/api/e-shop/plugins/flash-sales/flash-sale-plan/{planId}/pre-order(POST) to pre-order. It will return an expiration time if your pre-order request succeeds. Don't forget to re-invoke this API to refresh your request before the expiration time. - When the flash sale starts, use
/api/e-shop/plugins/flash-sales/flash-sale-plan/{planId}/order(POST) to create your order. If you are fast enough, it will occupy the inventory and create an order for you in the background. - If you are told that you have succeeded, continuous use
/api/e-shop/plugins/flash-sales/flash-sale-result/current/{planId}(GET) to query the order creation result until it succeeds or fails.
Stress Test
See the stress test report.