private static void CreateWebApiProxiesForServices() { //TODO: must be able to exclude/include all methods option DynamicApiControllerBuilder .For <IFlowService>("workflow/flow") .Build(); DynamicApiControllerBuilder .For <IUserService>("workflow/user") .Build(); }
public override void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); //DynamicApiControllerBuilder // .ForAll<IApplicationService>(typeof(NotifyApplicationModule).Assembly, "app") // .Build(); DynamicApiControllerBuilder .For <IWebApiAppService>("notify/appservice") .WithConventionalVerbs() .Build(); }
public override void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); //DynamicApiControllerBuilder // .ForAll<IApplicationService>(typeof(HlxBeApplicationModule).Assembly, "app") // .Build(); DynamicApiControllerBuilder .For <Application.Users.IUserAppService>("app/user") .Build(); DynamicApiControllerBuilder .For <Application.Sessions.ISessionAppService>("app/session") .Build(); DynamicApiControllerBuilder .For <Application.Roles.IRoleAppService>("app/role") .Build(); DynamicApiControllerBuilder .For <Application.MultiTenancy.ITenantAppService>("app/tenant") .Build(); #region Mobility Web Api DynamicApiControllerBuilder .For <Application.Mobility.Users.IUserAppService>("app/mobility/user") .Build(); DynamicApiControllerBuilder .For <Application.Mobility.Videos.IVideoAppService>("app/mobility/video") .Build(); #endregion #region MobilityH5 Web Api DynamicApiControllerBuilder .For <IProductAppService>("app/mobilityh5/product") .Build(); DynamicApiControllerBuilder .For <IShoppingCartAppService>("app/mobilityh5/shoppingcart") .Build(); #endregion Configuration.Modules.AbpWebApi().HttpConfiguration.Filters.Add(new HostAuthenticationFilter("Bearer")); }
public override void Initialize(IAbpInitializationContext initializationContext) { base.Initialize(initializationContext); //This code is used to register classes to dependency injection system for this assembly using conventions. IocManager.Instance.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); //Creating dynamic Web Api Controllers for application services. //Thus, 'web api layer' is created automatically by ABP. DynamicApiControllerBuilder .For <ITaskAppService>("tasksystem/task") .Build(); DynamicApiControllerBuilder .For <IPersonAppService>("tasksystem/person") .Build(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app) { app.UseIISPlatformHandler(); app.UseFileServer(new FileServerOptions() { FileProvider = new PhysicalFileProvider(RuntimeContext.Current.Path.BaseDirectory), RequestPath = new PathString(""), EnableDirectoryBrowsing = false }); app.UsePerHttpRequestContainer(); app.UseSession(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{app}/{controller}/{action}", defaults: new { app = "base", controller = "common", action = "index" }); //新添加的路由配置 by jak routes.MapAppRoute( name: "app_one", template: "{app}/{controller?}", defaults: new { controllr = "index", action = "" }); routes.MapAppRoute( name: "app_two", template: "{app}/{controller}/{action}"); routes.MapAppRoute( name: "app_three", template: "{app}/{controller}/{action}/{action1}"); routes.MapAppRoute( name: "app_four", template: "{app}/{controller}/{action}/{action1}/{action2}/{id?}"); }); app.RegisterEntityFrameworkRepositoryContext(); app.RegisterAllModelCreators(); app.RegisterAllRepositories(); app.RegisterAllServices(); app.RegisterAllTranslateProviders(); DynamicApiControllerBuilder.For <ITestDataService>().WithApp("demo03").Build(); DynamicApiControllerBuilder.For <IArticleServices>().WithApp("Article").Build(); }
private static void CreateWebApiProxiesForServices() { //TODO: must be able to exclude/include all methods option DynamicApiControllerBuilder .For <ITaskeverUserAppService>("taskever/user") .Build(); DynamicApiControllerBuilder .For <ITaskAppService>("taskever/task") .Build(); DynamicApiControllerBuilder .For <IFriendshipAppService>("taskever/friendship") .Build(); DynamicApiControllerBuilder .For <IUserActivityAppService>("taskever/userActivity") .Build(); }