This commit is contained in:
橙子
2021-11-09 19:13:21 +08:00
parent 4a37c7454d
commit 0a6759b361
3 changed files with 34 additions and 12 deletions

View File

@@ -4,4 +4,33 @@
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="configuration.json" />
<None Remove="Log4net.config" />
</ItemGroup>
<ItemGroup>
<Content Include="configuration.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="Log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Yi.Framework.Common\Yi.Framework.Common.csproj" />
<ProjectReference Include="..\Yi.Framework.Interface\Yi.Framework.Interface.csproj" />
<ProjectReference Include="..\Yi.Framework.WebCore\Yi.Framework.WebCore.csproj" />
</ItemGroup>
</Project>

View File

@@ -10,16 +10,6 @@
<NoWarn>1701;1702;CS1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Content Remove="appsettings.Development.json" />
<Content Remove="appsettings.json" />
</ItemGroup>
<ItemGroup>
<None Include="appsettings.Development.json" />
<None Include="appsettings.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Core;
using Yi.Framework.Interface;
using Yi.Framework.Model.Models;
using Yi.Framework.Model.Search;
@@ -12,9 +13,11 @@ namespace Yi.Framework.Service
public class SearchService : ISearchService
{
private IGoodsService _goodsService;
public SearchService(IGoodsService goodsService)
private ElasticSearchInvoker _elasticSearchInvoker ;
public SearchService(IGoodsService goodsService, ElasticSearchInvoker elasticSearchInvoker)
{
_goodsService = goodsService;
_elasticSearchInvoker = elasticSearchInvoker;
}
public void ImpDataBySpu()
{
@@ -48,7 +51,7 @@ namespace Yi.Framework.Service
}
}
// 存入es,先留着,不写
//_elasticSearchService.Send(goodsList);
_elasticSearchInvoker.Send(goodsList);
page++;
} while (size == 100);
}