优化扩展
This commit is contained in:
@@ -18,6 +18,7 @@ using Yi.Framework.Common.IOCOptions;
|
||||
using Yi.Framework.Interface;
|
||||
using Yi.Framework.Model;
|
||||
using Yi.Framework.Service;
|
||||
using Yi.Framework.WebCore;
|
||||
using Yi.Framework.WebCore.MiddlewareExtend;
|
||||
|
||||
namespace Yi.Framework.ApiMicroservice
|
||||
@@ -34,6 +35,11 @@ namespace Yi.Framework.ApiMicroservice
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
#region
|
||||
//Ioc<6F><63><EFBFBD><EFBFBD>
|
||||
#endregion
|
||||
services.AddIocService(Configuration);
|
||||
|
||||
#region
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#endregion
|
||||
@@ -50,25 +56,21 @@ namespace Yi.Framework.ApiMicroservice
|
||||
services.AddCorsService();
|
||||
|
||||
#region
|
||||
//<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//Sqlite<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#endregion
|
||||
services.AddDataBaseService<SqliteOptions>("SqliteConn");
|
||||
services.AddSqliteService();
|
||||
|
||||
#region
|
||||
//Redis<69><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#endregion
|
||||
services.AddRedisService();
|
||||
//services.AddRedisService();
|
||||
|
||||
#region
|
||||
//RabbitMQ<4D><51><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#endregion
|
||||
services.AddRabbitMQService();
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ЩӦ<D0A9>Զ<EFBFBD>ע<EFBFBD><D7A2>
|
||||
services.AddScoped<IUserService, UserService>();
|
||||
services.AddScoped<IRoleService, RoleService>();
|
||||
|
||||
//services.AddRabbitMQService();
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region Autofac<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>
|
||||
@@ -82,7 +84,7 @@ namespace Yi.Framework.ApiMicroservice
|
||||
#endregion
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
//if (env.IsDevelopment())
|
||||
{
|
||||
@@ -115,7 +117,7 @@ namespace Yi.Framework.ApiMicroservice
|
||||
#region
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
||||
#endregion
|
||||
app.UseHealthCheckMiddleware();
|
||||
//app.UseHealthCheckMiddleware();
|
||||
|
||||
#region
|
||||
//<2F><>Ȩע<C8A8><D7A2>
|
||||
@@ -130,7 +132,7 @@ namespace Yi.Framework.ApiMicroservice
|
||||
#region
|
||||
//Consul<75><6C><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
||||
#endregion
|
||||
await app.UseConsulService();
|
||||
//await app.UseConsulService();
|
||||
|
||||
#region
|
||||
//Endpointsע<73><D7A2>
|
||||
|
||||
Reference in New Issue
Block a user