Browse Source
Merge pull request #10063 from abpframework/liangshiwei/template
Add MyProjectNameRemoteServiceConsts
pull/10066/head
maliming
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
9 additions and
4 deletions
-
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Application.Contracts/MyProjectNameRemoteServiceConsts.cs
-
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Client/MyProjectNameHttpApiClientModule.cs
-
templates/module/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi/Samples/SampleController.cs
|
|
@ -0,0 +1,7 @@ |
|
|
|
|
|
namespace MyCompanyName.MyProjectName |
|
|
|
|
|
{ |
|
|
|
|
|
public class MyProjectNameRemoteServiceConsts |
|
|
|
|
|
{ |
|
|
|
|
|
public const string RemoteServiceName = "MyProjectName"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
@ -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 => |
|
|
|
|
|
@ -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 |
|
|
{ |
|
|
{ |
|
|
|