build: 升级目标框架到net10.0并完善模板配置
1. 将Hua.Cli.Tests、项目共享库、模块项目等所有项目的TargetFramework从net8.0/net9.0升级到net10.0 2. 完善dotnet-tools.json、模板配置文件,添加必要的构建和发布配置 3. 新增微服务、网关、应用程序的启动脚本和基础配置文件 4. 补充产品管理模块的领域、应用、Web层基础代码和多语言资源
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using ProductManagement;
|
||||
using Volo.Abp.Data;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Domain.Repositories;
|
||||
using Volo.Abp.Uow;
|
||||
|
||||
namespace Company.Project.ProductService;
|
||||
|
||||
public class ProductServiceDataSeeder : IDataSeedContributor, ITransientDependency
|
||||
{
|
||||
private readonly ProductManager _productManager;
|
||||
private readonly IRepository<Product, Guid> _productRepository;
|
||||
|
||||
public ProductServiceDataSeeder(
|
||||
IRepository<Product, Guid> productRepository,
|
||||
ProductManager productManager)
|
||||
{
|
||||
_productRepository = productRepository;
|
||||
_productManager = productManager;
|
||||
}
|
||||
|
||||
[UnitOfWork]
|
||||
public virtual async Task SeedAsync(DataSeedContext context)
|
||||
{
|
||||
await AddProductsAsync();
|
||||
}
|
||||
|
||||
private async Task AddProductsAsync()
|
||||
{
|
||||
if (await _productRepository.GetCountAsync() > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await _productManager.CreateAsync("ABP04918", "Lego Star Wars - 75059 Sandcrawler UCS", 999, 42, "lego.jpg");
|
||||
await _productManager.CreateAsync("ABP23849", "Nikon AF-S 50mm f/1.8 G Lens", 1499, 56, "nikon.jpg");
|
||||
await _productManager.CreateAsync("ABP82731", "Beats Solo3 Wireless On-Ear Headphone", 97, 20, "beats.jpg");
|
||||
await _productManager.CreateAsync("ABP12322", "Rampage Sn-Rw2 Gamer Headphone", 654, 42, "rampage.jpg");
|
||||
await _productManager.CreateAsync("ABP00291", "Asus Transformer Book T300CHI-FH011H", 1249, 3, "asus.jpg");
|
||||
await _productManager.CreateAsync("ABP02918", "OKI C332DN Dublex + Network A4 Laser Printer", 215, 6, "oki.jpg");
|
||||
await _productManager.CreateAsync("ABP11121", "Bluecat Rd810 Mini Led", 449, 13, "bluecat.jpg");
|
||||
await _productManager.CreateAsync("ABP44432", "Sunny 55\" TV 4K Ultra HD Curved Smart Led TV", 2249, 1, "sunny.jpg");
|
||||
await _productManager.CreateAsync("ABP37182", "Sony Playstation 4 Slim 500 GB (PAL)", 699, 120, "playstation.jpg");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user