feat: 完成abp-tool的接口调用

This commit is contained in:
橙子
2024-06-02 13:27:41 +08:00
parent cbc34ade78
commit bca3ce1e5f
6 changed files with 13 additions and 17 deletions

View File

@@ -1,14 +1,10 @@
using System; using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic; using Volo.Abp.Application.Services;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Yi.Abp.Tool.Application.Contracts.Dtos; using Yi.Abp.Tool.Application.Contracts.Dtos;
namespace Yi.Abp.Tool.Application.Contracts namespace Yi.Abp.Tool.Application.Contracts
{ {
public interface ITemplateGenService public interface ITemplateGenService: IApplicationService
{ {
Task<IActionResult> CreateModuleAsync(TemplateGenCreateInputDto moduleCreateInputDto); Task<IActionResult> CreateModuleAsync(TemplateGenCreateInputDto moduleCreateInputDto);
Task<IActionResult> CreateProjectAsync(TemplateGenCreateInputDto moduleCreateInputDto); Task<IActionResult> CreateProjectAsync(TemplateGenCreateInputDto moduleCreateInputDto);

View File

@@ -8,6 +8,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Yi.Abp.Tool.Domain.Shared\Yi.Abp.Tool.Domain.Shared.csproj" /> <ProjectReference Include="..\Yi.Abp.Tool.Domain.Shared\Yi.Abp.Tool.Domain.Shared.csproj" />
<ProjectReference Include="..\..\framework\Yi.Framework.Ddd.Application.Contracts\Yi.Framework.Ddd.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Mapster; using Mapster;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Services;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Yi.Abp.Tool.Application.Contracts; using Yi.Abp.Tool.Application.Contracts;
using Yi.Abp.Tool.Application.Contracts.Dtos; using Yi.Abp.Tool.Application.Contracts.Dtos;
@@ -15,7 +16,7 @@ using Yi.Framework.Core.Helper;
namespace Yi.Abp.Tool.Application namespace Yi.Abp.Tool.Application
{ {
public class TemplateGenService : IRemoteService, ITemplateGenService, ITransientDependency public class TemplateGenService : ApplicationService,ITemplateGenService
{ {
private readonly TemplateGenManager _templateGenManager; private readonly TemplateGenManager _templateGenManager;
public TemplateGenService(TemplateGenManager templateGenManager) { _templateGenManager = templateGenManager; } public TemplateGenService(TemplateGenManager templateGenManager) { _templateGenManager = templateGenManager; }

View File

@@ -8,6 +8,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Yi.Abp.Tool.Application.Contracts\Yi.Abp.Tool.Application.Contracts.csproj" /> <ProjectReference Include="..\Yi.Abp.Tool.Application.Contracts\Yi.Abp.Tool.Application.Contracts.csproj" />
<ProjectReference Include="..\Yi.Abp.Tool.Domain\Yi.Abp.Tool.Domain.csproj" /> <ProjectReference Include="..\Yi.Abp.Tool.Domain\Yi.Abp.Tool.Domain.csproj" />
<ProjectReference Include="..\..\framework\Yi.Framework.Ddd.Application\Yi.Framework.Ddd.Application.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,7 +1,7 @@
using System.Reflection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Yi.Abp.Tool; using Yi.Abp.Tool;
using Yi.Abp.Tool.Application.Contracts;
class Program class Program
{ {
@@ -27,6 +27,7 @@ class Program
.UseAutofac() .UseAutofac()
.Build(); .Build();
var sss= host.Services.GetRequiredService<ITemplateGenService>();
var commandSelector = host.Services.GetRequiredService<CommandSelector>(); var commandSelector = host.Services.GetRequiredService<CommandSelector>();
await commandSelector.SelectorAsync(args); await commandSelector.SelectorAsync(args);
} }

View File

@@ -1,13 +1,9 @@
using System; using Yi.Abp.Tool.HttpApi.Client;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Abp.Tool.HttpApi.Client;
namespace Yi.Abp.Tool namespace Yi.Abp.Tool
{ {
[DependsOn(typeof(YiAbpToolHttpApiClientModule))] [DependsOn(typeof(YiAbpToolHttpApiClientModule)
)]
public class YiAbpToolModule : AbpModule public class YiAbpToolModule : AbpModule
{ {
} }