Browse Source

更新部分Nuget包;修改部分代码适配abp 2.9.0 api;变更message项目路径

pull/7/head
cKey 6 years ago
parent
commit
73aee65421
  1. 26
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/AggregateReRouteAppService.cs
  2. 15
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationAppService.cs
  3. 19
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/ReRouteAppService.cs
  4. 7
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN/ApiGateway/EventBus/ApigatewayConfigChangeEventData.cs
  5. 1
      aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj
  6. 2
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj
  7. 3
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs
  8. 10
      aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj
  9. 1
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj
  10. 60
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN/ApiGateway/ApiGatewayHostModule.cs
  11. 2
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN/ApiGateway/EventBus/IOcelotConfigurationChangedEvent.cs
  12. 12
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN/ApiGateway/EventBus/OcelotConfigurationChangedEvent.cs
  13. 48
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs
  14. 1
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj
  15. 8
      aspnet-core/services/cleanup-logs.bat
  16. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Controllers/NotificationController.cs
  17. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContext.cs
  18. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContextFactory.cs
  19. 20
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj
  20. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiHostModule.cs
  21. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN/Abp/MessageService/Utils/SnowflakeIdGenerator.cs
  22. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.Designer.cs
  23. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.cs
  24. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.Designer.cs
  25. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.cs
  26. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs
  27. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/MultiTenancy/AuthorizationTenantResolveContributor.cs
  28. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Program.cs
  29. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Properties/launchSettings.json
  30. 0
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Startup.cs
  31. 8
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContext.cs
  32. 2
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContextFactory.cs
  33. 17
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj
  34. 1259
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200513010936_Migration-IdentityServer-MySql.Designer.cs
  35. 773
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200513010936_Migration-IdentityServer-MySql.cs
  36. 1426
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200606012143_Upgrade-Abp-2.9.0.Designer.cs
  37. 199
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200606012143_Upgrade-Abp-2.9.0.cs
  38. 1424
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs
  39. 29
      aspnet-core/services/start-messages.bat
  40. 5
      vueJs/src/api/clients.ts

26
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/AggregateReRouteAppService.cs

@ -1,11 +1,10 @@
using DotNetCore.CAP;
using LINGYUN.ApiGateway.EventBus;
using LINGYUN.ApiGateway.Snowflake;
using LINGYUN.ApiGateway.EventBus;
using Microsoft.AspNetCore.Authorization;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.EventBus.Distributed;
namespace LINGYUN.ApiGateway.Ocelot
{
@ -16,14 +15,14 @@ namespace LINGYUN.ApiGateway.Ocelot
[Authorize(ApiGatewayPermissions.AggregateRoute.Default)]
public class AggregateReRouteAppService : ApiGatewayApplicationServiceBase, IAggregateReRouteAppService
{
private readonly ICapPublisher _eventPublisher;
private IDistributedEventBus _eventBus;
protected IDistributedEventBus DistributedEventBus => LazyGetRequiredService(ref _eventBus);
private readonly IAggregateReRouteRepository _aggregateReRouteRepository;
public AggregateReRouteAppService(
ICapPublisher eventPublisher,
IAggregateReRouteRepository aggregateReRouteRepository)
{
_eventPublisher = eventPublisher;
_aggregateReRouteRepository = aggregateReRouteRepository;
}
@ -75,8 +74,7 @@ namespace LINGYUN.ApiGateway.Ocelot
}
aggregateRoute = await _aggregateReRouteRepository.InsertAsync(aggregateRoute);
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName,
new ApigatewayConfigChangeCommand("AggregateRoute", "Create"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("AggregateRoute", "Create"));
return ObjectMapper.Map<AggregateReRoute, AggregateReRouteDto>(aggregateRoute);
}
@ -106,8 +104,7 @@ namespace LINGYUN.ApiGateway.Ocelot
aggregateRoute = await _aggregateReRouteRepository.UpdateAsync(aggregateRoute, true);
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName,
new ApigatewayConfigChangeCommand("AggregateRoute", "Update"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("AggregateRoute", "Update"));
return ObjectMapper.Map<AggregateReRoute, AggregateReRouteDto>(aggregateRoute);
}
@ -119,8 +116,7 @@ namespace LINGYUN.ApiGateway.Ocelot
var aggregateRoute = await _aggregateReRouteRepository.GetByRouteIdAsync(routeId);
await _aggregateReRouteRepository.DeleteAsync(aggregateRoute);
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName,
new ApigatewayConfigChangeCommand("AggregateRoute", "Delete"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("AggregateRoute", "Delete"));
}
[Authorize(ApiGatewayPermissions.AggregateRoute.ManageRouteConfig)]
@ -135,8 +131,7 @@ namespace LINGYUN.ApiGateway.Ocelot
await _aggregateReRouteRepository.UpdateAsync(aggregateRoute);
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName,
new ApigatewayConfigChangeCommand("AggregateRoute", "AddRouteConfig"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("AggregateRoute", "AddRouteConfig"));
return ObjectMapper.Map<AggregateReRouteConfig, AggregateReRouteConfigDto>(aggregateRouteConfig);
}
@ -150,8 +145,7 @@ namespace LINGYUN.ApiGateway.Ocelot
await _aggregateReRouteRepository.UpdateAsync(aggregateRoute);
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName,
new ApigatewayConfigChangeCommand("AggregateRoute", "DeleteRouteConfig"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("AggregateRoute", "DeleteRouteConfig"));
}
}
}

15
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/GlobalConfigurationAppService.cs

@ -1,29 +1,28 @@
using DotNetCore.CAP;
using LINGYUN.ApiGateway.EventBus;
using LINGYUN.ApiGateway.EventBus;
using LINGYUN.ApiGateway.Snowflake;
using Microsoft.AspNetCore.Authorization;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.EventBus.Distributed;
namespace LINGYUN.ApiGateway.Ocelot
{
[Authorize(ApiGatewayPermissions.Global.Default)]
public class GlobalConfigurationAppService : ApiGatewayApplicationServiceBase, IGlobalConfigurationAppService
{
private IDistributedEventBus _eventBus;
protected IDistributedEventBus DistributedEventBus => LazyGetRequiredService(ref _eventBus);
private readonly IRouteGroupChecker _routeGroupChecker;
private readonly IGlobalConfigRepository _globalConfigRepository;
private readonly ISnowflakeIdGenerator _snowflakeIdGenerator;
private readonly ICapPublisher _eventPublisher;
public GlobalConfigurationAppService(
ICapPublisher eventPublisher,
IRouteGroupChecker routeGroupChecker,
ISnowflakeIdGenerator snowflakeIdGenerator,
IGlobalConfigRepository globalConfigRepository
)
{
_eventPublisher = eventPublisher;
_routeGroupChecker = routeGroupChecker;
_snowflakeIdGenerator = snowflakeIdGenerator;
_globalConfigRepository = globalConfigRepository;
@ -56,7 +55,7 @@ namespace LINGYUN.ApiGateway.Ocelot
globalConfiguration = await _globalConfigRepository.InsertAsync(globalConfiguration, true);
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName, new ApigatewayConfigChangeCommand("Global", "Create"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("Global", "Create"));
return ObjectMapper.Map<GlobalConfiguration, GlobalConfigurationDto>(globalConfiguration);
}
@ -75,7 +74,7 @@ namespace LINGYUN.ApiGateway.Ocelot
globalConfiguration = await _globalConfigRepository.UpdateAsync(globalConfiguration, true);
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName, new ApigatewayConfigChangeCommand("Global", "Modify"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("Global", "Modify"));
return ObjectMapper.Map<GlobalConfiguration, GlobalConfigurationDto>(globalConfiguration);
}

19
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Application/LINGYUN/ApiGateway/Ocelot/ReRouteAppService.cs

@ -1,27 +1,26 @@
using DotNetCore.CAP;
using LINGYUN.ApiGateway.EventBus;
using LINGYUN.ApiGateway.EventBus;
using Microsoft.AspNetCore.Authorization;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.EventBus.Distributed;
namespace LINGYUN.ApiGateway.Ocelot
{
[Authorize(ApiGatewayPermissions.Route.Default)]
public class ReRouteAppService : ApiGatewayApplicationServiceBase, IReRouteAppService
{
private IDistributedEventBus _eventBus;
protected IDistributedEventBus DistributedEventBus => LazyGetRequiredService(ref _eventBus);
private readonly IRouteGroupChecker _routeGroupChecker;
private readonly IReRouteRepository _reRouteRepository;
private readonly ICapPublisher _eventPublisher;
public ReRouteAppService(
ICapPublisher eventPublisher,
IRouteGroupChecker routeGroupChecker,
IReRouteRepository reRouteRepository
)
{
_eventPublisher = eventPublisher;
_routeGroupChecker = routeGroupChecker;
_reRouteRepository = reRouteRepository;
}
@ -37,7 +36,7 @@ namespace LINGYUN.ApiGateway.Ocelot
var reRouteDto = ObjectMapper.Map<ReRoute, ReRouteDto>(reRoute);
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName, new ApigatewayConfigChangeCommand("ReRoute", "Create"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("ReRoute", "Create"));
return reRouteDto;
}
@ -74,7 +73,7 @@ namespace LINGYUN.ApiGateway.Ocelot
var reRouteDto = ObjectMapper.Map<ReRoute, ReRouteDto>(reRoute);
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName, new ApigatewayConfigChangeCommand("ReRoute", "Modify"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("ReRoute", "Modify"));
return reRouteDto;
}
@ -118,7 +117,7 @@ namespace LINGYUN.ApiGateway.Ocelot
{
await _reRouteRepository.DeleteAsync(x => x.ReRouteId.Equals(routeGetById.RouteId));
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName, new ApigatewayConfigChangeCommand("ReRoute", "Delete"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("ReRoute", "Delete"));
}
[Authorize(ApiGatewayPermissions.Route.Delete)]
@ -128,7 +127,7 @@ namespace LINGYUN.ApiGateway.Ocelot
await _reRouteRepository.DeleteAsync(x => x.AppId.Equals(routeGetByAppId.AppId));
await _eventPublisher.PublishAsync(ApigatewayConfigChangeCommand.EventName, new ApigatewayConfigChangeCommand("ReRoute", "Clean"));
await DistributedEventBus.PublishAsync(new ApigatewayConfigChangeEventData("ReRoute", "Clean"));
}
protected virtual void ApplyReRouteOptions(ReRoute reRoute, ReRouteDtoBase routeDto)

7
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN/ApiGateway/EventBus/ApigatewayConfigChangeCommand.cs → aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain.Shared/LINGYUN/ApiGateway/EventBus/ApigatewayConfigChangeEventData.cs

@ -2,18 +2,17 @@
namespace LINGYUN.ApiGateway.EventBus
{
public class ApigatewayConfigChangeCommand
public class ApigatewayConfigChangeEventData
{
public const string EventName = nameof(ApigatewayConfigChangeCommand);
public DateTime DateTime { get; set; }
public string Method { get; set; }
public string Object { get; set; }
protected ApigatewayConfigChangeCommand()
protected ApigatewayConfigChangeEventData()
{
}
public ApigatewayConfigChangeCommand(string @object, string @method)
public ApigatewayConfigChangeEventData(string @object, string @method)
{
DateTime = DateTime.Now;
Object = @object;

1
aspnet-core/modules/apigateway/LINGYUN.ApiGateway.Domain/LINGYUN.ApiGateway.Domain.csproj

@ -6,7 +6,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="3.0.3" />
<PackageReference Include="Volo.Abp.Caching" Version="2.9.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="2.9.0" />
</ItemGroup>

2
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj

@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="3.0.3" />
<PackageReference Include="DotNetCore.CAP" Version="3.0.4" />
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="2.9.0" />
<PackageReference Include="Volo.Abp.EventBus" Version="2.9.0" />
</ItemGroup>

3
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs

@ -31,7 +31,8 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources
public virtual async Task<PagedResultDto<ApiResourceDto>> GetAsync(ApiResourceGetByPagedInputDto apiResourceGetByPaged)
{
var apiResources = await ApiResourceRepository.GetListAsync(apiResourceGetByPaged.Sorting,
apiResourceGetByPaged.SkipCount, apiResourceGetByPaged.MaxResultCount);
apiResourceGetByPaged.SkipCount, apiResourceGetByPaged.MaxResultCount,
apiResourceGetByPaged.Filter);
var apiResourceCount = await ApiResourceRepository.GetCountAsync();
return new PagedResultDto<ApiResourceDto>(apiResourceCount,

10
aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj

@ -6,17 +6,17 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.3" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="3.0.3" />
<PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.4" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="3.0.4" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Enrichers.Assembly" Version="2.0.0" />
<PackageReference Include="Serilog.Enrichers.Process" Version="2.0.1" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.3">
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

1
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN.ApiGateway.Host.csproj

@ -25,6 +25,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\modules\apigateway\LINGYUN.ApiGateway.HttpApi.Client\LINGYUN.ApiGateway.HttpApi.Client.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
</ItemGroup>
</Project>

60
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN/ApiGateway/ApiGatewayHostModule.cs

@ -1,7 +1,8 @@
using Microsoft.AspNetCore.Builder;
using DotNetCore.CAP;
using LINGYUN.Abp.EventBus.CAP;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Ocelot.Configuration.Repository;
using Ocelot.DependencyInjection;
using Ocelot.Extenssions;
@ -11,9 +12,7 @@ using Volo.Abp;
using Volo.Abp.AspNetCore;
using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper;
using Volo.Abp.Http.Client;
using Volo.Abp.Http.Client.IdentityModel;
using Volo.Abp.IdentityModel;
using Volo.Abp.Modularity;
namespace LINGYUN.ApiGateway
@ -23,10 +22,33 @@ namespace LINGYUN.ApiGateway
typeof(AbpHttpClientIdentityModelModule),
typeof(AbpAutoMapperModule),
typeof(ApiGatewayHttpApiClientModule),
typeof(AbpCAPEventBusModule),
typeof(AbpAspNetCoreModule)
)]
public class ApiGatewayHostModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
// 不启用则使用本地配置文件的方式启动Ocelot
if (configuration.GetValue<bool>("EnabledDynamicOcelot"))
{
context.Services.AddSingleton<IFileConfigurationRepository, ApiHttpClientFileConfigurationRepository>();
}
PreConfigure<CapOptions>(options =>
{
options
.UseInMemoryStorage()
.UseDashboard()
.UseRabbitMQ(rabbitMQOptions =>
{
configuration.GetSection("CAP:RabbitMQ").Bind(rabbitMQOptions);
});
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
@ -39,13 +61,6 @@ namespace LINGYUN.ApiGateway
Configure<ApiGatewayOptions>(configuration.GetSection("ApiGateway"));
// 不启用则使用本地配置文件的方式启动Ocelot
if (configuration.GetValue<bool>("EnabledDynamicOcelot"))
{
context.Services.AddSingleton<IFileConfigurationRepository, ApiHttpClientFileConfigurationRepository>();
ConfigureCAP(context.Services, configuration);
}
context.Services.AddAuthentication("Bearer")
.AddIdentityServerAuthentication(options =>
{
@ -64,34 +79,11 @@ namespace LINGYUN.ApiGateway
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.UseAuditing();
// 启用ws协议
app.UseWebSockets();
app.UseOcelot().Wait();
}
private void ConfigureCAP(IServiceCollection services, IConfiguration configuration)
{
services.AddCap(x =>
{
x.UseInMemoryStorage();
x.UseDashboard();
x.UseRabbitMQ(cfg =>
{
cfg.HostName = configuration.GetValue<string>("CAP:RabbitMQ:Connect:Host");
cfg.VirtualHost = configuration.GetValue<string>("CAP:RabbitMQ:Connect:VirtualHost");
cfg.Port = configuration.GetValue<int>("CAP:RabbitMQ:Connect:Port");
cfg.UserName = configuration.GetValue<string>("CAP:RabbitMQ:Connect:UserName");
cfg.Password = configuration.GetValue<string>("CAP:RabbitMQ:Connect:Password");
cfg.ExchangeName = configuration.GetValue<string>("CAP:RabbitMQ:Connect:ExchangeName");
});
x.FailedRetryCount = 5;
});
}
}
}

2
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN/ApiGateway/EventBus/IOcelotConfigurationChangedEvent.cs

@ -4,6 +4,6 @@ namespace LINGYUN.ApiGateway.EventBus
{
public interface IOcelotConfigurationChangedEvent
{
Task OnOcelotConfigurationChanged(ApigatewayConfigChangeCommand changeCommand);
Task OnOcelotConfigurationChanged(ApigatewayConfigChangeEventData changeCommand);
}
}

12
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/LINGYUN/ApiGateway/EventBus/OcelotConfigurationChangedEvent.cs

@ -1,15 +1,14 @@
using DotNetCore.CAP;
using LINGYUN.ApiGateway.Ocelot;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging;
using Ocelot.Configuration.Creator;
using Ocelot.Configuration.Repository;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
namespace LINGYUN.ApiGateway.EventBus
{
public class OcelotConfigurationChangedEvent : IOcelotConfigurationChangedEvent, ITransientDependency, ICapSubscribe
public class OcelotConfigurationChangedEvent : IDistributedEventHandler<ApigatewayConfigChangeEventData>, ITransientDependency
{
private readonly ILogger<OcelotConfigurationChangedEvent> _logger;
@ -28,8 +27,7 @@ namespace LINGYUN.ApiGateway.EventBus
_logger = logger;
}
[CapSubscribe(ApigatewayConfigChangeCommand.EventName)]
public async Task OnOcelotConfigurationChanged(ApigatewayConfigChangeCommand changeCommand)
public async Task HandleEventAsync(ApigatewayConfigChangeEventData eventData)
{
var fileConfig = await _fileConfigRepo.Get();
@ -46,7 +44,7 @@ namespace LINGYUN.ApiGateway.EventBus
_internalConfigRepo.AddOrReplace(config.Data);
}
}
_logger.LogInformation("ocelot configuration changed on {0}", changeCommand.DateTime);
_logger.LogInformation("ocelot configuration changed on {0}", eventData.DateTime);
}
}
}

48
aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs

@ -1,5 +1,7 @@
using DotNetCore.CAP.Messages;
using DotNetCore.CAP;
using DotNetCore.CAP.Messages;
using IdentityModel;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.ApiGateway.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
@ -35,10 +37,26 @@ namespace LINGYUN.ApiGateway
typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpCAPEventBusModule),
typeof(AbpAutofacModule)
)]
public class ApiGatewayHttpApiHostModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
PreConfigure<CapOptions>(options =>
{
options
.UseMySql(configuration.GetConnectionString("Default"))
.UseRabbitMQ(rabbitMQOptions =>
{
configuration.GetSection("CAP:RabbitMQ").Bind(rabbitMQOptions);
});
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
@ -96,34 +114,6 @@ namespace LINGYUN.ApiGateway
options.InstanceName = instanceName.IsNullOrEmpty() ? "ApiGateway_Cache" : instanceName;
});
context.Services.AddCap(x =>
{
x.UseEntityFramework<ApiGatewayDbContext>();
x.UseDashboard();
x.UseRabbitMQ(cfg =>
{
cfg.HostName = configuration["CAP:RabbitMQ:Connect:Host"];
cfg.VirtualHost = configuration["CAP:RabbitMQ:Connect:VirtualHost"];
cfg.UserName = configuration["CAP:RabbitMQ:Connect:UserName"];
cfg.Password = configuration["CAP:RabbitMQ:Connect:Password"];
cfg.ExchangeName = configuration["CAP:RabbitMQ:Connect:ExchangeName"];
cfg.Port = configuration.GetValue<int>("CAP:RabbitMQ:Connect:Port");
});
x.FailedRetryCount = 5;
x.FailedThresholdCallback = (type, message) =>
{
// 是订阅者的错误
if (type == MessageType.Subscribe)
{
Console.WriteLine(message);
}
};
});
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["RedisCache:ConnectString"]);

1
aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/LINGYUN.ApiGateway.HttpApi.Host.csproj

@ -39,6 +39,7 @@
<ProjectReference Include="..\..\..\modules\apigateway\LINGYUN.ApiGateway.Application\LINGYUN.ApiGateway.Application.csproj" />
<ProjectReference Include="..\..\..\modules\apigateway\LINGYUN.ApiGateway.EntityFrameworkCore\LINGYUN.ApiGateway.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\apigateway\LINGYUN.ApiGateway.HttpApi\LINGYUN.ApiGateway.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
</ItemGroup>
</Project>

8
aspnet-core/services/cleanup-logs.bat

@ -4,8 +4,8 @@ chcp 65001
echo. 清理所有服务日志
del .\platform\LINGYUN.Platform.HttpApi.Host\Logs /y
del .\apigateway\LINGYUN.ApiGateway.Host\Logs /y
del .\apigateway\LINGYUN.ApiGateway.HttpApi.Host\Logs /y
del .\account\AuthServer.Host\Logs /y
del .\platform\LINGYUN.Platform.HttpApi.Host\Logs /Q
del .\apigateway\LINGYUN.ApiGateway.Host\Logs /Q
del .\apigateway\LINGYUN.ApiGateway.HttpApi.Host\Logs /Q
del .\account\AuthServer.Host\Logs /Q

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Controllers/NotificationController.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Controllers/NotificationController.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContext.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContext.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContextFactory.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EntityFrameworkCore/MessageServiceHostMigrationsDbContextFactory.cs

20
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj

@ -6,14 +6,14 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.3" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="3.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.3">
<PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.4" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="3.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.4" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Enrichers.Assembly" Version="2.0.0" />
@ -32,11 +32,11 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\modules\common\LINGYUN.Abp.IM.SignalR\LINGYUN.Abp.IM.SignalR.csproj" />
<ProjectReference Include="..\modules\common\LINGYUN.Abp.Notifications.SignalR\LINGYUN.Abp.Notifications.SignalR.csproj" />
<ProjectReference Include="..\modules\message\LINGYUN.Abp.MessageService.EntityFrameworkCore\LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\modules\message\LINGYUN.Abp.MessageService.HttpApi\LINGYUN.Abp.MessageService.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.IM.SignalR\LINGYUN.Abp.IM.SignalR.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.Notifications.SignalR\LINGYUN.Abp.Notifications.SignalR.csproj" />
<ProjectReference Include="..\..\..\modules\message\LINGYUN.Abp.MessageService.EntityFrameworkCore\LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\modules\message\LINGYUN.Abp.MessageService.HttpApi\LINGYUN.Abp.MessageService.HttpApi.csproj" />
</ItemGroup>
</Project>

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiHostModule.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiHostModule.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN/Abp/MessageService/Utils/SnowflakeIdGenerator.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN/Abp/MessageService/Utils/SnowflakeIdGenerator.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.Designer.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.Designer.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200601060701_Add-Abp-Message-Service-Module.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.Designer.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.Designer.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/MultiTenancy/AuthorizationTenantResolveContributor.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/MultiTenancy/AuthorizationTenantResolveContributor.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Program.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Program.cs

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Properties/launchSettings.json → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Properties/launchSettings.json

0
aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Startup.cs → aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Startup.cs

8
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContext.cs

@ -20,16 +20,16 @@ namespace LINGYUN.Platform.EntityFrameworkCore
{
base.OnModelCreating(modelBuilder);
modelBuilder.UseMySQL();
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureIdentityServer(options =>
{
options.TablePrefix = "IdentityServer";
options.Schema = null;
options.DatabaseProvider = EfCoreDatabaseProvider.MySql;
});
modelBuilder.ConfigureTenantManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigurePermissionManagement();
//modelBuilder.ConfigureTenantManagement();
//modelBuilder.ConfigureSettingManagement();
//modelBuilder.ConfigurePermissionManagement();
}
}
}

2
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/EntityFrameworkCore/PlatformHttpApiHostMigrationsDbContextFactory.cs

@ -12,7 +12,7 @@ namespace LINGYUN.Platform.EntityFrameworkCore
var configuration = BuildConfiguration();
var builder = new DbContextOptionsBuilder<PlatformHttpApiHostMigrationsDbContext>()
.UseMySql(configuration.GetConnectionString("Default"));
.UseMySql(configuration.GetConnectionString("AbpIdentityServer"));
return new PlatformHttpApiHostMigrationsDbContext(builder.Options);
}

17
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj

@ -5,6 +5,13 @@
<RootNamespace>LINGYUN.Platform</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Migrations\20200606010914_Upgrade-Abp-2.9.0.cs" />
<Compile Remove="Migrations\20200606010914_Upgrade-Abp-2.9.0.Designer.cs" />
<Compile Remove="Migrations\20200606011507_Upgrade-Abp-2.9.0.cs" />
<Compile Remove="Migrations\20200606011507_Upgrade-Abp-2.9.0.Designer.cs" />
</ItemGroup>
<ItemGroup>
<Content Remove="LINGYUN\Platform\Identity\Localization\en.json" />
<Content Remove="LINGYUN\Platform\Identity\Localization\zh-Hans.json" />
@ -16,14 +23,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.3" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="3.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.3">
<PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.4" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="3.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.4" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Enrichers.Assembly" Version="2.0.0" />

1259
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200513010936_Migration-IdentityServer-MySql.Designer.cs

File diff suppressed because it is too large

773
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200513010936_Migration-IdentityServer-MySql.cs

@ -0,0 +1,773 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Platform.Migrations
{
public partial class MigrationIdentityServerMySql : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 256, nullable: false),
Required = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
Regex = table.Column<string>(maxLength: 512, nullable: true),
RegexDescription = table.Column<string>(maxLength: 128, nullable: true),
Description = table.Column<string>(maxLength: 256, nullable: true),
ValueType = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 256, nullable: false),
NormalizedName = table.Column<string>(maxLength: 256, nullable: false),
IsDefault = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
IsPublic = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUsers",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: false),
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: true),
Surname = table.Column<string>(maxLength: 64, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: false),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: false),
EmailConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
PasswordHash = table.Column<string>(maxLength: 256, nullable: true),
SecurityStamp = table.Column<string>(maxLength: 256, nullable: false),
PhoneNumber = table.Column<string>(maxLength: 16, nullable: true),
PhoneNumberConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
TwoFactorEnabled = table.Column<bool>(nullable: false, defaultValue: false),
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
LockoutEnabled = table.Column<bool>(nullable: false, defaultValue: false),
AccessFailedCount = table.Column<int>(nullable: false, defaultValue: 0)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiResources",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
Properties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerClients",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
ClientName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
ClientUri = table.Column<string>(maxLength: 2000, nullable: true),
LogoUri = table.Column<string>(maxLength: 2000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
ProtocolType = table.Column<string>(maxLength: 200, nullable: false),
RequireClientSecret = table.Column<bool>(nullable: false),
RequireConsent = table.Column<bool>(nullable: false),
AllowRememberConsent = table.Column<bool>(nullable: false),
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false),
RequirePkce = table.Column<bool>(nullable: false),
AllowPlainTextPkce = table.Column<bool>(nullable: false),
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false),
FrontChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
BackChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
AllowOfflineAccess = table.Column<bool>(nullable: false),
IdentityTokenLifetime = table.Column<int>(nullable: false),
AccessTokenLifetime = table.Column<int>(nullable: false),
AuthorizationCodeLifetime = table.Column<int>(nullable: false),
ConsentLifetime = table.Column<int>(nullable: true),
AbsoluteRefreshTokenLifetime = table.Column<int>(nullable: false),
SlidingRefreshTokenLifetime = table.Column<int>(nullable: false),
RefreshTokenUsage = table.Column<int>(nullable: false),
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(nullable: false),
RefreshTokenExpiration = table.Column<int>(nullable: false),
AccessTokenType = table.Column<int>(nullable: false),
EnableLocalLogin = table.Column<bool>(nullable: false),
IncludeJwtId = table.Column<bool>(nullable: false),
AlwaysSendClientClaims = table.Column<bool>(nullable: false),
ClientClaimsPrefix = table.Column<string>(maxLength: 200, nullable: true),
PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true),
UserSsoLifetime = table.Column<int>(nullable: true),
UserCodeType = table.Column<string>(maxLength: 100, nullable: true),
DeviceCodeLifetime = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClients", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerDeviceFlowCodes",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
DeviceCode = table.Column<string>(maxLength: 200, nullable: false),
UserCode = table.Column<string>(maxLength: 200, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
Expiration = table.Column<DateTime>(nullable: false),
Data = table.Column<string>(maxLength: 50000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResources",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Enabled = table.Column<bool>(nullable: false),
Required = table.Column<bool>(nullable: false),
Emphasize = table.Column<bool>(nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false),
Properties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "IdentityServerPersistedGrants",
columns: table => new
{
Key = table.Column<string>(maxLength: 200, nullable: false),
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
Type = table.Column<string>(maxLength: 50, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
Expiration = table.Column<DateTime>(nullable: true),
Data = table.Column<string>(maxLength: 10000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
});
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ClaimType = table.Column<string>(maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(maxLength: 1024, nullable: true),
RoleId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AbpRoleClaims_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ClaimType = table.Column<string>(maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(maxLength: 1024, nullable: true),
UserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AbpUserClaims_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserLogins",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ProviderKey = table.Column<string>(maxLength: 196, nullable: false),
ProviderDisplayName = table.Column<string>(maxLength: 128, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider });
table.ForeignKey(
name: "FK_AbpUserLogins_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserRoles",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
RoleId = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AbpUserRoles_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpUserRoles_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserTokens",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AbpUserTokens_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiClaims", x => new { x.ApiResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiClaims_IdentityServerApiResources_ApiResour~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopes",
columns: table => new
{
ApiResourceId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
Required = table.Column<bool>(nullable: false),
Emphasize = table.Column<bool>(nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopes", x => new { x.ApiResourceId, x.Name });
table.ForeignKey(
name: "FK_IdentityServerApiScopes_IdentityServerApiResources_ApiResour~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiSecrets",
columns: table => new
{
Type = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 300, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false),
Description = table.Column<string>(maxLength: 2000, nullable: true),
Expiration = table.Column<DateTime>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiSecrets", x => new { x.ApiResourceId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiSecrets_IdentityServerApiResources_ApiResou~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientClaims",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Type = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientCorsOrigins",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Origin = table.Column<string>(maxLength: 150, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin });
table.ForeignKey(
name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_Client~",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientGrantTypes",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
GrantType = table.Column<string>(maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType });
table.ForeignKey(
name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientIdPRestrictions",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Provider = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider });
table.ForeignKey(
name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_Cl~",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientPostLogoutRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
PostLogoutRedirectUri = table.Column<string>(maxLength: 300, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri });
table.ForeignKey(
name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerCli~",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientProperties",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Key = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 2000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key });
table.ForeignKey(
name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
RedirectUri = table.Column<string>(maxLength: 300, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri });
table.ForeignKey(
name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_Clien~",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientScopes",
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Scope = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope });
table.ForeignKey(
name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerClientSecrets",
columns: table => new
{
Type = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 300, nullable: false),
ClientId = table.Column<Guid>(nullable: false),
Description = table.Column<string>(maxLength: 2000, nullable: true),
Expiration = table.Column<DateTime>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerIdentityClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
IdentityResourceId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityClaims", x => new { x.IdentityResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerIdentityClaims_IdentityServerIdentityResources~",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
{
Type = table.Column<string>(maxLength: 200, nullable: false),
ApiResourceId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiResourceId, x.Name, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiReso~",
columns: x => new { x.ApiResourceId, x.Name },
principalTable: "IdentityServerApiScopes",
principalColumns: new[] { "ApiResourceId", "Name" },
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpRoleClaims_RoleId",
table: "AbpRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_AbpRoles_NormalizedName",
table: "AbpRoles",
column: "NormalizedName");
migrationBuilder.CreateIndex(
name: "IX_AbpUserClaims_UserId",
table: "AbpUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AbpUserLogins_LoginProvider_ProviderKey",
table: "AbpUserLogins",
columns: new[] { "LoginProvider", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpUserRoles_RoleId_UserId",
table: "AbpUserRoles",
columns: new[] { "RoleId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_Email",
table: "AbpUsers",
column: "Email");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_NormalizedEmail",
table: "AbpUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_NormalizedUserName",
table: "AbpUsers",
column: "NormalizedUserName");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_UserName",
table: "AbpUsers",
column: "UserName");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClients_ClientId",
table: "IdentityServerClients",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_DeviceCode",
table: "IdentityServerDeviceFlowCodes",
column: "DeviceCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_Expiration",
table: "IdentityServerDeviceFlowCodes",
column: "Expiration");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_UserCode",
table: "IdentityServerDeviceFlowCodes",
column: "UserCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_Expiration",
table: "IdentityServerPersistedGrants",
column: "Expiration");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type",
table: "IdentityServerPersistedGrants",
columns: new[] { "SubjectId", "ClientId", "Type" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpClaimTypes");
migrationBuilder.DropTable(
name: "AbpRoleClaims");
migrationBuilder.DropTable(
name: "AbpUserClaims");
migrationBuilder.DropTable(
name: "AbpUserLogins");
migrationBuilder.DropTable(
name: "AbpUserRoles");
migrationBuilder.DropTable(
name: "AbpUserTokens");
migrationBuilder.DropTable(
name: "IdentityServerApiClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiScopeClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiSecrets");
migrationBuilder.DropTable(
name: "IdentityServerClientClaims");
migrationBuilder.DropTable(
name: "IdentityServerClientCorsOrigins");
migrationBuilder.DropTable(
name: "IdentityServerClientGrantTypes");
migrationBuilder.DropTable(
name: "IdentityServerClientIdPRestrictions");
migrationBuilder.DropTable(
name: "IdentityServerClientPostLogoutRedirectUris");
migrationBuilder.DropTable(
name: "IdentityServerClientProperties");
migrationBuilder.DropTable(
name: "IdentityServerClientRedirectUris");
migrationBuilder.DropTable(
name: "IdentityServerClientScopes");
migrationBuilder.DropTable(
name: "IdentityServerClientSecrets");
migrationBuilder.DropTable(
name: "IdentityServerDeviceFlowCodes");
migrationBuilder.DropTable(
name: "IdentityServerIdentityClaims");
migrationBuilder.DropTable(
name: "IdentityServerPersistedGrants");
migrationBuilder.DropTable(
name: "AbpRoles");
migrationBuilder.DropTable(
name: "AbpUsers");
migrationBuilder.DropTable(
name: "IdentityServerApiScopes");
migrationBuilder.DropTable(
name: "IdentityServerClients");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResources");
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
}
}
}

1426
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200606012143_Upgrade-Abp-2.9.0.Designer.cs

File diff suppressed because it is too large

199
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/20200606012143_Upgrade-Abp-2.9.0.cs

@ -0,0 +1,199 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LINGYUN.Platform.Migrations
{
public partial class UpgradeAbp290 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerClientSecrets",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldMaxLength: 4000);
migrationBuilder.AlterColumn<string>(
name: "RedirectUri",
table: "IdentityServerClientRedirectUris",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(2000) CHARACTER SET utf8mb4",
oldMaxLength: 2000);
migrationBuilder.AlterColumn<string>(
name: "PostLogoutRedirectUri",
table: "IdentityServerClientPostLogoutRedirectUris",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(2000) CHARACTER SET utf8mb4",
oldMaxLength: 2000);
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerApiSecrets",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "longtext CHARACTER SET utf8mb4",
oldMaxLength: 4000);
migrationBuilder.CreateTable(
name: "AbpOrganizationUnits",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
ParentId = table.Column<Guid>(nullable: true),
Code = table.Column<string>(maxLength: 95, nullable: false),
DisplayName = table.Column<string>(maxLength: 128, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id);
table.ForeignKey(
name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId",
column: x => x.ParentId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "AbpOrganizationUnitRoles",
columns: table => new
{
RoleId = table.Column<Guid>(nullable: false),
OrganizationUnitId = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId });
table.ForeignKey(
name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUn~",
column: x => x.OrganizationUnitId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserOrganizationUnits",
columns: table => new
{
UserId = table.Column<Guid>(nullable: false),
OrganizationUnitId = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
TenantId = table.Column<Guid>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId });
table.ForeignKey(
name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUn~",
column: x => x.OrganizationUnitId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId",
table: "AbpOrganizationUnitRoles",
columns: new[] { "RoleId", "OrganizationUnitId" });
migrationBuilder.CreateIndex(
name: "IX_AbpOrganizationUnits_Code",
table: "AbpOrganizationUnits",
column: "Code");
migrationBuilder.CreateIndex(
name: "IX_AbpOrganizationUnits_ParentId",
table: "AbpOrganizationUnits",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId",
table: "AbpUserOrganizationUnits",
columns: new[] { "UserId", "OrganizationUnitId" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpOrganizationUnitRoles");
migrationBuilder.DropTable(
name: "AbpUserOrganizationUnits");
migrationBuilder.DropTable(
name: "AbpOrganizationUnits");
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerClientSecrets",
type: "longtext CHARACTER SET utf8mb4",
maxLength: 4000,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 300);
migrationBuilder.AlterColumn<string>(
name: "RedirectUri",
table: "IdentityServerClientRedirectUris",
type: "varchar(2000) CHARACTER SET utf8mb4",
maxLength: 2000,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 300);
migrationBuilder.AlterColumn<string>(
name: "PostLogoutRedirectUri",
table: "IdentityServerClientPostLogoutRedirectUris",
type: "varchar(2000) CHARACTER SET utf8mb4",
maxLength: 2000,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 300);
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "IdentityServerApiSecrets",
type: "longtext CHARACTER SET utf8mb4",
maxLength: 4000,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 300);
}
}
}

1424
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs

File diff suppressed because it is too large

29
aspnet-core/services/start-messages.bat

@ -0,0 +1,29 @@
@echo off
cls
chcp 65001
echo. 启动消息服务
cd .\messages\LINGYUN.Abp.MessageService.HttpApi.Host
if '%1' equ '--publish' goto publish
if '%1' equ '--run' goto run
if '%1' equ '--restore' goto restore
if '%1' equ '' goto run
exit
:publish
dotnet publish -c Release -o ..\..\Publish\messages --no-cache --no-restore
copy Dockerfile ..\..\Publish\messages\Dockerfile
pause
exit
:run
dotnet run
pause
exit
:restore
dotnet restore
pause
exit

5
vueJs/src/api/clients.ts

@ -14,7 +14,8 @@ export default class ClientService {
public static getClients(payload: ClientGetByPaged) {
let _url = '/api/IdentityServer/Clients'
_url += '?sorting=' + payload.sorting
_url += '?filter=' + payload.filter
_url += '&sorting=' + payload.sorting
_url += '&skipCount=' + pagerFormat(payload.skipCount)
_url += '&maxResultCount=' + payload.maxResultCount
return ApiService.Get<PagedResultDto<Client>>(_url, serviceUrl)
@ -81,7 +82,7 @@ export default class ClientService {
}
export class ClientGetByPaged extends PagedAndSortedResultRequestDto {
filter?: string
filter = ''
}
export enum HashType {

Loading…
Cancel
Save