Browse Source

Merge pull request #10063 from abpframework/liangshiwei/template

Add MyProjectNameRemoteServiceConsts
pull/10066/head
maliming 5 years ago
committed by GitHub
parent
commit
e9d5fd5d78
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application.Contracts/MyProjectNameRemoteServiceConsts.cs
  2. 4
      templates/module/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Client/MyProjectNameHttpApiClientModule.cs
  3. 2
      templates/module/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi/Samples/SampleController.cs

7
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application.Contracts/MyProjectNameRemoteServiceConsts.cs

@ -0,0 +1,7 @@
namespace MyCompanyName.MyProjectName
{
public class MyProjectNameRemoteServiceConsts
{
public const string RemoteServiceName = "MyProjectName";
}
}

4
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Client/MyProjectNameHttpApiClientModule.cs

@ -10,13 +10,11 @@ namespace MyCompanyName.MyProjectName
typeof(AbpHttpClientModule))] typeof(AbpHttpClientModule))]
public class MyProjectNameHttpApiClientModule : AbpModule public class MyProjectNameHttpApiClientModule : AbpModule
{ {
public const string RemoteServiceName = "MyProjectName";
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
context.Services.AddHttpClientProxies( context.Services.AddHttpClientProxies(
typeof(MyProjectNameApplicationContractsModule).Assembly, typeof(MyProjectNameApplicationContractsModule).Assembly,
RemoteServiceName MyProjectNameRemoteServiceConsts.RemoteServiceName
); );
Configure<AbpVirtualFileSystemOptions>(options => Configure<AbpVirtualFileSystemOptions>(options =>

2
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi/Samples/SampleController.cs

@ -5,7 +5,7 @@ using Volo.Abp;
namespace MyCompanyName.MyProjectName.Samples namespace MyCompanyName.MyProjectName.Samples
{ {
[RemoteService] [RemoteService(Name = MyProjectNameRemoteServiceConsts.RemoteServiceName)]
[Route("api/MyProjectName/sample")] [Route("api/MyProjectName/sample")]
public class SampleController : MyProjectNameController, ISampleAppService public class SampleController : MyProjectNameController, ISampleAppService
{ {

Loading…
Cancel
Save