完善大部分问题

This commit is contained in:
橙子
2022-04-08 23:44:25 +08:00
parent 5fcd4fb5a4
commit feb73174eb
26 changed files with 160 additions and 160 deletions

View File

@@ -37,6 +37,8 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
c.Datacenter = consulClientOption.Datacenter;
}))
{
client.Agent.ServiceDeregister($"{consulRegisterOption.IP}-{consulRegisterOption.Port}-{Guid.NewGuid()}");
client.Agent.ServiceRegister(new AgentServiceRegistration()
{
ID = $"{consulRegisterOption.IP}-{consulRegisterOption.Port}-{Guid.NewGuid()}",//唯一Id

View File

@@ -8,6 +8,7 @@ using System.Text;
using Yi.Framework.Common.Const;
using Yi.Framework.Common.Helper;
using Yi.Framework.Common.IOCOptions;
using Yi.Framework.Core;
namespace Yi.Framework.WebCore.MiddlewareExtend
{
@@ -19,7 +20,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
public static IServiceCollection AddJwtService(this IServiceCollection services)
{
services.Configure<JWTTokenOptions>(Appsettings.appConfiguration("JwtAuthorize"));
services.AddTransient<JwtInvoker>();
var jwtOptions = Appsettings.app<JWTTokenOptions>("JwtAuthorize");
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>

View File

@@ -11,7 +11,10 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Yi.Framework.Interface;
using Yi.Framework.Job;
using Yi.Framework.Repository;
using Yi.Framework.Service;
using Yi.Framework.WebCore.Utility;
using Module = Autofac.Module;
@@ -38,16 +41,16 @@ namespace Yi.Framework.WebCore.Utility
containerBuilder.RegisterType< HttpContextAccessor>().As<IHttpContextAccessor>().SingleInstance();
containerBuilder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope();
containerBuilder.RegisterGeneric(typeof(BaseService<>)).As(typeof(IBaseService<>)).InstancePerLifetimeScope();
///反射注入服务层及接口层
var assemblysServices = GetDll( "Yi.Framework.Service.dll");
containerBuilder.RegisterAssemblyTypes(assemblysServices)
.AsImplementedInterfaces()
.InstancePerDependency()
.InstancePerLifetimeScope()
.EnableInterfaceInterceptors();
///反射注册任务调度层
///反射注册任务调度层
var assemblysJob = GetDll("Yi.Framework.Job.dll");
containerBuilder.RegisterAssemblyTypes(assemblysJob)
.InstancePerDependency();

View File

@@ -35,7 +35,10 @@
<ItemGroup>
<ProjectReference Include="..\Yi.Framework.Core\Yi.Framework.Core.csproj" />
<ProjectReference Include="..\Yi.Framework.DTOModel\Yi.Framework.DTOModel.csproj" />
<ProjectReference Include="..\Yi.Framework.Interface\Yi.Framework.Interface.csproj" />
<ProjectReference Include="..\Yi.Framework.Model\Yi.Framework.Model.csproj" />
<ProjectReference Include="..\Yi.Framework.Repository\Yi.Framework.Repository.csproj" />
<ProjectReference Include="..\Yi.Framework.Service\Yi.Framework.Service.csproj" />
</ItemGroup>
</Project>