Browse Source

Update cli

* Added the sending test email configuration

* Added the interface for setting cache values

* Added ts script support for cli
pull/752/head
cKey 3 years ago
parent
commit
f2262fec14
  1. 24
      apps/vue/src/api/openiddict/applications/index.ts
  2. 24
      apps/vue/src/api/openiddict/authorizations/index.ts
  3. 69
      apps/vue/src/api/openiddict/tokens/index.ts
  4. 10
      apps/vue/src/api/settings/settings.ts
  5. 45
      apps/vue/src/views/sys/settings/index.vue
  6. 2
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRefreshInput.cs
  7. 12
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheSetInput.cs
  8. 2
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/ICacheAppService.cs
  9. 1
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/Localization/Resources/en.json
  10. 1
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/Localization/Resources/zh-Hans.json
  11. 1
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/Permissions/CachingManagemenPermissionDefinitionProvider.cs
  12. 1
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/Permissions/CachingManagementPermissionNames.cs
  13. 18
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application/LINGYUN/Abp/CachingManagement/CacheAppService.cs
  14. 2
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/ICacheManager.cs
  15. 13
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/ICacheManagerExtensions.cs
  16. 24
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/SetCacheRequest.cs
  17. 8
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.HttpApi/LINGYUN/Abp/CachingManagement/CacheController.cs
  18. 21
      aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs
  19. 9
      aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/AbpCliModule.cs
  20. 37
      aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/Commands/GenerateProxyCommand.cs
  21. 15
      aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/ITypeScriptProxyGenerator.cs
  22. 445
      aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptProxyGenerator.cs
  23. 124
      aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptServiceProxyGenerator.cs
  24. 2
      aspnet-core/modules/cli/LINGYUN.Abp.Cli/Properties/launchSettings.json
  25. 4
      aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/en.json
  26. 4
      aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/zh-Hans.json
  27. 7
      aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/AbpSettingManagementApplicationModule.cs
  28. 16
      aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/ISettingTestAppService.cs
  29. 13
      aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs
  30. 19
      aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/SettingController.cs
  31. 2
      aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/Properties/launchSettings.json
  32. 1774
      aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211030124247_Re-Initlize-Db-Migration.Designer.cs
  33. 1770
      aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211118035301_Remove-Field-AvatarUrl-With-IdentityUser.Designer.cs
  34. 25
      aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211118035301_Remove-Field-AvatarUrl-With-IdentityUser.cs
  35. 1775
      aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211206122741_Upgrade-Abp-To-5-0-0-RC-1.Designer.cs
  36. 26
      aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211206122741_Upgrade-Abp-To-5-0-0-RC-1.cs
  37. 938
      aspnet-core/services/LY.MicroService.AuthServer/Migrations/20220806104408_Switch-IdentityServer-to-the-OpenIddict.cs
  38. 6
      aspnet-core/services/LY.MicroService.AuthServer/Migrations/20221214082509_Add-OpenIddict-Module.Designer.cs
  39. 698
      aspnet-core/services/LY.MicroService.AuthServer/Migrations/20221214082509_Add-OpenIddict-Module.cs
  40. 2
      aspnet-core/services/LY.MicroService.AuthServer/Migrations/AuthServerMigrationsDbContextModelSnapshot.cs
  41. 2
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Properties/launchSettings.json

24
apps/vue/src/api/openiddict/applications/index.ts

@ -5,7 +5,6 @@ import {
OpenIddictApplicationUpdateDto,
OpenIddictApplicationGetListInput,
} from './model';
import { PagedResultDto } from '../../model/baseModel';
const remoteServiceName = 'AbpOpenIddict';
const controllerName = 'OpenIddictApplication';
@ -22,25 +21,16 @@ export const getById = (id: string) => {
};
export const getList = (input: OpenIddictApplicationGetListInput) => {
return defAbpHttp.get<PagedResultDto<OpenIddictApplicationDto>>({
url: '/api/openiddict/applications',
params: input,
}, {
withToken: false
return defAbpHttp.pagedRequest<OpenIddictApplicationDto>({
service: remoteServiceName,
controller: controllerName,
action: 'GetListAsync',
params: {
input: input,
},
});
};
// export const getList = (input: OpenIddictApplicationGetListInput) => {
// return defAbpHttp.pagedRequest<OpenIddictApplicationDto>({
// service: remoteServiceName,
// controller: controllerName,
// action: 'GetListAsync',
// params: {
// input: input,
// },
// });
// };
export const deleteById = (id: string) => {
return defAbpHttp.request<void>({
service: remoteServiceName,

24
apps/vue/src/api/openiddict/authorizations/index.ts

@ -3,7 +3,6 @@ import {
OpenIddictAuthorizationDto,
OpenIddictAuthorizationGetListInput,
} from './model';
import { PagedResultDto } from '../../model/baseModel';
const remoteServiceName = 'AbpOpenIddict';
const controllerName = 'OpenIddictAuthorization';
@ -19,23 +18,14 @@ export const getById = (id: string) => {
});
};
// export const getList = (input: OpenIddictAuthorizationGetListInput) => {
// return defAbpHttp.pagedRequest<OpenIddictAuthorizationDto>({
// service: remoteServiceName,
// controller: controllerName,
// action: 'GetListAsync',
// params: {
// input: input,
// },
// });
// };
export const getList = (input: OpenIddictAuthorizationGetListInput) => {
return defAbpHttp.get<PagedResultDto<OpenIddictAuthorizationDto>>({
url: '/api/openiddict/authorizations',
params: input,
}, {
withToken: false
return defAbpHttp.pagedRequest<OpenIddictAuthorizationDto>({
service: remoteServiceName,
controller: controllerName,
action: 'GetListAsync',
params: {
input: input,
},
});
};

69
apps/vue/src/api/openiddict/tokens/index.ts

@ -3,66 +3,39 @@ import {
OpenIddictTokenDto,
OpenIddictTokenGetListInput,
} from './model';
import { PagedResultDto } from '../../model/baseModel';
const remoteServiceName = 'AbpOpenIddict';
const controllerName = 'OpenIddictToken';
// export const getById = (id: string) => {
// return defAbpHttp.request<OpenIddictTokenDto>({
// service: remoteServiceName,
// controller: controllerName,
// action: 'GetAsync',
// params: {
// id: id,
// },
// });
// };
export const getById = (id: string) => {
return defAbpHttp.get<OpenIddictTokenDto>({
url: `/api/openiddict/tokens/${id}`,
}, {
withToken: false
return defAbpHttp.request<OpenIddictTokenDto>({
service: remoteServiceName,
controller: controllerName,
action: 'GetAsync',
params: {
id: id,
},
});
};
// export const getList = (input: OpenIddictTokenGetListInput) => {
// return defAbpHttp.pagedRequest<OpenIddictTokenDto>({
// service: remoteServiceName,
// controller: controllerName,
// action: 'GetListAsync',
// params: {
// input: input,
// },
// });
// };
export const getList = (input: OpenIddictTokenGetListInput) => {
return defAbpHttp.get<PagedResultDto<OpenIddictTokenDto>>({
url: '/api/openiddict/tokens',
params: input,
}, {
withToken: false
return defAbpHttp.pagedRequest<OpenIddictTokenDto>({
service: remoteServiceName,
controller: controllerName,
action: 'GetListAsync',
params: {
input: input,
},
});
};
// export const deleteById = (id: string) => {
// return defAbpHttp.request<void>({
// service: remoteServiceName,
// controller: controllerName,
// action: 'DeleteAsync',
// params: {
// id: id,
// },
// });
// };
export const deleteById = (id: string) => {
return defAbpHttp.delete<void>({
url: `/api/openiddict/tokens/${id}`,
}, {
withToken: false
return defAbpHttp.request<void>({
service: remoteServiceName,
controller: controllerName,
action: 'DeleteAsync',
params: {
id: id,
},
});
};

10
apps/vue/src/api/settings/settings.ts

@ -8,6 +8,7 @@ enum Api {
SetCurrentTenantSettings = '/api/setting-management/settings/change-current-tenant',
GetCurrentUserSettings = '/api/setting-management/settings/by-current-user',
SetCurrentUserSettings = '/api/setting-management/settings/change-current-user',
SendTestEmail = '/api/setting-management/settings/send-test-email'
}
export const getGlobalSettings = () => {
@ -48,3 +49,12 @@ export const setCurrentUserSettings = (payload: SettingsUpdate) => {
url: Api.SetCurrentUserSettings,
});
};
export const sendTestEmail = (emailAddress: string) => {
return defHttp.post({
data: {
emailAddress: emailAddress
},
url: Api.SendTestEmail,
});
}

45
apps/vue/src/views/sys/settings/index.vue

@ -1,10 +1,27 @@
<template>
<SettingForm :save-api="settingFormRef.saveApi" :setting-groups="group" />
<SettingForm :save-api="settingFormRef.saveApi" :setting-groups="group">
<template #send-test-email="{ detail }">
<FormItem name="testEmail" :label="detail.displayName" :extra="detail.description">
<SearchInput
:placeholder="L('TargetEmailAddress')"
v-model:value="detail.value"
@search="handleSendTestEmail(detail.value)"
:loading="sendingEmail"
>
<template #enterButton>
<Button type="primary">{{ L('Send') }}</Button>
</template>
</SearchInput>
</FormItem>
</template>
</SettingForm>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { Button, Form, Input } from 'ant-design-vue';
import { useAbpStoreWithOut } from '/@/store/modules/abp';
import { useMessage } from '/@/hooks/web/useMessage';
import { useLocalization } from '/@/hooks/abp/useLocalization';
import { SettingForm } from '/@/components/SettingManagement';
import { SettingGroup } from '/@/api/settings/model/settingModel';
import {
@ -12,7 +29,9 @@
getGlobalSettings,
setGlobalSettings,
setCurrentTenantSettings,
sendTestEmail,
} from '/@/api/settings/settings';
import { isEmail } from '/@/utils/is';
interface ISettingForm {
providerName: string;
@ -20,6 +39,10 @@
saveApi: (...args: any) => Promise<any>;
}
const FormItem = Form.Item;
const SearchInput = Input.Search;
const sendingEmail = ref(false);
const group = ref<SettingGroup[]>([]);
const settingFormRef = ref<ISettingForm>({
providerName: 'G',
@ -27,6 +50,8 @@
saveApi: setGlobalSettings,
});
const abpStore = useAbpStoreWithOut();
const { createWarningModal, createMessage } = useMessage();
const { L } = useLocalization(['AbpSettingManagement']);
onMounted(() => {
if (abpStore.getApplication.currentTenant.id) {
@ -44,4 +69,20 @@
});
}
});
function handleSendTestEmail(emailAddress: string) {
if (!isEmail(emailAddress)) {
createWarningModal({
title: L('ValidationErrorMessage'),
content: L('ThisFieldIsNotAValidEmailAddress.')
});
return;
}
sendingEmail.value = true;
sendTestEmail(emailAddress).then(() => {
createMessage.success(L('SuccessfullySent'));
}).finally(() => {
sendingEmail.value = false;
});
}
</script>

2
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRefreshInput.cs

@ -1,9 +1,11 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.CachingManagement;
public class CacheRefreshInput
{
[Required]
public string Key { get; set; }
public DateTime? AbsoluteExpiration { get; set; }
public DateTime? SlidingExpiration { get; set; }

12
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheSetInput.cs

@ -0,0 +1,12 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.CachingManagement;
public class CacheSetInput
{
[Required]
public string Key { get; set; }
public string Value { get; set; }
public DateTime? AbsoluteExpiration { get; set; }
public DateTime? SlidingExpiration { get; set; }
}

2
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/ICacheAppService.cs

@ -9,6 +9,8 @@ public interface ICacheAppService : IApplicationService
Task<CacheValueDto> GetValueAsync(CacheKeyInput input);
Task SetAsync(CacheSetInput input);
Task RefreshAsync(CacheRefreshInput input);
Task RemoveAsync(CacheKeyInput input);

1
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/Localization/Resources/en.json

@ -5,6 +5,7 @@
"Permission:Caches": "Manager Cache",
"Permission:Refresh": "Refresh",
"Permission:Delete": "Delete",
"Permission:ManageValue": "Manage Value",
"Caches": "Caches",
"CacheInfo": "Cache Info",
"DisplayName:Marker": "Marker",

1
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/Localization/Resources/zh-Hans.json

@ -5,6 +5,7 @@
"Permission:Caches": "管理缓存",
"Permission:Refresh": "刷新",
"Permission:Delete": "删除",
"Permission:ManageValue": "管理值",
"Caches": "缓存列表",
"CacheInfo": "缓存详情",
"DisplayName:Marker": "标记",

1
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/Permissions/CachingManagemenPermissionDefinitionProvider.cs

@ -11,6 +11,7 @@ public class CachingManagemenPermissionDefinitionProvider : PermissionDefinition
var cachingManagerGroup = context.AddGroup(CachingManagementPermissionNames.GroupName, L("Permission:CachingManagement"));
var cacheGroup = cachingManagerGroup.AddPermission(CachingManagementPermissionNames.Cache.Default, L("Permission:Caches"));
cacheGroup.AddChild(CachingManagementPermissionNames.Cache.ManageValue, L("Permission:ManageValue"));
cacheGroup.AddChild(CachingManagementPermissionNames.Cache.Refresh, L("Permission:Refresh"));
cacheGroup.AddChild(CachingManagementPermissionNames.Cache.Delete, L("Permission:Delete"));
}

1
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/Permissions/CachingManagementPermissionNames.cs

@ -11,6 +11,7 @@ public static class CachingManagementPermissionNames
public const string Default = GroupName + ".Cache";
public const string Refresh = Default + ".Refresh";
public const string Delete = Default + ".Delete";
public const string ManageValue = Default + ".ManageValue";
}
public static string[] GetAll()

18
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Application/LINGYUN/Abp/CachingManagement/CacheAppService.cs

@ -52,6 +52,24 @@ public class CacheAppService : ApplicationService, ICacheAppService
return value;
}
[Authorize(CachingManagementPermissionNames.Cache.ManageValue)]
public async virtual Task SetAsync(CacheSetInput input)
{
TimeSpan? absExpir = null;
TimeSpan? sldExpr = null;
if (input.AbsoluteExpiration.HasValue && input.AbsoluteExpiration.Value > Clock.Now)
{
absExpir = input.AbsoluteExpiration.Value - Clock.Now;
}
if (input.SlidingExpiration.HasValue && input.SlidingExpiration.Value > Clock.Now)
{
sldExpr = input.SlidingExpiration.Value - Clock.Now;
}
await CacheManager.SetAsync(input.Key, input.Value, absExpir, sldExpr);
}
[Authorize(CachingManagementPermissionNames.Cache.Refresh)]
public async virtual Task RefreshAsync(CacheRefreshInput input)
{

2
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/ICacheManager.cs

@ -10,6 +10,8 @@ public interface ICacheManager
Task<CacheValueResponse> GetValueAsync(string key, CancellationToken cancellationToken = default);
Task SetAsync(SetCacheRequest request, CancellationToken cancellationToken = default);
Task RefreshAsync(RefreshCacheRequest request, CancellationToken cancellationToken = default);
Task RemoveAsync(string key, CancellationToken cancellationToken = default);

13
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/ICacheManagerExtensions.cs

@ -18,6 +18,19 @@ public static class ICacheManagerExtensions
cancellationToken);
}
public static Task SetAsync(
this ICacheManager cacheManager,
string key,
string value,
TimeSpan? absExpr = null,
TimeSpan? sldExpr = null,
CancellationToken cancellationToken = default)
{
return cacheManager.SetAsync(
new SetCacheRequest(key, value, absExpr, sldExpr),
cancellationToken);
}
public static Task RefreshAsync(
this ICacheManager cacheManager,
string key,

24
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/SetCacheRequest.cs

@ -0,0 +1,24 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.CachingManagement;
public class SetCacheRequest
{
[Required]
public string Key { get; }
[Required]
public string Value { get; }
public TimeSpan? AbsoluteExpiration { get; }
public TimeSpan? SlidingExpiration { get; }
public SetCacheRequest(
string key,
string value,
TimeSpan? absoluteExpiration = null,
TimeSpan? slidingExpiration = null)
{
Key = key;
Value = value;
AbsoluteExpiration = absoluteExpiration;
SlidingExpiration = slidingExpiration;
}
}

8
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.HttpApi/LINGYUN/Abp/CachingManagement/CacheController.cs

@ -38,6 +38,14 @@ public class CacheController : AbpControllerBase, ICacheAppService
return CacheAppService.GetValueAsync(input);
}
[HttpPut]
[Route("set")]
[Authorize(CachingManagementPermissionNames.Cache.ManageValue)]
public virtual Task SetAsync(CacheSetInput input)
{
return CacheAppService.SetAsync(input);
}
[HttpPut]
[Route("refresh")]
[Authorize(CachingManagementPermissionNames.Cache.Refresh)]

21
aspnet-core/modules/caching/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs

@ -1,10 +1,12 @@
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.StackExchangeRedis;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp;
@ -170,6 +172,25 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc
ttl);
}
public async virtual Task SetAsync(SetCacheRequest request, CancellationToken cancellationToken = default)
{
var cacheKey = request.Key;
if (!RedisCacheOptions.InstanceName.IsNullOrWhiteSpace() && cacheKey.StartsWith(RedisCacheOptions.InstanceName))
{
cacheKey = cacheKey.Substring(RedisCacheOptions.InstanceName.Length);
}
await RedisCache.SetAsync(
cacheKey,
Encoding.UTF8.GetBytes(request.Value),
new DistributedCacheEntryOptions
{
SlidingExpiration = request.SlidingExpiration,
AbsoluteExpirationRelativeToNow = request.AbsoluteExpiration,
},
cancellationToken);
}
public async virtual Task RefreshAsync(RefreshCacheRequest request, CancellationToken cancellationToken = default)
{
var cacheKey = request.Key;

9
aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/AbpCliModule.cs

@ -1,6 +1,9 @@
using LINGYUN.Abp.Cli.Commands;
using LINGYUN.Abp.Cli.ServiceProxying.CSharp;
using LINGYUN.Abp.Cli.ServiceProxying.TypeScript;
using Volo.Abp.Autofac;
using Volo.Abp.Cli;
using Volo.Abp.Cli.ServiceProxying;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Cli
@ -20,6 +23,12 @@ namespace LINGYUN.Abp.Cli
options.Commands[CreateCommand.Name] = typeof(CreateCommand);
options.Commands[GenerateProxyCommand.Name] = typeof(GenerateProxyCommand);
});
Configure<AbpCliServiceProxyOptions>(options =>
{
options.Generators[TypeScriptServiceProxyGenerator.Name] = typeof(TypeScriptServiceProxyGenerator);
options.Generators[CSharpServiceProxyGenerator.Name] = typeof(CSharpServiceProxyGenerator);
});
}
}
}

37
aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/Commands/GenerateProxyCommand.cs

@ -1,13 +1,16 @@
using LINGYUN.Abp.Cli.ServiceProxying;
using LINGYUN.Abp.Cli.ServiceProxying.CSharp;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Cli;
using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.Commands;
using Volo.Abp.DependencyInjection;
using AbpCliServiceProxyOptions = Volo.Abp.Cli.ServiceProxying.AbpCliServiceProxyOptions;
using IServiceProxyGenerator = Volo.Abp.Cli.ServiceProxying.IServiceProxyGenerator;
using VoloGenerateProxyArgs = Volo.Abp.Cli.ServiceProxying.GenerateProxyArgs;
namespace LINGYUN.Abp.Cli.Commands;
@ -18,23 +21,35 @@ public class GenerateProxyCommand : IConsoleCommand, ITransientDependency
protected string CommandName => Name;
protected AbpCliServiceProxyOptions ServiceProxyOptions { get; }
protected IServiceScopeFactory ServiceScopeFactory { get; }
public GenerateProxyCommand(
IOptions<AbpCliServiceProxyOptions> serviceProxyOptions,
IServiceScopeFactory serviceScopeFactory)
{
ServiceScopeFactory = serviceScopeFactory;
ServiceProxyOptions = serviceProxyOptions.Value;
}
public async Task ExecuteAsync(CommandLineArgs commandLineArgs)
{
using (var scope = ServiceScopeFactory.CreateScope())
var generateType = commandLineArgs.Options.GetOrNull(Options.GenerateType.Short, Options.GenerateType.Long)?.ToUpper();
if (!ServiceProxyOptions.Generators.ContainsKey(generateType))
{
var serviceProxyGenerator = scope.ServiceProvider.GetRequiredService<CSharpServiceProxyGenerator>();
throw new CliUsageException("Option Type value is invalid" +
Environment.NewLine +
GetUsageInfo());
}
using var scope = ServiceScopeFactory.CreateScope();
var generatorType = ServiceProxyOptions.Generators[generateType];
var serviceProxyGenerator = scope.ServiceProvider.GetService(generatorType).As<IServiceProxyGenerator>();
await serviceProxyGenerator.GenerateProxyAsync(BuildArgs(commandLineArgs));
}
}
private VoloGenerateProxyArgs BuildArgs(CommandLineArgs commandLineArgs)
{
@ -65,6 +80,11 @@ public class GenerateProxyCommand : IConsoleCommand, ITransientDependency
sb.AppendLine("-m|--module <module-name> (default: 'app') The name of the backend module you wish to generate proxies for.");
sb.AppendLine("-wd|--working-directory <directory-path> Execution directory.");
sb.AppendLine("-u|--url <url> API definition URL from.");
sb.AppendLine("-t|--type <generate-type> The name of generate type (csharp, ts).");
sb.AppendLine(" csharp");
sb.AppendLine(" --folder <folder-name> (default: 'ClientProxies') Folder name to place generated CSharp code in.");
sb.AppendLine(" ts");
sb.AppendLine(" -o|--output <output-name> TypeScript file path or folder to place generated code in.");
sb.AppendLine("-p|--provider <client-proxy-provider> The client proxy provider(http, dapr).");
sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI");
@ -75,6 +95,7 @@ public class GenerateProxyCommand : IConsoleCommand, ITransientDependency
sb.AppendLine(" labp generate-proxy -p dapr");
sb.AppendLine(" labp generate-proxy -m identity -o Pages/Identity/client-proxies.js -url https://localhost:44302/");
sb.AppendLine(" labp generate-proxy --folder MyProxies/InnerFolder -url https://localhost:44302/");
sb.AppendLine(" labp generate-proxy -t ts -m identity -o api/identity -url https://localhost:44302/ ");
return sb.ToString();
}
@ -86,6 +107,12 @@ public class GenerateProxyCommand : IConsoleCommand, ITransientDependency
public static class Options
{
public static class GenerateType
{
public const string Short = "t";
public const string Long = "type";
}
public static class Provider
{
public const string Short = "p";

15
aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/ITypeScriptProxyGenerator.cs

@ -0,0 +1,15 @@
using Volo.Abp.Http.Modeling;
namespace LINGYUN.Abp.Cli.ServiceProxying.TypeScript;
public interface ITypeScriptProxyGenerator
{
string CreateModelScript(
ApplicationApiDescriptionModel appModel,
ControllerApiDescriptionModel actionModel);
string CreateScript(
ApplicationApiDescriptionModel appModel,
ModuleApiDescriptionModel apiModel,
ControllerApiDescriptionModel actionModel);
}

445
aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptProxyGenerator.cs

@ -0,0 +1,445 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Modeling;
using Volo.Abp.ObjectExtending;
namespace LINGYUN.Abp.Cli.ServiceProxying.TypeScript;
public class TypeScriptProxyGenerator : ITypeScriptProxyGenerator, ITransientDependency
{
protected static string[] AbpBaseTypes = new string[]
{
typeof(ExtensibleObject).FullName,
"Volo.Abp.Application.Dtos.AuditedEntityDto",
"Volo.Abp.Application.Dtos.AuditedEntityWithUserDto",
"Volo.Abp.Application.Dtos.CreationAuditedEntityDto",
"Volo.Abp.Application.Dtos.CreationAuditedEntityWithUserDto",
"Volo.Abp.Application.Dtos.EntityDto",
"Volo.Abp.Application.Dtos.ExtensibleAuditedEntityDto",
"Volo.Abp.Application.Dtos.ExtensibleAuditedEntityWithUserDto",
"Volo.Abp.Application.Dtos.ExtensibleCreationAuditedEntityDto",
"Volo.Abp.Application.Dtos.ExtensibleCreationAuditedEntityWithUserDto",
"Volo.Abp.Application.Dtos.ExtensibleEntityDto",
"Volo.Abp.Application.Dtos.ExtensibleFullAuditedEntityDto",
"Volo.Abp.Application.Dtos.ExtensibleFullAuditedEntityWithUserDto",
"Volo.Abp.Application.Dtos.FullAuditedEntityDto",
"Volo.Abp.Application.Dtos.FullAuditedEntityWithUserDto",
"Volo.Abp.Application.Dtos.LimitedResultRequestDto",
"Volo.Abp.Application.Dtos.ListResultDto",
"Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto",
"Volo.Abp.Application.Dtos.PagedResultDto",
"Volo.Abp.Application.Dtos.PagedResultRequestDto",
};
protected static string[] DataInParamMethods = new string[]
{
"GET",
"DELETE"
};
public ILogger<TypeScriptProxyGenerator> Logger { protected get; set; }
public TypeScriptProxyGenerator()
{
Logger = NullLogger<TypeScriptProxyGenerator>.Instance;
}
public string CreateModelScript(ApplicationApiDescriptionModel appModel, ControllerApiDescriptionModel actionModel)
{
var modelScriptBuilder = new StringBuilder();
var modelBaseTypes = new List<string>();
var modelTypes = new List<string>();
foreach (var action in actionModel.Actions)
{
foreach (var paramter in action.Value.Parameters)
{
if (appModel.Types.TryGetValue(paramter.Type, out var modelType))
{
var modelTypeName = paramter.Type[(paramter.Type.LastIndexOf('.') + 1)..];
if (!modelTypes.Contains(modelTypeName))
{
Logger.LogInformation($" Generating model: {modelTypeName} script.");
modelScriptBuilder.AppendLine(CreateModel(modelTypeName, modelType));
Logger.LogInformation($" Model: {modelTypeName} generate successful.");
modelTypes.AddIfNotContains(modelTypeName);
}
// 字段类型
foreach (var propertity in modelType.Properties)
{
modelBaseTypes.AddIfNotContains(FindBaseTypes(appModel, propertity));
}
// 类型基类
modelBaseTypes.AddIfNotContains(FindBaseTypes(appModel, modelType));
}
}
foreach (var paramter in action.Value.ParametersOnMethod)
{
if (appModel.Types.TryGetValue(paramter.Type, out var modelType))
{
var modelTypeName = paramter.Type[(paramter.Type.LastIndexOf('.') + 1)..];
if (!modelTypes.Contains(modelTypeName))
{
Logger.LogInformation($" Generating model: {modelTypeName} script.");
modelScriptBuilder.AppendLine(CreateModel(modelTypeName, modelType));
Logger.LogInformation($" Model: {modelTypeName} generate successful.");
modelTypes.AddIfNotContains(modelTypeName);
}
// 字段类型
foreach (var propertity in modelType.Properties)
{
modelBaseTypes.AddIfNotContains(FindBaseTypes(appModel, propertity));
}
// 类型基类
modelBaseTypes.AddIfNotContains(FindBaseTypes(appModel, modelType));
}
}
// 返回类型
var returnType = action.Value.ReturnValue.TypeSimple;
var abpBaseType = AbpBaseTypes.FirstOrDefault(basType => returnType.StartsWith(basType));
if (!abpBaseType.IsNullOrWhiteSpace())
{
returnType = returnType
.Replace(abpBaseType, "")
.Replace("<", "")
.Replace(">", "");
}
returnType = ReplaceTypeSimple(returnType);
if (appModel.Types.TryGetValue(returnType, out var returnBaseType))
{
foreach (var propertity in returnBaseType.Properties)
{
var propType = propertity.TypeSimple;
if (propertity.TypeSimple.StartsWith("[") && propertity.TypeSimple.EndsWith("]"))
{
propType = propType.ReplaceFirst("[", "").RemovePostFix("]", "");
}
if (appModel.Types.TryGetValue(propType, out var propBaseType))
{
modelBaseTypes.AddIfNotContains(propType);
modelBaseTypes.AddIfNotContains(FindBaseTypes(appModel, propBaseType));
}
}
}
modelBaseTypes.AddIfNotContains(returnType);
}
// 基类导出
foreach (var baseType in modelBaseTypes)
{
if (appModel.Types.TryGetValue(baseType, out var modelType))
{
var modelTypeName = baseType[(baseType.LastIndexOf('.') + 1)..];
Logger.LogInformation($" Generating base model: {modelTypeName} script.");
modelScriptBuilder.AppendLine(CreateModel(modelTypeName, modelType));
Logger.LogInformation($" The base model: {modelTypeName} generate successful.");
}
}
return modelScriptBuilder.ToString();
}
public string CreateScript(
ApplicationApiDescriptionModel appModel,
ModuleApiDescriptionModel apiModel,
ControllerApiDescriptionModel actionModel)
{
var apiScriptBuilder = new StringBuilder();
apiScriptBuilder.AppendLine("import { defAbpHttp } from '/@/utils/http/abp';");
var importModel = "";
foreach (var action in actionModel.Actions)
{
foreach (var paramter in action.Value.ParametersOnMethod)
{
if (appModel.Types.TryGetValue(paramter.Type, out var _))
{
var modelTypeName = paramter.Type[(paramter.Type.LastIndexOf('.') + 1)..];
if (!importModel.Contains(modelTypeName))
{
importModel += modelTypeName + ", ";
}
}
}
var returnType = action.Value.ReturnValue.TypeSimple;
if (!returnType.StartsWith("System"))
{
var abpBaseType = AbpBaseTypes.FirstOrDefault(basType => returnType.StartsWith(basType));
if (!abpBaseType.IsNullOrWhiteSpace())
{
returnType = returnType
.Replace(abpBaseType, "")
.Replace("<", "")
.Replace(">", "");
}
returnType = ReplaceTypeSimple(returnType);
returnType = returnType[(returnType.LastIndexOf('.') + 1)..];
if (!importModel.Contains(returnType))
{
importModel += returnType + ",";
}
}
}
importModel = importModel.RemovePostFix(",");
apiScriptBuilder.AppendLine("import { " + importModel + " } from './model';");
apiScriptBuilder.AppendLine("");
apiScriptBuilder.AppendFormat("const remoteServiceName = '{0}';", apiModel.RemoteServiceName);
apiScriptBuilder.AppendLine("");
apiScriptBuilder.AppendFormat("const controllerName = '{0}';", actionModel.ControllerName);
apiScriptBuilder.AppendLine("");
apiScriptBuilder.AppendLine("");
foreach (var action in actionModel.Actions)
{
apiScriptBuilder.AppendFormat("export const {0} = (", action.Value.UniqueName);
for (var index = 0; index < action.Value.ParametersOnMethod.Count; index++)
{
var paramter = action.Value.ParametersOnMethod[index];
var apiParamCharacter = paramter.IsOptional ? "?:" : ":";
var apiParamName = paramter.TypeSimple;
apiParamName = apiParamName[(apiParamName.LastIndexOf('.') + 1)..];
apiScriptBuilder.AppendFormat("{0}{1} {2}", paramter.Name, apiParamCharacter, apiParamName);
if (index < action.Value.ParametersOnMethod.Count - 1)
{
apiScriptBuilder.Append(", ");
}
}
apiScriptBuilder.AppendLine(") => {");
var apiRequestName = "request";
var apiRetuanName = action.Value.ReturnValue.TypeSimple;
if (apiRetuanName.Contains("ListResultDto"))
{
apiRequestName = "listRequest";
apiRetuanName = apiRetuanName[(apiRetuanName.IndexOf("<") + 1)..];
apiRetuanName = apiRetuanName[..^1];
}
else if (apiRetuanName.Contains("PagedResultDto"))
{
apiRequestName = "pagedRequest";
apiRetuanName = apiRetuanName[(apiRetuanName.IndexOf("<") + 1)..];
apiRetuanName = apiRetuanName[..^1];
}
apiRetuanName = apiRetuanName[(apiRetuanName.LastIndexOf('.') + 1)..];
if (action.Value.ReturnValue.TypeSimple.Contains("System."))
{
apiRetuanName = apiRetuanName.ToLower();
}
apiScriptBuilder.AppendFormat(" return defAbpHttp.{0}<{1}>(", apiRequestName, apiRetuanName);
apiScriptBuilder.AppendLine("{");
apiScriptBuilder.AppendLine(" service: remoteServiceName,");
apiScriptBuilder.AppendLine(" controller: controllerName,");
apiScriptBuilder.AppendFormat(" action: '{0}',", action.Value.Name);
apiScriptBuilder.AppendLine("");
if (DataInParamMethods.Contains(action.Value.HttpMethod))
{
if (action.Value.ParametersOnMethod.Any())
{
apiScriptBuilder.AppendLine(" params: {");
foreach (var paramter in action.Value.ParametersOnMethod)
{
apiScriptBuilder.AppendFormat(" {0}: {1},", paramter.Name, paramter.Name);
apiScriptBuilder.AppendLine("");
}
apiScriptBuilder.AppendLine(" },");
}
}
else
{
var inPathParams = action.Value.Parameters.Where(p => p.BindingSourceId == "Path");
var inBodyParams = action.Value.Parameters.Where(p => p.BindingSourceId == "Body");
if (inPathParams.Any())
{
apiScriptBuilder.AppendLine(" params: {");
foreach (var paramter in inPathParams)
{
apiScriptBuilder.AppendFormat(" {0}: {1},", paramter.Name, paramter.Name);
apiScriptBuilder.AppendLine("");
}
apiScriptBuilder.AppendLine(" },");
}
if (inBodyParams.Any() &&
inBodyParams.Count() == 1)
{
apiScriptBuilder.AppendFormat(" data: {0},", inBodyParams.First().NameOnMethod);
apiScriptBuilder.AppendLine("");
}
else
{
apiScriptBuilder.AppendLine(" data: {");
foreach (var paramter in inBodyParams)
{
apiScriptBuilder.AppendFormat(" {0}: {1},", paramter.Name, paramter.Name);
apiScriptBuilder.AppendLine("");
}
apiScriptBuilder.AppendLine(" },");
}
}
apiScriptBuilder.AppendLine(" });");
apiScriptBuilder.AppendLine("};");
apiScriptBuilder.AppendLine("");
}
return apiScriptBuilder.ToString();
}
protected virtual string CreateModel(
string modelName,
TypeApiDescriptionModel model)
{
var modelBuilder = new StringBuilder();
if (model.IsEnum)
{
modelBuilder.AppendLine($"export enum {modelName} {{");
for (var index = 0; index < model.EnumNames.Length; index++)
{
modelBuilder.AppendFormat(" {0} = {1},", model.EnumNames[index], model.EnumValues[index]);
modelBuilder.AppendLine();
}
modelBuilder.AppendLine("}");
}
else
{
modelBuilder.AppendFormat("export interface {0} ", modelName);
if (!model.BaseType.IsNullOrWhiteSpace())
{
var baseType = ReplaceAbpBaseType(model.BaseType);
baseType = ReplaceTypeSimple(baseType);
modelBuilder.AppendFormat("extends {0} ", baseType[(baseType.LastIndexOf('.') + 1)..]);
}
modelBuilder.AppendLine("{");
for (var index = 0; index < model.Properties.Length; index++)
{
modelBuilder.AppendFormat(" {0}", model.Properties[index].Name.ToCamelCase());
var propCharacter = model.Properties[index].IsRequired ? ": " : "?: ";
var propTypeName = ReplaceTypeSimple(model.Properties[index].TypeSimple);
if (propTypeName.LastIndexOf('.') >= 0)
{
propTypeName = propTypeName[(propTypeName.LastIndexOf('.') + 1)..];
}
modelBuilder.AppendFormat("{0}{1};", propCharacter, ReplaceTypeSimple(propTypeName));
modelBuilder.AppendLine("");
}
modelBuilder.AppendLine("}");
}
return modelBuilder.ToString();
}
protected virtual List<string> FindBaseTypes(ApplicationApiDescriptionModel apiModel, TypeApiDescriptionModel model)
{
var types = new List<string>();
if (!model.BaseType.IsNullOrWhiteSpace() &&
!AbpBaseTypes.Contains(model.BaseType) &&
apiModel.Types.TryGetValue(model.BaseType, out var baseType))
{
types.Add(model.BaseType);
types.AddRange(FindBaseTypes(apiModel, baseType));
}
return types;
}
protected virtual List<string> FindBaseTypes(ApplicationApiDescriptionModel apiModel, PropertyApiDescriptionModel model)
{
var types = new List<string>();
var propertityType = ReplaceTypeSimple(model.TypeSimple);
if (!AbpBaseTypes.Contains(propertityType) &&
apiModel.Types.TryGetValue(propertityType, out var baseType))
{
types.Add(propertityType);
types.AddRange(FindBaseTypes(apiModel, baseType));
}
return types;
}
protected virtual string ReplaceTypeSimple(string typeSimple)
{
typeSimple = typeSimple
.Replace("?", "")
.Replace("<System.String>", "<string>")
.Replace("<System.Guid>", "<string>")
.Replace("<System.Int32>", "<number>")
.Replace("<System.Int64>", "<number>")
.Replace("{string:string}", "Dictionary<string, string>")
.Replace("{number:string}", "Dictionary<number, string>")
.Replace("{string:number}", "Dictionary<string, number>")
.Replace("{string:object}", "Dictionary<string, any>");
if (typeSimple.StartsWith("[") && typeSimple.EndsWith("]"))
{
typeSimple = typeSimple.ReplaceFirst("[", "").RemovePostFix("]", "");
typeSimple = typeSimple.Replace(typeSimple, $"{typeSimple}[]");
}
return typeSimple;
}
protected virtual string ReplaceAbpBaseType(string typeSimple)
{
var abpBaseType = AbpBaseTypes.FirstOrDefault(t => t.StartsWith(typeSimple));
if (abpBaseType.IsNullOrWhiteSpace())
{
return typeSimple;
}
return abpBaseType[(abpBaseType.LastIndexOf('.') + 1)..];
}
}

124
aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptServiceProxyGenerator.cs

@ -0,0 +1,124 @@
using Microsoft.Extensions.Logging;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Cli;
using Volo.Abp.Cli.Http;
using Volo.Abp.Cli.ServiceProxying;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Modeling;
using Volo.Abp.IO;
using Volo.Abp.Json;
namespace LINGYUN.Abp.Cli.ServiceProxying.TypeScript;
public class TypeScriptServiceProxyGenerator : ServiceProxyGeneratorBase<TypeScriptServiceProxyGenerator>, ITransientDependency
{
public const string Name = "TS";
private readonly ITypeScriptProxyGenerator _typeScriptProxyGenerator;
public TypeScriptServiceProxyGenerator(
CliHttpClientFactory cliHttpClientFactory,
IJsonSerializer jsonSerializer,
ITypeScriptProxyGenerator typeScriptProxyGenerator)
: base(cliHttpClientFactory, jsonSerializer)
{
_typeScriptProxyGenerator = typeScriptProxyGenerator;
}
public async override Task GenerateProxyAsync(Volo.Abp.Cli.ServiceProxying.GenerateProxyArgs args)
{
var applicationApiDescriptionModel = await GetApplicationApiDescriptionModelAsync(args);
var outputFolderRoot = args.Output;
foreach (var module in applicationApiDescriptionModel.Modules)
{
Logger.LogInformation($"Generating model script with remote service: {module.Value.RemoteServiceName}.");
foreach (var controller in module.Value.Controllers)
{
Logger.LogInformation($" [{module.Value.RemoteServiceName}], Generating model script with controller: {controller.Value.ControllerName}.");
var modelScript = _typeScriptProxyGenerator
.CreateModelScript(applicationApiDescriptionModel, controller.Value);
Logger.LogInformation($" [{module.Value.RemoteServiceName}], {controller.Value.ControllerName} model script generated.");
var modelScriptPath = Path.Combine(
outputFolderRoot,
module.Value.RemoteServiceName.ToKebabCase(),
controller.Value.ControllerGroupName.ToKebabCase(),
"model");
DirectoryHelper.CreateIfNotExists(modelScriptPath);
var modelScriptFile = Path.Combine(modelScriptPath, "index.ts");
Logger.LogInformation($"The model script output file: {modelScriptFile}.");
Logger.LogInformation($"Saving model script: {modelScriptFile}.");
FileHelper.DeleteIfExists(modelScriptFile);
await File.AppendAllTextAsync(modelScriptFile, modelScript);
Logger.LogInformation($"Saved model script: {modelScriptFile} has successful.");
// api script
Logger.LogInformation($" [{module.Value.RemoteServiceName}], Generating api script with controller: {controller.Value.ControllerName}.");
var apiScript = _typeScriptProxyGenerator.CreateScript(
applicationApiDescriptionModel,
module.Value,
controller.Value);
Logger.LogInformation($" [{module.Value.RemoteServiceName}], {controller.Value.ControllerName} api script generated.");
var apiScriptPath = Path.Combine(
outputFolderRoot,
module.Value.RemoteServiceName.ToKebabCase(),
controller.Value.ControllerGroupName.ToKebabCase());
DirectoryHelper.CreateIfNotExists(apiScriptPath);
var apiScriptFile = Path.Combine(apiScriptPath, "index.ts");
Logger.LogInformation($"The api script output file: {apiScriptFile}.");
Logger.LogInformation($"Saving api script: {apiScriptFile}.");
FileHelper.DeleteIfExists(apiScriptFile);
await File.AppendAllTextAsync(apiScriptFile, apiScript);
Logger.LogInformation($"Saved api script: {apiScriptFile} has successful.");
}
}
Logger.LogInformation($"Generate type script proxy has completed.");
}
protected async override Task<ApplicationApiDescriptionModel> GetApplicationApiDescriptionModelAsync(Volo.Abp.Cli.ServiceProxying.GenerateProxyArgs args)
{
Check.NotNull(args.Url, nameof(args.Url));
var client = CliHttpClientFactory.CreateClient();
var url = CliUrls.GetApiDefinitionUrl(args.Url);
var apiDefinitionResult = await client.GetStringAsync(url + "?includeTypes=true");
var apiDefinition = JsonSerializer.Deserialize<ApplicationApiDescriptionModel>(apiDefinitionResult);
var moduleDefinition = apiDefinition.Modules.FirstOrDefault(x => string.Equals(x.Key, args.Module, StringComparison.CurrentCultureIgnoreCase)).Value;
if (moduleDefinition == null)
{
throw new CliUsageException($"Module name: {args.Module} is invalid");
}
var apiDescriptionModel = ApplicationApiDescriptionModel.Create();
apiDescriptionModel.AddModule(moduleDefinition);
apiDescriptionModel.Types = apiDefinition.Types;
return apiDescriptionModel;
}
}

2
aspnet-core/modules/cli/LINGYUN.Abp.Cli/Properties/launchSettings.json

@ -2,7 +2,7 @@
"profiles": {
"LINGYUN.Abp.Cli": {
"commandName": "Project",
"commandLineArgs": "help create"
"commandLineArgs": "generate-proxy -t ts -u http://10.21.15.28:30045 -m webhooks-management -o D:\\Projects\\Development\\type-script"
}
}
}

4
aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/en.json

@ -43,6 +43,8 @@
"Description:FileManagement": "File Management",
"DisplayName:FileManagement.FileSystem": "File System",
"Description:FileManagement.FileSystem": "File System",
"TenantCannotChangeGlobalSetting": "Tenant cannot change the global settings"
"TenantCannotChangeGlobalSetting": "Tenant cannot change the global settings",
"SendTestEmail:Subject": "This is a test email",
"SendTestEmail:Body": "<h3>If you have received this email, then your mail configuration is working normally.</h3><br /><h3>System mail Do not reply</h3>"
}
}

4
aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/zh-Hans.json

@ -43,6 +43,8 @@
"Description:FileManagement": "文件管理",
"DisplayName:FileManagement.FileSystem": "文件系统",
"Description:FileManagement.FileSystem": "文件系统",
"TenantCannotChangeGlobalSetting": "租户不能变更公共配置"
"TenantCannotChangeGlobalSetting": "租户不能变更公共配置",
"SendTestEmail:Subject": "这是一封测试邮件",
"SendTestEmail:Body": "<h3>如果您收到了这封邮件,那么您的邮件配置可以正常使用.</h3><br /><h3>系统邮件请勿回复</h3>"
}
}

7
aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/AbpSettingManagementApplicationModule.cs

@ -1,4 +1,5 @@
using Volo.Abp.Application;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Application;
using Volo.Abp.Modularity;
using Volo.Abp.SettingManagement;
@ -11,5 +12,9 @@ namespace LINGYUN.Abp.SettingManagement
)]
public class AbpSettingManagementApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddScoped<ISettingTestAppService, SettingAppService>();
}
}
}

16
aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/ISettingTestAppService.cs

@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
namespace LINGYUN.Abp.SettingManagement;
public interface ISettingTestAppService
{
Task SendTestEmailAsync(SendTestEmailInput input);
}
public class SendTestEmailInput
{
[Required]
[EmailAddress]
public string EmailAddress { get; set; }
}

13
aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs

@ -22,7 +22,7 @@ using Volo.Abp.Users;
namespace LINGYUN.Abp.SettingManagement
{
[Authorize(AbpSettingManagementPermissions.Settings.Default)]
public class SettingAppService : ApplicationService, ISettingAppService
public class SettingAppService : ApplicationService, ISettingAppService, ISettingTestAppService
{
protected AbpLocalizationOptions LocalizationOptions { get; }
@ -31,6 +31,7 @@ namespace LINGYUN.Abp.SettingManagement
protected ISettingDefinitionManager SettingDefinitionManager { get; }
protected IDistributedCache<SettingCacheItem> Cache { get; }
public SettingAppService(
IDistributedEventBus eventBus,
ISettingManager settingManager,
@ -440,5 +441,15 @@ namespace LINGYUN.Abp.SettingManagement
{
await FeatureChecker.CheckEnabledAsync(SettingManagementFeatures.Enable);
}
public async virtual Task SendTestEmailAsync(SendTestEmailInput input)
{
var emailSender = LazyServiceProvider.LazyGetRequiredService<IEmailSender>();
await emailSender.SendAsync(
input.EmailAddress,
L["SendTestEmail:Subject"],
L["SendTestEmail:Body"]);
}
}
}

19
aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/SettingController.cs

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
@ -8,12 +9,16 @@ namespace LINGYUN.Abp.SettingManagement
[RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)]
[Area("settingManagement")]
[Route("api/setting-management/settings")]
public class SettingController : AbpController, ISettingAppService
public class SettingController : AbpController, ISettingAppService, ISettingTestAppService
{
private readonly ISettingAppService _settingAppService;
public SettingController(ISettingAppService settingAppService)
private readonly ISettingTestAppService _settingTestAppService;
public SettingController(
ISettingAppService settingAppService,
ISettingTestAppService settingTestAppService)
{
_settingAppService = settingAppService;
_settingTestAppService = settingTestAppService;
}
[HttpPut]
@ -43,5 +48,13 @@ namespace LINGYUN.Abp.SettingManagement
{
return await _settingAppService.GetAllForCurrentTenantAsync();
}
[HttpPost]
[Authorize]
[Route("send-test-email")]
public async virtual Task SendTestEmailAsync(SendTestEmailInput input)
{
await _settingTestAppService.SendTestEmailAsync(input);
}
}
}

2
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/Properties/launchSettings.json

@ -14,7 +14,7 @@
"launchBrowser": false,
"applicationUrl": "http://0.0.0.0:30015",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
"ASPNETCORE_ENVIRONMENT": "Production"
}
}
}

1774
aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211030124247_Re-Initlize-Db-Migration.Designer.cs

File diff suppressed because it is too large

1770
aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211118035301_Remove-Field-AvatarUrl-With-IdentityUser.Designer.cs

File diff suppressed because it is too large

25
aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211118035301_Remove-Field-AvatarUrl-With-IdentityUser.cs

@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace LY.MicroService.AuthServer.Migrations
{
public partial class RemoveFieldAvatarUrlWithIdentityUser : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AvatarUrl",
table: "AbpUsers");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "AvatarUrl",
table: "AbpUsers",
type: "varchar(128)",
maxLength: 128,
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}

1775
aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211206122741_Upgrade-Abp-To-5-0-0-RC-1.Designer.cs

File diff suppressed because it is too large

26
aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211206122741_Upgrade-Abp-To-5-0-0-RC-1.cs

@ -1,26 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LY.MicroService.AuthServer.Migrations
{
public partial class UpgradeAbpTo500RC1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "AbpUsers",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsActive",
table: "AbpUsers");
}
}
}

938
aspnet-core/services/LY.MicroService.AuthServer/Migrations/20220806104408_Switch-IdentityServer-to-the-OpenIddict.cs

@ -1,938 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LY.MicroService.AuthServer.Migrations
{
public partial class SwitchIdentityServertotheOpenIddict : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "IdentityServerApiResourceClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceProperties");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceScopes");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceSecrets");
migrationBuilder.DropTable(
name: "IdentityServerApiScopeClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiScopeProperties");
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: "IdentityServerIdentityResourceClaims");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResourceProperties");
migrationBuilder.DropTable(
name: "IdentityServerPersistedGrants");
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
migrationBuilder.DropTable(
name: "IdentityServerApiScopes");
migrationBuilder.DropTable(
name: "IdentityServerClients");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResources");
migrationBuilder.CreateTable(
name: "OpenIddictApplications",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ClientId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientSecret = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConsentType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayNames = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Permissions = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PostLogoutRedirectUris = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Properties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RedirectUris = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Requirements = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientUri = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
LogoUri = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_OpenIddictApplications", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "OpenIddictScopes",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Descriptions = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayNames = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Properties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Resources = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_OpenIddictScopes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "OpenIddictAuthorizations",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ApplicationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Properties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Scopes = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Subject = table.Column<string>(type: "varchar(400)", maxLength: 400, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id);
table.ForeignKey(
name: "FK_OpenIddictAuthorizations_OpenIddictApplications_ApplicationId",
column: x => x.ApplicationId,
principalTable: "OpenIddictApplications",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "OpenIddictTokens",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ApplicationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
AuthorizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ExpirationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Payload = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Properties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RedemptionDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ReferenceId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Subject = table.Column<string>(type: "varchar(400)", maxLength: 400, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_OpenIddictTokens", x => x.Id);
table.ForeignKey(
name: "FK_OpenIddictTokens_OpenIddictApplications_ApplicationId",
column: x => x.ApplicationId,
principalTable: "OpenIddictApplications",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OpenIddictTokens_OpenIddictAuthorizations_AuthorizationId",
column: x => x.AuthorizationId,
principalTable: "OpenIddictAuthorizations",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_OpenIddictApplications_ClientId",
table: "OpenIddictApplications",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_OpenIddictAuthorizations_ApplicationId_Status_Subject_Type",
table: "OpenIddictAuthorizations",
columns: new[] { "ApplicationId", "Status", "Subject", "Type" });
migrationBuilder.CreateIndex(
name: "IX_OpenIddictScopes_Name",
table: "OpenIddictScopes",
column: "Name");
migrationBuilder.CreateIndex(
name: "IX_OpenIddictTokens_ApplicationId_Status_Subject_Type",
table: "OpenIddictTokens",
columns: new[] { "ApplicationId", "Status", "Subject", "Type" });
migrationBuilder.CreateIndex(
name: "IX_OpenIddictTokens_AuthorizationId",
table: "OpenIddictTokens",
column: "AuthorizationId");
migrationBuilder.CreateIndex(
name: "IX_OpenIddictTokens_ReferenceId",
table: "OpenIddictTokens",
column: "ReferenceId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OpenIddictScopes");
migrationBuilder.DropTable(
name: "OpenIddictTokens");
migrationBuilder.DropTable(
name: "OpenIddictAuthorizations");
migrationBuilder.DropTable(
name: "OpenIddictApplications");
migrationBuilder.CreateTable(
name: "IdentityServerApiResources",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AllowedAccessTokenSigningAlgorithms = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ShowInDiscoveryDocument = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiScopes",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Emphasize = table.Column<bool>(type: "tinyint(1)", nullable: false),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Required = table.Column<bool>(type: "tinyint(1)", nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClients",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AbsoluteRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
AccessTokenLifetime = table.Column<int>(type: "int", nullable: false),
AccessTokenType = table.Column<int>(type: "int", nullable: false),
AllowAccessTokensViaBrowser = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowOfflineAccess = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowPlainTextPkce = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowRememberConsent = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowedIdentityTokenSigningAlgorithms = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(type: "tinyint(1)", nullable: false),
AlwaysSendClientClaims = table.Column<bool>(type: "tinyint(1)", nullable: false),
AuthorizationCodeLifetime = table.Column<int>(type: "int", nullable: false),
BackChannelLogoutSessionRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
BackChannelLogoutUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientClaimsPrefix = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConsentLifetime = table.Column<int>(type: "int", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DeviceCodeLifetime = table.Column<int>(type: "int", nullable: false),
EnableLocalLogin = table.Column<bool>(type: "tinyint(1)", nullable: false),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FrontChannelLogoutSessionRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
FrontChannelLogoutUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IdentityTokenLifetime = table.Column<int>(type: "int", nullable: false),
IncludeJwtId = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LogoUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PairWiseSubjectSalt = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ProtocolType = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RefreshTokenExpiration = table.Column<int>(type: "int", nullable: false),
RefreshTokenUsage = table.Column<int>(type: "int", nullable: false),
RequireClientSecret = table.Column<bool>(type: "tinyint(1)", nullable: false),
RequireConsent = table.Column<bool>(type: "tinyint(1)", nullable: false),
RequirePkce = table.Column<bool>(type: "tinyint(1)", nullable: false),
RequireRequestObject = table.Column<bool>(type: "tinyint(1)", nullable: false),
SlidingRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(type: "tinyint(1)", nullable: false),
UserCodeType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserSsoLifetime = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClients", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerDeviceFlowCodes",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ClientId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Data = table.Column<string>(type: "varchar(10000)", maxLength: 10000, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DeviceCode = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Expiration = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SessionId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SubjectId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserCode = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResources",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Emphasize = table.Column<bool>(type: "tinyint(1)", nullable: false),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Required = table.Column<bool>(type: "tinyint(1)", nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerPersistedGrants",
columns: table => new
{
Key = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConsumedTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Data = table.Column<string>(type: "varchar(10000)", maxLength: 10000, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Expiration = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
SessionId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SubjectId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceClaims",
columns: table => new
{
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceClaims", x => new { x.ApiResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceProperties",
columns: table => new
{
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResourc~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceScopes",
columns: table => new
{
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Scope = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope });
table.ForeignKey(
name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_A~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceSecrets",
columns: table => new
{
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Expiration = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
{
ApiScopeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiScopeId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~",
column: x => x.ApiScopeId,
principalTable: "IdentityServerApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeProperties",
columns: table => new
{
ApiScopeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_Api~",
column: x => x.ApiScopeId,
principalTable: "IdentityServerApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientClaims",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientCorsOrigins",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Origin = table.Column<string>(type: "varchar(150)", maxLength: 150, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientGrantTypes",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
GrantType = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientIdPRestrictions",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Provider = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientPostLogoutRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PostLogoutRedirectUri = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientProperties",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RedirectUri = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientScopes",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Scope = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientSecrets",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Expiration = table.Column<DateTime>(type: "datetime(6)", 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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResourceClaims",
columns: table => new
{
IdentityResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityR~",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResourceProperties",
columns: table => new
{
IdentityResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value });
table.ForeignKey(
name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdent~",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
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");
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" });
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type",
table: "IdentityServerPersistedGrants",
columns: new[] { "SubjectId", "SessionId", "Type" });
}
}
}

6
aspnet-core/services/LY.MicroService.AuthServer/Migrations/20220806104408_Switch-IdentityServer-to-the-OpenIddict.Designer.cs → aspnet-core/services/LY.MicroService.AuthServer/Migrations/20221214082509_Add-OpenIddict-Module.Designer.cs

@ -12,15 +12,15 @@ using Volo.Abp.EntityFrameworkCore;
namespace LY.MicroService.AuthServer.Migrations
{
[DbContext(typeof(AuthServerMigrationsDbContext))]
[Migration("20220806104408_Switch-IdentityServer-to-the-OpenIddict")]
partial class SwitchIdentityServertotheOpenIddict
[Migration("20221214082509_Add-OpenIddict-Module")]
partial class AddOpenIddictModule
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "6.0.7")
.HasAnnotation("ProductVersion", "6.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>

698
aspnet-core/services/LY.MicroService.AuthServer/Migrations/20211030124247_Re-Initlize-Db-Migration.cs → aspnet-core/services/LY.MicroService.AuthServer/Migrations/20221214082509_Add-OpenIddict-Module.cs

@ -1,9 +1,11 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LY.MicroService.AuthServer.Migrations
{
public partial class ReInitlizeDbMigration : Migration
public partial class AddOpenIddictModule : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
@ -83,8 +85,7 @@ namespace LY.MicroService.AuthServer.Migrations
name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId",
column: x => x.ParentId,
principalTable: "AbpOrganizationUnits",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
@ -176,12 +177,11 @@ namespace LY.MicroService.AuthServer.Migrations
PhoneNumber = table.Column<string>(type: "varchar(16)", maxLength: 16, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PhoneNumberConfirmed = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
LockoutEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
AccessFailedCount = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
AvatarUrl = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
@ -201,127 +201,36 @@ namespace LY.MicroService.AuthServer.Migrations
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiResources",
name: "OpenIddictApplications",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
ClientId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
ClientSecret = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
ConsentType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowedAccessTokenSigningAlgorithms = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
DisplayName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ShowInDiscoveryDocument = table.Column<bool>(type: "tinyint(1)", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
DisplayNames = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiScopes",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
Permissions = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
PostLogoutRedirectUris = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
Properties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Required = table.Column<bool>(type: "tinyint(1)", nullable: false),
Emphasize = table.Column<bool>(type: "tinyint(1)", nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(type: "tinyint(1)", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClients",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ClientId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
RedirectUris = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
Requirements = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
ClientUri = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
LogoUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
LogoUri = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
ProtocolType = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RequireClientSecret = table.Column<bool>(type: "tinyint(1)", nullable: false),
RequireConsent = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowRememberConsent = table.Column<bool>(type: "tinyint(1)", nullable: false),
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(type: "tinyint(1)", nullable: false),
RequirePkce = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowPlainTextPkce = table.Column<bool>(type: "tinyint(1)", nullable: false),
RequireRequestObject = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowAccessTokensViaBrowser = table.Column<bool>(type: "tinyint(1)", nullable: false),
FrontChannelLogoutUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FrontChannelLogoutSessionRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
BackChannelLogoutUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
BackChannelLogoutSessionRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
AllowOfflineAccess = table.Column<bool>(type: "tinyint(1)", nullable: false),
IdentityTokenLifetime = table.Column<int>(type: "int", nullable: false),
AllowedIdentityTokenSigningAlgorithms = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
AccessTokenLifetime = table.Column<int>(type: "int", nullable: false),
AuthorizationCodeLifetime = table.Column<int>(type: "int", nullable: false),
ConsentLifetime = table.Column<int>(type: "int", nullable: true),
AbsoluteRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
SlidingRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
RefreshTokenUsage = table.Column<int>(type: "int", nullable: false),
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(type: "tinyint(1)", nullable: false),
RefreshTokenExpiration = table.Column<int>(type: "int", nullable: false),
AccessTokenType = table.Column<int>(type: "int", nullable: false),
EnableLocalLogin = table.Column<bool>(type: "tinyint(1)", nullable: false),
IncludeJwtId = table.Column<bool>(type: "tinyint(1)", nullable: false),
AlwaysSendClientClaims = table.Column<bool>(type: "tinyint(1)", nullable: false),
ClientClaimsPrefix = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PairWiseSubjectSalt = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserSsoLifetime = table.Column<int>(type: "int", nullable: true),
UserCodeType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DeviceCodeLifetime = table.Column<int>(type: "int", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
@ -336,58 +245,29 @@ namespace LY.MicroService.AuthServer.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClients", x => x.Id);
table.PrimaryKey("PK_OpenIddictApplications", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerDeviceFlowCodes",
name: "OpenIddictScopes",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DeviceCode = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UserCode = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
SubjectId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SessionId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
Descriptions = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Expiration = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Data = table.Column<string>(type: "varchar(10000)", maxLength: 10000, nullable: false)
DisplayName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
DisplayNames = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResources",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
Properties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
Resources = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
Required = table.Column<bool>(type: "tinyint(1)", nullable: false),
Emphasize = table.Column<bool>(type: "tinyint(1)", nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(type: "tinyint(1)", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
@ -402,40 +282,7 @@ namespace LY.MicroService.AuthServer.Migrations
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerPersistedGrants",
columns: table => new
{
Key = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
SubjectId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SessionId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Expiration = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ConsumedTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Data = table.Column<string>(type: "varchar(10000)", maxLength: 10000, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
table.PrimaryKey("PK_OpenIddictScopes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
@ -620,362 +467,92 @@ namespace LY.MicroService.AuthServer.Migrations
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceClaims",
name: "OpenIddictAuthorizations",
columns: table => new
{
Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ApplicationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Properties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceClaims", x => new { x.ApiResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceProperties",
columns: table => new
{
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
Scopes = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResourc~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceScopes",
columns: table => new
{
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Scope = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope });
table.ForeignKey(
name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_A~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiResourceSecrets",
columns: table => new
{
Type = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
Status = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
Subject = table.Column<string>(type: "varchar(400)", maxLength: 400, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Expiration = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_~",
column: x => x.ApiResourceId,
principalTable: "IdentityServerApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
{
Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ApiScopeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiScopeId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~",
column: x => x.ApiScopeId,
principalTable: "IdentityServerApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeProperties",
columns: table => new
{
ApiScopeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value });
table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id);
table.ForeignKey(
name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_Api~",
column: x => x.ApiScopeId,
principalTable: "IdentityServerApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
name: "FK_OpenIddictAuthorizations_OpenIddictApplications_ApplicationId",
column: x => x.ApplicationId,
principalTable: "OpenIddictApplications",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientClaims",
name: "OpenIddictTokens",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ApplicationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
AuthorizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ExpirationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Payload = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientCorsOrigins",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Origin = table.Column<string>(type: "varchar(150)", maxLength: 150, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientGrantTypes",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
GrantType = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientIdPRestrictions",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Provider = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientPostLogoutRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PostLogoutRedirectUri = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientProperties",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
Properties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId",
column: x => x.ClientId,
principalTable: "IdentityServerClients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientRedirectUris",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RedirectUri = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientScopes",
columns: table => new
{
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Scope = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerClientSecrets",
columns: table => new
{
Type = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
RedemptionDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ReferenceId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
Status = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Description = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
Subject = table.Column<string>(type: "varchar(400)", maxLength: 400, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Expiration = table.Column<DateTime>(type: "datetime(6)", 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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResourceClaims",
columns: table => new
{
Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IdentityResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type });
table.ForeignKey(
name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityR~",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "IdentityServerIdentityResourceProperties",
columns: table => new
{
IdentityResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value });
table.PrimaryKey("PK_OpenIddictTokens", x => x.Id);
table.ForeignKey(
name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdent~",
column: x => x.IdentityResourceId,
principalTable: "IdentityServerIdentityResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
name: "FK_OpenIddictTokens_OpenIddictApplications_ApplicationId",
column: x => x.ApplicationId,
principalTable: "OpenIddictApplications",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OpenIddictTokens_OpenIddictAuthorizations_AuthorizationId",
column: x => x.AuthorizationId,
principalTable: "OpenIddictAuthorizations",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
@ -1071,40 +648,34 @@ namespace LY.MicroService.AuthServer.Migrations
column: "UserName");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClients_ClientId",
table: "IdentityServerClients",
name: "IX_OpenIddictApplications_ClientId",
table: "OpenIddictApplications",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_DeviceCode",
table: "IdentityServerDeviceFlowCodes",
column: "DeviceCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_Expiration",
table: "IdentityServerDeviceFlowCodes",
column: "Expiration");
name: "IX_OpenIddictAuthorizations_ApplicationId_Status_Subject_Type",
table: "OpenIddictAuthorizations",
columns: new[] { "ApplicationId", "Status", "Subject", "Type" });
migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_UserCode",
table: "IdentityServerDeviceFlowCodes",
column: "UserCode");
name: "IX_OpenIddictScopes_Name",
table: "OpenIddictScopes",
column: "Name");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_Expiration",
table: "IdentityServerPersistedGrants",
column: "Expiration");
name: "IX_OpenIddictTokens_ApplicationId_Status_Subject_Type",
table: "OpenIddictTokens",
columns: new[] { "ApplicationId", "Status", "Subject", "Type" });
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type",
table: "IdentityServerPersistedGrants",
columns: new[] { "SubjectId", "ClientId", "Type" });
name: "IX_OpenIddictTokens_AuthorizationId",
table: "OpenIddictTokens",
column: "AuthorizationId");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type",
table: "IdentityServerPersistedGrants",
columns: new[] { "SubjectId", "SessionId", "Type" });
name: "IX_OpenIddictTokens_ReferenceId",
table: "OpenIddictTokens",
column: "ReferenceId");
}
protected override void Down(MigrationBuilder migrationBuilder)
@ -1140,61 +711,10 @@ namespace LY.MicroService.AuthServer.Migrations
name: "AbpUserTokens");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceProperties");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceScopes");
migrationBuilder.DropTable(
name: "IdentityServerApiResourceSecrets");
migrationBuilder.DropTable(
name: "IdentityServerApiScopeClaims");
migrationBuilder.DropTable(
name: "IdentityServerApiScopeProperties");
migrationBuilder.DropTable(
name: "IdentityServerClientClaims");
migrationBuilder.DropTable(
name: "IdentityServerClientCorsOrigins");
migrationBuilder.DropTable(
name: "IdentityServerClientGrantTypes");
name: "OpenIddictScopes");
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: "IdentityServerIdentityResourceClaims");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResourceProperties");
migrationBuilder.DropTable(
name: "IdentityServerPersistedGrants");
name: "OpenIddictTokens");
migrationBuilder.DropTable(
name: "AbpOrganizationUnits");
@ -1206,16 +726,10 @@ namespace LY.MicroService.AuthServer.Migrations
name: "AbpUsers");
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
migrationBuilder.DropTable(
name: "IdentityServerApiScopes");
migrationBuilder.DropTable(
name: "IdentityServerClients");
name: "OpenIddictAuthorizations");
migrationBuilder.DropTable(
name: "IdentityServerIdentityResources");
name: "OpenIddictApplications");
}
}
}

2
aspnet-core/services/LY.MicroService.AuthServer/Migrations/AuthServerMigrationsDbContextModelSnapshot.cs

@ -18,7 +18,7 @@ namespace LY.MicroService.AuthServer.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "6.0.7")
.HasAnnotation("ProductVersion", "6.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>

2
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Properties/launchSettings.json

@ -14,7 +14,7 @@
"launchBrowser": false,
"applicationUrl": "http://127.0.0.1:30010",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
"ASPNETCORE_ENVIRONMENT": "Production"
}
}
}

Loading…
Cancel
Save