Browse Source

Merge pull request #137 from colinin/3.3

Refactor the WeChat module to make its responsibilities clear
pull/177/head
cKey 5 years ago
committed by GitHub
parent
commit
a6c8fcbcca
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 49
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 31
      aspnet-core/LINGYUN.MicroService.BackendAdmin.sln
  3. 35
      aspnet-core/LINGYUN.MicroService.IdentityServer.sln
  4. 14
      aspnet-core/LINGYUN.MicroService.IdentityServerAdmin.sln
  5. 14
      aspnet-core/LINGYUN.MicroService.Messages.sln
  6. 22
      aspnet-core/database/ApiGateway-Init-SqlServer.sql
  7. 126
      aspnet-core/database/ApiGateway-Init.sql
  8. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs
  9. 2
      aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj
  10. 4
      aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AbpAccountApplicationModule.cs
  11. 16
      aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs
  12. 24
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN.Abp.IdentityServer.WeChat.csproj
  13. 54
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/AbpIdentityServerWeChatModule.cs
  14. 9
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/IWeChatResourceDataSeeder.cs
  15. 10
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Localization/en.json
  16. 10
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Localization/zh-Hans.json
  17. 118
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/MiniProgram/WeChatMiniProgramGrantValidator.cs
  18. 61
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/MiniProgram/WeChatMiniProgramProfileService.cs
  19. 117
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Official/WeChatOfficialGrantValidator.cs
  20. 71
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Official/WeChatOfficialOAuthConsts.cs
  21. 75
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Official/WeChatOfficialSignatureMiddleware.cs
  22. 86
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/WeChatResourceDataSeeder.cs
  23. 331
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthHandler.cs
  24. 47
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthOptions.cs
  25. 18
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialStateCacheItem.cs
  26. 65
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Authentication/WeChatAuthenticationExtensions.cs
  27. 22
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Builder/IdentityServerApplicationBuilderExtensions.cs
  28. 16
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/System/BytesExtensions.cs
  29. 17
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/System/StringExtensions.cs
  30. 63
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/System/Text/Json/JsonElementExtensions.cs
  31. 4
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN.Abp.IdentityServer.WeChatValidator.csproj
  32. 17
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/README.md
  33. 4
      aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/SettingController.cs
  34. 2
      aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat/LINGYUN.Abp.Notifications.WeChat.WeApp.csproj
  35. 11
      aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/AbpNotificationsWeChatWeAppModule.cs
  36. 45
      aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationPublishProvider.cs
  37. 12
      aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationSender.cs
  38. 6
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN.Abp.WeChat.Authorization.csproj
  39. 1
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/AbpWeChatAuthorizationOptions.cs
  40. 47
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/AbpWeChatAuthorizationOptionsFactory.cs
  41. 12
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IUserWeChatOpenIdFinder.cs
  42. 10
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IWeChatOpenIdFinder.cs
  43. 11
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Settings/WeChatAuthorizationSettingNames.cs
  44. 32
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Settings/WeChatAuthorizationSettingProvider.cs
  45. 17
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/README.md
  46. 24
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN.Abp.WeChat.MiniProgram.csproj
  47. 21
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramConsts.cs
  48. 46
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramModule.cs
  49. 22
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs
  50. 50
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsFactory.cs
  51. 15
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Localization/Resources/en.json
  52. 15
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Localization/Resources/zh-Hans.json
  53. 44
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs
  54. 24
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs
  55. 106
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs
  56. 119
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs
  57. 44
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingDefinitionProvider.cs
  58. 14
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingNames.cs
  59. 20
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/README.md
  60. 24
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN.Abp.WeChat.Official.csproj
  61. 22
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialConsts.cs
  62. 38
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialModule.cs
  63. 26
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs
  64. 52
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsFactory.cs
  65. 17
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Localization/Resources/en.json
  66. 17
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Localization/Resources/zh-Hans.json
  67. 50
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingDefinitionProvider.cs
  68. 15
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingNames.cs
  69. 20
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/README.md
  70. 31
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj
  71. 51
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/AbpWeChatSettingManagementModule.cs
  72. 13
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/IWeChatSettingAppService.cs
  73. 7
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/Localization/Resources/en.json
  74. 7
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/Localization/Resources/zh-Hans.json
  75. 116
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs
  76. 37
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingController.cs
  77. 27
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionDefinitionProvider.cs
  78. 10
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionNames.cs
  79. 5
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj
  80. 18
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatGlobalConsts.cs
  81. 16
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatModule.cs
  82. 5
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/en.json
  83. 5
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/zh-Hans.json
  84. 12
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs
  85. 9
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs
  86. 6
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs
  87. 2
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs
  88. 8
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs
  89. 18
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs
  90. 2
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs
  91. 4
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs
  92. 48
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Security/Claims/AbpWeChatClaimTypes.cs
  93. 7
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingNames.cs
  94. 10
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/IWeChatTokenProvider.cs
  95. 26
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs
  96. 24
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs
  97. 92
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs
  98. 10
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs
  99. 41
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs
  100. 46
      aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/System/Net/Http/HttpClientWeChatTokenRequestExtensions.cs

49
aspnet-core/LINGYUN.MicroService.All.sln

@ -109,12 +109,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MessageService.
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MessageService.HttpApi", "modules\message\LINGYUN.Abp.MessageService.HttpApi\LINGYUN.Abp.MessageService.HttpApi.csproj", "{9E12ADBF-713B-4FE7-B71F-52B5078A57CE}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MessageService.HttpApi", "modules\message\LINGYUN.Abp.MessageService.HttpApi\LINGYUN.Abp.MessageService.HttpApi.csproj", "{9E12ADBF-713B-4FE7-B71F-52B5078A57CE}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.WeChatValidator", "modules\identityServer\LINGYUN.Abp.IdentityServer.WeChatValidator\LINGYUN.Abp.IdentityServer.WeChatValidator.csproj", "{02043AD5-5E06-4EDD-8162-983E766C38EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.WeChat.WeApp", "modules\wechat\LINGYUN.Abp.Notifications.WeChat\LINGYUN.Abp.Notifications.WeChat.WeApp.csproj", "{85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.WeChat.WeApp", "modules\wechat\LINGYUN.Abp.Notifications.WeChat\LINGYUN.Abp.Notifications.WeChat.WeApp.csproj", "{85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Authorization", "modules\wechat\LINGYUN.Abp.WeChat.Authorization\LINGYUN.Abp.WeChat.Authorization.csproj", "{263A8A1C-69D0-4C3F-B33E-8F0831C146EB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Hangfire.Storage.MySql", "modules\common\LINGYUN.Abp.Hangfire.MySqlStorage\LINGYUN.Abp.Hangfire.Storage.MySql.csproj", "{47CC8F7A-681D-42B9-AE04-78453782C1B6}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Hangfire.Storage.MySql", "modules\common\LINGYUN.Abp.Hangfire.MySqlStorage\LINGYUN.Abp.Hangfire.Storage.MySql.csproj", "{47CC8F7A-681D-42B9-AE04-78453782C1B6}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Hangfire.Storage.SqlServer", "modules\common\LINGYUN.Abp.Hangfire.Storage.SqlServer\LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj", "{F595CB9F-B117-4D62-A1AE-48599927DB36}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Hangfire.Storage.SqlServer", "modules\common\LINGYUN.Abp.Hangfire.Storage.SqlServer\LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj", "{F595CB9F-B117-4D62-A1AE-48599927DB36}"
@ -245,8 +241,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManag
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Domain.Identity", "modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj", "{2D377D3A-70EC-4BB3-9F4C-6C933693DA98}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Domain.Identity", "modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj", "{2D377D3A-70EC-4BB3-9F4C-6C933693DA98}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Account.Web", "modules\account\LINGYUN.Abp.Account.Web\LINGYUN.Abp.Account.Web.csproj", "{5F43141B-6C63-4547-B9D6-D69EC3D7CA7E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.SignalR.JwtToken", "modules\common\LINGYUN.Abp.AspNetCore.SignalR\LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj", "{A66D48C9-F141-4111-9169-CEB64AFFF61D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.SignalR.JwtToken", "modules\common\LINGYUN.Abp.AspNetCore.SignalR\LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj", "{A66D48C9-F141-4111-9169-CEB64AFFF61D}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.RealTime.SignalR", "modules\common\LINGYUN.Abp.RealTime.SignalR\LINGYUN.Abp.RealTime.SignalR.csproj", "{524276E1-053D-4191-ABF7-4CDA01BFFBC3}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.RealTime.SignalR", "modules\common\LINGYUN.Abp.RealTime.SignalR\LINGYUN.Abp.RealTime.SignalR.csproj", "{524276E1-053D-4191-ABF7-4CDA01BFFBC3}"
@ -259,6 +253,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat", "modul
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Domain.Shared", "modules\identity\LINGYUN.Abp.Identity.Domain.Shared\LINGYUN.Abp.Identity.Domain.Shared.csproj", "{E92A1CAA-5758-41EF-B67E-C0D394E85417}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Domain.Shared", "modules\identity\LINGYUN.Abp.Identity.Domain.Shared\LINGYUN.Abp.Identity.Domain.Shared.csproj", "{E92A1CAA-5758-41EF-B67E-C0D394E85417}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.MiniProgram", "modules\wechat\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj", "{F18DE651-A3E4-478F-A2B5-686429729EB8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Official", "modules\wechat\LINGYUN.Abp.WeChat.Official\LINGYUN.Abp.WeChat.Official.csproj", "{42309C06-C0F2-490F-931B-CF41FA1970FF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.SettingManagement", "modules\wechat\LINGYUN.Abp.WeChat.SettingManagement\LINGYUN.Abp.WeChat.SettingManagement.csproj", "{EC19F867-E9EA-4B26-A1E7-87AAA3EB9296}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.WeChat", "modules\identityServer\LINGYUN.Abp.IdentityServer.WeChat\LINGYUN.Abp.IdentityServer.WeChat.csproj", "{7356FC4B-CAB2-4808-8C97-9AF74583F3A4}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -425,18 +427,10 @@ Global
{9E12ADBF-713B-4FE7-B71F-52B5078A57CE}.Debug|Any CPU.Build.0 = Debug|Any CPU {9E12ADBF-713B-4FE7-B71F-52B5078A57CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E12ADBF-713B-4FE7-B71F-52B5078A57CE}.Release|Any CPU.ActiveCfg = Release|Any CPU {9E12ADBF-713B-4FE7-B71F-52B5078A57CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E12ADBF-713B-4FE7-B71F-52B5078A57CE}.Release|Any CPU.Build.0 = Release|Any CPU {9E12ADBF-713B-4FE7-B71F-52B5078A57CE}.Release|Any CPU.Build.0 = Release|Any CPU
{02043AD5-5E06-4EDD-8162-983E766C38EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{02043AD5-5E06-4EDD-8162-983E766C38EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{02043AD5-5E06-4EDD-8162-983E766C38EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{02043AD5-5E06-4EDD-8162-983E766C38EC}.Release|Any CPU.Build.0 = Release|Any CPU
{85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}.Debug|Any CPU.Build.0 = Debug|Any CPU {85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}.Release|Any CPU.ActiveCfg = Release|Any CPU {85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}.Release|Any CPU.Build.0 = Release|Any CPU {85EF4251-EFC4-4CC9-912B-EA5DB1E2E359}.Release|Any CPU.Build.0 = Release|Any CPU
{263A8A1C-69D0-4C3F-B33E-8F0831C146EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{263A8A1C-69D0-4C3F-B33E-8F0831C146EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{263A8A1C-69D0-4C3F-B33E-8F0831C146EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{263A8A1C-69D0-4C3F-B33E-8F0831C146EB}.Release|Any CPU.Build.0 = Release|Any CPU
{47CC8F7A-681D-42B9-AE04-78453782C1B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {47CC8F7A-681D-42B9-AE04-78453782C1B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47CC8F7A-681D-42B9-AE04-78453782C1B6}.Debug|Any CPU.Build.0 = Debug|Any CPU {47CC8F7A-681D-42B9-AE04-78453782C1B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47CC8F7A-681D-42B9-AE04-78453782C1B6}.Release|Any CPU.ActiveCfg = Release|Any CPU {47CC8F7A-681D-42B9-AE04-78453782C1B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -661,10 +655,6 @@ Global
{2D377D3A-70EC-4BB3-9F4C-6C933693DA98}.Debug|Any CPU.Build.0 = Debug|Any CPU {2D377D3A-70EC-4BB3-9F4C-6C933693DA98}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D377D3A-70EC-4BB3-9F4C-6C933693DA98}.Release|Any CPU.ActiveCfg = Release|Any CPU {2D377D3A-70EC-4BB3-9F4C-6C933693DA98}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D377D3A-70EC-4BB3-9F4C-6C933693DA98}.Release|Any CPU.Build.0 = Release|Any CPU {2D377D3A-70EC-4BB3-9F4C-6C933693DA98}.Release|Any CPU.Build.0 = Release|Any CPU
{5F43141B-6C63-4547-B9D6-D69EC3D7CA7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F43141B-6C63-4547-B9D6-D69EC3D7CA7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F43141B-6C63-4547-B9D6-D69EC3D7CA7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F43141B-6C63-4547-B9D6-D69EC3D7CA7E}.Release|Any CPU.Build.0 = Release|Any CPU
{A66D48C9-F141-4111-9169-CEB64AFFF61D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A66D48C9-F141-4111-9169-CEB64AFFF61D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A66D48C9-F141-4111-9169-CEB64AFFF61D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A66D48C9-F141-4111-9169-CEB64AFFF61D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A66D48C9-F141-4111-9169-CEB64AFFF61D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A66D48C9-F141-4111-9169-CEB64AFFF61D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -685,6 +675,22 @@ Global
{E92A1CAA-5758-41EF-B67E-C0D394E85417}.Debug|Any CPU.Build.0 = Debug|Any CPU {E92A1CAA-5758-41EF-B67E-C0D394E85417}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E92A1CAA-5758-41EF-B67E-C0D394E85417}.Release|Any CPU.ActiveCfg = Release|Any CPU {E92A1CAA-5758-41EF-B67E-C0D394E85417}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E92A1CAA-5758-41EF-B67E-C0D394E85417}.Release|Any CPU.Build.0 = Release|Any CPU {E92A1CAA-5758-41EF-B67E-C0D394E85417}.Release|Any CPU.Build.0 = Release|Any CPU
{F18DE651-A3E4-478F-A2B5-686429729EB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F18DE651-A3E4-478F-A2B5-686429729EB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F18DE651-A3E4-478F-A2B5-686429729EB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F18DE651-A3E4-478F-A2B5-686429729EB8}.Release|Any CPU.Build.0 = Release|Any CPU
{42309C06-C0F2-490F-931B-CF41FA1970FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42309C06-C0F2-490F-931B-CF41FA1970FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42309C06-C0F2-490F-931B-CF41FA1970FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42309C06-C0F2-490F-931B-CF41FA1970FF}.Release|Any CPU.Build.0 = Release|Any CPU
{EC19F867-E9EA-4B26-A1E7-87AAA3EB9296}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC19F867-E9EA-4B26-A1E7-87AAA3EB9296}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC19F867-E9EA-4B26-A1E7-87AAA3EB9296}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC19F867-E9EA-4B26-A1E7-87AAA3EB9296}.Release|Any CPU.Build.0 = Release|Any CPU
{7356FC4B-CAB2-4808-8C97-9AF74583F3A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7356FC4B-CAB2-4808-8C97-9AF74583F3A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7356FC4B-CAB2-4808-8C97-9AF74583F3A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7356FC4B-CAB2-4808-8C97-9AF74583F3A4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -741,9 +747,7 @@ Global
{608A3BD0-FC8D-48B0-B1C5-F3203A3BE99F} = {672E1170-7B18-474B-85C7-1961BF2A48AE} {608A3BD0-FC8D-48B0-B1C5-F3203A3BE99F} = {672E1170-7B18-474B-85C7-1961BF2A48AE}
{0D1DB712-B48D-4FB7-9A47-694C668A62E3} = {608A3BD0-FC8D-48B0-B1C5-F3203A3BE99F} {0D1DB712-B48D-4FB7-9A47-694C668A62E3} = {608A3BD0-FC8D-48B0-B1C5-F3203A3BE99F}
{9E12ADBF-713B-4FE7-B71F-52B5078A57CE} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D} {9E12ADBF-713B-4FE7-B71F-52B5078A57CE} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D}
{02043AD5-5E06-4EDD-8162-983E766C38EC} = {0439B173-F41E-4CE0-A44A-CCB70328F272}
{85EF4251-EFC4-4CC9-912B-EA5DB1E2E359} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} {85EF4251-EFC4-4CC9-912B-EA5DB1E2E359} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21}
{263A8A1C-69D0-4C3F-B33E-8F0831C146EB} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21}
{47CC8F7A-681D-42B9-AE04-78453782C1B6} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {47CC8F7A-681D-42B9-AE04-78453782C1B6} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{F595CB9F-B117-4D62-A1AE-48599927DB36} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {F595CB9F-B117-4D62-A1AE-48599927DB36} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{5CF403B2-47C9-4E4E-8856-0294BDD64884} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {5CF403B2-47C9-4E4E-8856-0294BDD64884} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
@ -808,13 +812,16 @@ Global
{CC362C67-6FC1-42B3-A130-8120AA8D790C} = {C5CAD011-DF84-4914-939C-0C029DCEF26F} {CC362C67-6FC1-42B3-A130-8120AA8D790C} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{B46D6DAF-98C6-441F-9FA5-3CAD7CF27727} = {CC362C67-6FC1-42B3-A130-8120AA8D790C} {B46D6DAF-98C6-441F-9FA5-3CAD7CF27727} = {CC362C67-6FC1-42B3-A130-8120AA8D790C}
{2D377D3A-70EC-4BB3-9F4C-6C933693DA98} = {52B5D4F7-237B-4E0A-A167-68442164F70A} {2D377D3A-70EC-4BB3-9F4C-6C933693DA98} = {52B5D4F7-237B-4E0A-A167-68442164F70A}
{5F43141B-6C63-4547-B9D6-D69EC3D7CA7E} = {9E72FEB9-A626-4312-892B-CDD043879758}
{A66D48C9-F141-4111-9169-CEB64AFFF61D} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {A66D48C9-F141-4111-9169-CEB64AFFF61D} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{524276E1-053D-4191-ABF7-4CDA01BFFBC3} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {524276E1-053D-4191-ABF7-4CDA01BFFBC3} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{43083268-74DE-4C68-824A-FB0CEC77358D} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {43083268-74DE-4C68-824A-FB0CEC77358D} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} = {C5CAD011-DF84-4914-939C-0C029DCEF26F} {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{BAE74ABC-1096-495F-A624-BEBFBC1896F2} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} {BAE74ABC-1096-495F-A624-BEBFBC1896F2} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21}
{E92A1CAA-5758-41EF-B67E-C0D394E85417} = {52B5D4F7-237B-4E0A-A167-68442164F70A} {E92A1CAA-5758-41EF-B67E-C0D394E85417} = {52B5D4F7-237B-4E0A-A167-68442164F70A}
{F18DE651-A3E4-478F-A2B5-686429729EB8} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21}
{42309C06-C0F2-490F-931B-CF41FA1970FF} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21}
{EC19F867-E9EA-4B26-A1E7-87AAA3EB9296} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21}
{7356FC4B-CAB2-4808-8C97-9AF74583F3A4} = {0439B173-F41E-4CE0-A44A-CCB70328F272}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718} SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

31
aspnet-core/LINGYUN.MicroService.BackendAdmin.sln

@ -59,6 +59,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Account.HttpApi
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Application", "modules\identity\LINGYUN.Abp.Identity.Application\LINGYUN.Abp.Identity.Application.csproj", "{9BABF219-AAAA-4611-8B49-BFCCBD046934}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Application", "modules\identity\LINGYUN.Abp.Identity.Application\LINGYUN.Abp.Identity.Application.csproj", "{9BABF219-AAAA-4611-8B49-BFCCBD046934}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wechat", "wechat", "{B36F627B-FD7D-4357-A623-F01AFF78B80D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat", "modules\wechat\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj", "{C1514C9C-7FB2-412E-A931-7F2F0C9A65DC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.MiniProgram", "modules\wechat\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj", "{D42CE0F0-331F-4E5C-92CD-6B4DD6854E69}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Official", "modules\wechat\LINGYUN.Abp.WeChat.Official\LINGYUN.Abp.WeChat.Official.csproj", "{EAD2F955-88CA-4570-AB81-31FB2FF02605}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.SettingManagement", "modules\wechat\LINGYUN.Abp.WeChat.SettingManagement\LINGYUN.Abp.WeChat.SettingManagement.csproj", "{3FD9C35C-3A8D-49F5-B7C5-4828AA3407AB}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -141,6 +151,22 @@ Global
{9BABF219-AAAA-4611-8B49-BFCCBD046934}.Debug|Any CPU.Build.0 = Debug|Any CPU {9BABF219-AAAA-4611-8B49-BFCCBD046934}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BABF219-AAAA-4611-8B49-BFCCBD046934}.Release|Any CPU.ActiveCfg = Release|Any CPU {9BABF219-AAAA-4611-8B49-BFCCBD046934}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BABF219-AAAA-4611-8B49-BFCCBD046934}.Release|Any CPU.Build.0 = Release|Any CPU {9BABF219-AAAA-4611-8B49-BFCCBD046934}.Release|Any CPU.Build.0 = Release|Any CPU
{C1514C9C-7FB2-412E-A931-7F2F0C9A65DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1514C9C-7FB2-412E-A931-7F2F0C9A65DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1514C9C-7FB2-412E-A931-7F2F0C9A65DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1514C9C-7FB2-412E-A931-7F2F0C9A65DC}.Release|Any CPU.Build.0 = Release|Any CPU
{D42CE0F0-331F-4E5C-92CD-6B4DD6854E69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D42CE0F0-331F-4E5C-92CD-6B4DD6854E69}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D42CE0F0-331F-4E5C-92CD-6B4DD6854E69}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D42CE0F0-331F-4E5C-92CD-6B4DD6854E69}.Release|Any CPU.Build.0 = Release|Any CPU
{EAD2F955-88CA-4570-AB81-31FB2FF02605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EAD2F955-88CA-4570-AB81-31FB2FF02605}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EAD2F955-88CA-4570-AB81-31FB2FF02605}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EAD2F955-88CA-4570-AB81-31FB2FF02605}.Release|Any CPU.Build.0 = Release|Any CPU
{3FD9C35C-3A8D-49F5-B7C5-4828AA3407AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FD9C35C-3A8D-49F5-B7C5-4828AA3407AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FD9C35C-3A8D-49F5-B7C5-4828AA3407AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3FD9C35C-3A8D-49F5-B7C5-4828AA3407AB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -172,6 +198,11 @@ Global
{D4AB1BF0-95EC-4E34-9C39-E888ED30C535} = {2F56344F-6E06-4F9B-A0F2-8A6F0AEB096A} {D4AB1BF0-95EC-4E34-9C39-E888ED30C535} = {2F56344F-6E06-4F9B-A0F2-8A6F0AEB096A}
{A387EF32-1FAD-412F-893D-43485CE59DB4} = {9DAD2CA8-16B6-4006-BD8E-EE3E9BAA3770} {A387EF32-1FAD-412F-893D-43485CE59DB4} = {9DAD2CA8-16B6-4006-BD8E-EE3E9BAA3770}
{9BABF219-AAAA-4611-8B49-BFCCBD046934} = {2F56344F-6E06-4F9B-A0F2-8A6F0AEB096A} {9BABF219-AAAA-4611-8B49-BFCCBD046934} = {2F56344F-6E06-4F9B-A0F2-8A6F0AEB096A}
{B36F627B-FD7D-4357-A623-F01AFF78B80D} = {ED23B2F3-87C1-44B6-8906-9DE739422C2C}
{C1514C9C-7FB2-412E-A931-7F2F0C9A65DC} = {B36F627B-FD7D-4357-A623-F01AFF78B80D}
{D42CE0F0-331F-4E5C-92CD-6B4DD6854E69} = {B36F627B-FD7D-4357-A623-F01AFF78B80D}
{EAD2F955-88CA-4570-AB81-31FB2FF02605} = {B36F627B-FD7D-4357-A623-F01AFF78B80D}
{3FD9C35C-3A8D-49F5-B7C5-4828AA3407AB} = {B36F627B-FD7D-4357-A623-F01AFF78B80D}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1573B900-87BA-4AD3-B785-6DD78127ADEF} SolutionGuid = {1573B900-87BA-4AD3-B785-6DD78127ADEF}

35
aspnet-core/LINGYUN.MicroService.IdentityServer.sln

@ -13,16 +13,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "identity-server", "identity
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.SmsValidator", "modules\identityServer\LINGYUN.Abp.IdentityServer.SmsValidator\LINGYUN.Abp.IdentityServer.SmsValidator.csproj", "{9EA06629-DBAC-4369-9850-B7415D0470B0}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.SmsValidator", "modules\identityServer\LINGYUN.Abp.IdentityServer.SmsValidator\LINGYUN.Abp.IdentityServer.SmsValidator.csproj", "{9EA06629-DBAC-4369-9850-B7415D0470B0}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.WeChatValidator", "modules\identityServer\LINGYUN.Abp.IdentityServer.WeChatValidator\LINGYUN.Abp.IdentityServer.WeChatValidator.csproj", "{B9E9D754-0BC1-42EA-94B3-631D1EA82B48}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "identity", "identity", "{70B8D735-1E89-4163-8EDB-56A74E374CF4}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "identity", "identity", "{70B8D735-1E89-4163-8EDB-56A74E374CF4}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Domain.Identity", "modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj", "{F87B2BA3-40BC-4CB8-B53E-793C860F285D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Domain.Identity", "modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj", "{F87B2BA3-40BC-4CB8-B53E-793C860F285D}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wechat", "wechat", "{AF8AECC8-0F42-4FC5-B3C0-00987BA8279F}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wechat", "wechat", "{AF8AECC8-0F42-4FC5-B3C0-00987BA8279F}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Authorization", "modules\wechat\LINGYUN.Abp.WeChat.Authorization\LINGYUN.Abp.WeChat.Authorization.csproj", "{F656C1B2-6122-44C1-97F4-421CB4C03ED8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "permission-management", "permission-management", "{2FEA83BA-2E6D-40AF-8781-12CFD042457F}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "permission-management", "permission-management", "{2FEA83BA-2E6D-40AF-8781-12CFD042457F}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Domain", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.Domain\LINGYUN.Abp.PermissionManagement.Domain.csproj", "{A0A11373-635B-4343-8EE7-1DFC3611F05A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Domain", "modules\permissions-management\LINGYUN.Abp.PermissionManagement.Domain\LINGYUN.Abp.PermissionManagement.Domain.csproj", "{A0A11373-635B-4343-8EE7-1DFC3611F05A}"
@ -51,6 +47,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Entity
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.EntityFrameworkCore", "modules\identityServer\LINGYUN.Abp.IdentityServer.EntityFrameworkCore\LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj", "{644FAB8F-ED83-4539-AF43-8F8FE61EF778}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.EntityFrameworkCore", "modules\identityServer\LINGYUN.Abp.IdentityServer.EntityFrameworkCore\LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj", "{644FAB8F-ED83-4539-AF43-8F8FE61EF778}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.MiniProgram", "modules\wechat\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj", "{648D7B5D-8B78-4F90-BDE0-4AC50C902CC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.Official", "modules\wechat\LINGYUN.Abp.WeChat.Official\LINGYUN.Abp.WeChat.Official.csproj", "{F762D1BB-66FB-421A-A917-D80B7DCC0DC0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.IdentityServer.WeChat", "modules\identityServer\LINGYUN.Abp.IdentityServer.WeChat\LINGYUN.Abp.IdentityServer.WeChat.csproj", "{D63C0CA8-554D-43F2-8DB4-8B464E4C1CDA}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -65,18 +67,10 @@ Global
{9EA06629-DBAC-4369-9850-B7415D0470B0}.Debug|Any CPU.Build.0 = Debug|Any CPU {9EA06629-DBAC-4369-9850-B7415D0470B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9EA06629-DBAC-4369-9850-B7415D0470B0}.Release|Any CPU.ActiveCfg = Release|Any CPU {9EA06629-DBAC-4369-9850-B7415D0470B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9EA06629-DBAC-4369-9850-B7415D0470B0}.Release|Any CPU.Build.0 = Release|Any CPU {9EA06629-DBAC-4369-9850-B7415D0470B0}.Release|Any CPU.Build.0 = Release|Any CPU
{B9E9D754-0BC1-42EA-94B3-631D1EA82B48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B9E9D754-0BC1-42EA-94B3-631D1EA82B48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B9E9D754-0BC1-42EA-94B3-631D1EA82B48}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B9E9D754-0BC1-42EA-94B3-631D1EA82B48}.Release|Any CPU.Build.0 = Release|Any CPU
{F87B2BA3-40BC-4CB8-B53E-793C860F285D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F87B2BA3-40BC-4CB8-B53E-793C860F285D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F87B2BA3-40BC-4CB8-B53E-793C860F285D}.Debug|Any CPU.Build.0 = Debug|Any CPU {F87B2BA3-40BC-4CB8-B53E-793C860F285D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F87B2BA3-40BC-4CB8-B53E-793C860F285D}.Release|Any CPU.ActiveCfg = Release|Any CPU {F87B2BA3-40BC-4CB8-B53E-793C860F285D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F87B2BA3-40BC-4CB8-B53E-793C860F285D}.Release|Any CPU.Build.0 = Release|Any CPU {F87B2BA3-40BC-4CB8-B53E-793C860F285D}.Release|Any CPU.Build.0 = Release|Any CPU
{F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F656C1B2-6122-44C1-97F4-421CB4C03ED8}.Release|Any CPU.Build.0 = Release|Any CPU
{A0A11373-635B-4343-8EE7-1DFC3611F05A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A0A11373-635B-4343-8EE7-1DFC3611F05A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0A11373-635B-4343-8EE7-1DFC3611F05A}.Debug|Any CPU.Build.0 = Debug|Any CPU {A0A11373-635B-4343-8EE7-1DFC3611F05A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0A11373-635B-4343-8EE7-1DFC3611F05A}.Release|Any CPU.ActiveCfg = Release|Any CPU {A0A11373-635B-4343-8EE7-1DFC3611F05A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -121,6 +115,18 @@ Global
{644FAB8F-ED83-4539-AF43-8F8FE61EF778}.Debug|Any CPU.Build.0 = Debug|Any CPU {644FAB8F-ED83-4539-AF43-8F8FE61EF778}.Debug|Any CPU.Build.0 = Debug|Any CPU
{644FAB8F-ED83-4539-AF43-8F8FE61EF778}.Release|Any CPU.ActiveCfg = Release|Any CPU {644FAB8F-ED83-4539-AF43-8F8FE61EF778}.Release|Any CPU.ActiveCfg = Release|Any CPU
{644FAB8F-ED83-4539-AF43-8F8FE61EF778}.Release|Any CPU.Build.0 = Release|Any CPU {644FAB8F-ED83-4539-AF43-8F8FE61EF778}.Release|Any CPU.Build.0 = Release|Any CPU
{648D7B5D-8B78-4F90-BDE0-4AC50C902CC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{648D7B5D-8B78-4F90-BDE0-4AC50C902CC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{648D7B5D-8B78-4F90-BDE0-4AC50C902CC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{648D7B5D-8B78-4F90-BDE0-4AC50C902CC3}.Release|Any CPU.Build.0 = Release|Any CPU
{F762D1BB-66FB-421A-A917-D80B7DCC0DC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F762D1BB-66FB-421A-A917-D80B7DCC0DC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F762D1BB-66FB-421A-A917-D80B7DCC0DC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F762D1BB-66FB-421A-A917-D80B7DCC0DC0}.Release|Any CPU.Build.0 = Release|Any CPU
{D63C0CA8-554D-43F2-8DB4-8B464E4C1CDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D63C0CA8-554D-43F2-8DB4-8B464E4C1CDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D63C0CA8-554D-43F2-8DB4-8B464E4C1CDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D63C0CA8-554D-43F2-8DB4-8B464E4C1CDA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -129,11 +135,9 @@ Global
{BF8073FF-6403-4ED6-A3CD-74F240DC8044} = {DDCA574F-911B-4547-BA21-12CCE1022D95} {BF8073FF-6403-4ED6-A3CD-74F240DC8044} = {DDCA574F-911B-4547-BA21-12CCE1022D95}
{98887A8F-7040-4FA1-842F-A4C77A61ED09} = {7C727110-59CA-495B-8143-C5DDEDE41289} {98887A8F-7040-4FA1-842F-A4C77A61ED09} = {7C727110-59CA-495B-8143-C5DDEDE41289}
{9EA06629-DBAC-4369-9850-B7415D0470B0} = {98887A8F-7040-4FA1-842F-A4C77A61ED09} {9EA06629-DBAC-4369-9850-B7415D0470B0} = {98887A8F-7040-4FA1-842F-A4C77A61ED09}
{B9E9D754-0BC1-42EA-94B3-631D1EA82B48} = {98887A8F-7040-4FA1-842F-A4C77A61ED09}
{70B8D735-1E89-4163-8EDB-56A74E374CF4} = {7C727110-59CA-495B-8143-C5DDEDE41289} {70B8D735-1E89-4163-8EDB-56A74E374CF4} = {7C727110-59CA-495B-8143-C5DDEDE41289}
{F87B2BA3-40BC-4CB8-B53E-793C860F285D} = {70B8D735-1E89-4163-8EDB-56A74E374CF4} {F87B2BA3-40BC-4CB8-B53E-793C860F285D} = {70B8D735-1E89-4163-8EDB-56A74E374CF4}
{AF8AECC8-0F42-4FC5-B3C0-00987BA8279F} = {7C727110-59CA-495B-8143-C5DDEDE41289} {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F} = {7C727110-59CA-495B-8143-C5DDEDE41289}
{F656C1B2-6122-44C1-97F4-421CB4C03ED8} = {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F}
{2FEA83BA-2E6D-40AF-8781-12CFD042457F} = {7C727110-59CA-495B-8143-C5DDEDE41289} {2FEA83BA-2E6D-40AF-8781-12CFD042457F} = {7C727110-59CA-495B-8143-C5DDEDE41289}
{A0A11373-635B-4343-8EE7-1DFC3611F05A} = {2FEA83BA-2E6D-40AF-8781-12CFD042457F} {A0A11373-635B-4343-8EE7-1DFC3611F05A} = {2FEA83BA-2E6D-40AF-8781-12CFD042457F}
{6F13C138-1D71-48F5-A404-94047242E98F} = {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F} {6F13C138-1D71-48F5-A404-94047242E98F} = {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F}
@ -148,6 +152,9 @@ Global
{6514E12E-D97C-4311-8301-F270D4E04A9F} = {70B8D735-1E89-4163-8EDB-56A74E374CF4} {6514E12E-D97C-4311-8301-F270D4E04A9F} = {70B8D735-1E89-4163-8EDB-56A74E374CF4}
{77F424CB-75F2-4D7F-8B52-BBE2E09CB423} = {70B8D735-1E89-4163-8EDB-56A74E374CF4} {77F424CB-75F2-4D7F-8B52-BBE2E09CB423} = {70B8D735-1E89-4163-8EDB-56A74E374CF4}
{644FAB8F-ED83-4539-AF43-8F8FE61EF778} = {98887A8F-7040-4FA1-842F-A4C77A61ED09} {644FAB8F-ED83-4539-AF43-8F8FE61EF778} = {98887A8F-7040-4FA1-842F-A4C77A61ED09}
{648D7B5D-8B78-4F90-BDE0-4AC50C902CC3} = {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F}
{F762D1BB-66FB-421A-A917-D80B7DCC0DC0} = {AF8AECC8-0F42-4FC5-B3C0-00987BA8279F}
{D63C0CA8-554D-43F2-8DB4-8B464E4C1CDA} = {98887A8F-7040-4FA1-842F-A4C77A61ED09}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FCB77471-9ECB-4666-A316-1D6A6285A468} SolutionGuid = {FCB77471-9ECB-4666-A316-1D6A6285A468}

14
aspnet-core/LINGYUN.MicroService.IdentityServerAdmin.sln

@ -47,8 +47,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManag
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wechat", "wechat", "{7EE9651C-17B0-4343-A2ED-92439F8C9019}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wechat", "wechat", "{7EE9651C-17B0-4343-A2ED-92439F8C9019}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Authorization", "modules\wechat\LINGYUN.Abp.WeChat.Authorization\LINGYUN.Abp.WeChat.Authorization.csproj", "{F61FA8AA-4248-4F2B-87E0-73CD2C027783}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{FD2DDD48-8F84-4924-BBAF-52080AB32267}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{FD2DDD48-8F84-4924-BBAF-52080AB32267}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Settings", "modules\common\LINGYUN.Abp.Settings\LINGYUN.Abp.Settings.csproj", "{A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Settings", "modules\common\LINGYUN.Abp.Settings\LINGYUN.Abp.Settings.csproj", "{A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC}"
@ -75,6 +73,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MultiTenancy.Db
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.Mvc.Validation", "modules\common\LINGYUN.Abp.AspNetCore.Mvc.Validation\LINGYUN.Abp.AspNetCore.Mvc.Validation.csproj", "{B3181D37-F379-4E16-8621-5E739C519393}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.Mvc.Validation", "modules\common\LINGYUN.Abp.AspNetCore.Mvc.Validation\LINGYUN.Abp.AspNetCore.Mvc.Validation.csproj", "{B3181D37-F379-4E16-8621-5E739C519393}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.MiniProgram", "modules\wechat\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj", "{AD1C3335-A2A1-49C1-A6DB-817C54859B65}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -145,10 +145,6 @@ Global
{177B6CD3-1690-416D-9B37-A821093DEFBD}.Debug|Any CPU.Build.0 = Debug|Any CPU {177B6CD3-1690-416D-9B37-A821093DEFBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{177B6CD3-1690-416D-9B37-A821093DEFBD}.Release|Any CPU.ActiveCfg = Release|Any CPU {177B6CD3-1690-416D-9B37-A821093DEFBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{177B6CD3-1690-416D-9B37-A821093DEFBD}.Release|Any CPU.Build.0 = Release|Any CPU {177B6CD3-1690-416D-9B37-A821093DEFBD}.Release|Any CPU.Build.0 = Release|Any CPU
{F61FA8AA-4248-4F2B-87E0-73CD2C027783}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F61FA8AA-4248-4F2B-87E0-73CD2C027783}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F61FA8AA-4248-4F2B-87E0-73CD2C027783}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F61FA8AA-4248-4F2B-87E0-73CD2C027783}.Release|Any CPU.Build.0 = Release|Any CPU
{A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC}.Debug|Any CPU.Build.0 = Debug|Any CPU {A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC}.Release|Any CPU.ActiveCfg = Release|Any CPU {A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -193,6 +189,10 @@ Global
{B3181D37-F379-4E16-8621-5E739C519393}.Debug|Any CPU.Build.0 = Debug|Any CPU {B3181D37-F379-4E16-8621-5E739C519393}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3181D37-F379-4E16-8621-5E739C519393}.Release|Any CPU.ActiveCfg = Release|Any CPU {B3181D37-F379-4E16-8621-5E739C519393}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B3181D37-F379-4E16-8621-5E739C519393}.Release|Any CPU.Build.0 = Release|Any CPU {B3181D37-F379-4E16-8621-5E739C519393}.Release|Any CPU.Build.0 = Release|Any CPU
{AD1C3335-A2A1-49C1-A6DB-817C54859B65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD1C3335-A2A1-49C1-A6DB-817C54859B65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD1C3335-A2A1-49C1-A6DB-817C54859B65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD1C3335-A2A1-49C1-A6DB-817C54859B65}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -218,7 +218,6 @@ Global
{6679A09F-124A-470A-81F5-A94302CEFEE4} = {BD964040-90B2-4179-A5EB-5830F5C7E073} {6679A09F-124A-470A-81F5-A94302CEFEE4} = {BD964040-90B2-4179-A5EB-5830F5C7E073}
{177B6CD3-1690-416D-9B37-A821093DEFBD} = {BD964040-90B2-4179-A5EB-5830F5C7E073} {177B6CD3-1690-416D-9B37-A821093DEFBD} = {BD964040-90B2-4179-A5EB-5830F5C7E073}
{7EE9651C-17B0-4343-A2ED-92439F8C9019} = {14B8F528-C649-4FAD-9BBB-6C979ED403E1} {7EE9651C-17B0-4343-A2ED-92439F8C9019} = {14B8F528-C649-4FAD-9BBB-6C979ED403E1}
{F61FA8AA-4248-4F2B-87E0-73CD2C027783} = {7EE9651C-17B0-4343-A2ED-92439F8C9019}
{FD2DDD48-8F84-4924-BBAF-52080AB32267} = {14B8F528-C649-4FAD-9BBB-6C979ED403E1} {FD2DDD48-8F84-4924-BBAF-52080AB32267} = {14B8F528-C649-4FAD-9BBB-6C979ED403E1}
{A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC} = {FD2DDD48-8F84-4924-BBAF-52080AB32267} {A8C83B9C-C9BF-48EF-80FF-D4FE2C936EFC} = {FD2DDD48-8F84-4924-BBAF-52080AB32267}
{23536755-4F00-4929-9C5E-D4CABD1CC513} = {BD964040-90B2-4179-A5EB-5830F5C7E073} {23536755-4F00-4929-9C5E-D4CABD1CC513} = {BD964040-90B2-4179-A5EB-5830F5C7E073}
@ -232,6 +231,7 @@ Global
{99B60A42-29DA-4D91-9255-B90F53BC6D6E} = {89BA9708-62E5-4FD6-A28A-CF9E1C26DCAE} {99B60A42-29DA-4D91-9255-B90F53BC6D6E} = {89BA9708-62E5-4FD6-A28A-CF9E1C26DCAE}
{70C4FA43-0526-48E3-B852-A21395502604} = {89BA9708-62E5-4FD6-A28A-CF9E1C26DCAE} {70C4FA43-0526-48E3-B852-A21395502604} = {89BA9708-62E5-4FD6-A28A-CF9E1C26DCAE}
{B3181D37-F379-4E16-8621-5E739C519393} = {FD2DDD48-8F84-4924-BBAF-52080AB32267} {B3181D37-F379-4E16-8621-5E739C519393} = {FD2DDD48-8F84-4924-BBAF-52080AB32267}
{AD1C3335-A2A1-49C1-A6DB-817C54859B65} = {7EE9651C-17B0-4343-A2ED-92439F8C9019}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {785FFF4D-BC59-499E-88A3-7CB7A7667228} SolutionGuid = {785FFF4D-BC59-499E-88A3-7CB7A7667228}

14
aspnet-core/LINGYUN.MicroService.Messages.sln

@ -47,12 +47,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.W
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Features.LimitValidation", "modules\common\LINGYUN.Abp.Features.LimitValidation\LINGYUN.Abp.Features.LimitValidation.csproj", "{93971F1F-F6AC-4F83-8119-21260FCE2828}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Features.LimitValidation", "modules\common\LINGYUN.Abp.Features.LimitValidation\LINGYUN.Abp.Features.LimitValidation.csproj", "{93971F1F-F6AC-4F83-8119-21260FCE2828}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Authorization", "modules\wechat\LINGYUN.Abp.WeChat.Authorization\LINGYUN.Abp.WeChat.Authorization.csproj", "{ADB894C3-8CED-4809-8D85-478D2335CDA2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat", "modules\wechat\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj", "{3B87330F-A303-4413-B653-1C9536C74109}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat", "modules\wechat\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj", "{3B87330F-A303-4413-B653-1C9536C74109}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "message", "message", "{D58F1DF5-2DFE-40A2-B136-7606D4CDE903}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "message", "message", "{D58F1DF5-2DFE-40A2-B136-7606D4CDE903}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.MiniProgram", "modules\wechat\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj", "{3A4601FE-B091-43A3-AEE6-6440BB37B277}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -131,14 +131,14 @@ Global
{93971F1F-F6AC-4F83-8119-21260FCE2828}.Debug|Any CPU.Build.0 = Debug|Any CPU {93971F1F-F6AC-4F83-8119-21260FCE2828}.Debug|Any CPU.Build.0 = Debug|Any CPU
{93971F1F-F6AC-4F83-8119-21260FCE2828}.Release|Any CPU.ActiveCfg = Release|Any CPU {93971F1F-F6AC-4F83-8119-21260FCE2828}.Release|Any CPU.ActiveCfg = Release|Any CPU
{93971F1F-F6AC-4F83-8119-21260FCE2828}.Release|Any CPU.Build.0 = Release|Any CPU {93971F1F-F6AC-4F83-8119-21260FCE2828}.Release|Any CPU.Build.0 = Release|Any CPU
{ADB894C3-8CED-4809-8D85-478D2335CDA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADB894C3-8CED-4809-8D85-478D2335CDA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADB894C3-8CED-4809-8D85-478D2335CDA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADB894C3-8CED-4809-8D85-478D2335CDA2}.Release|Any CPU.Build.0 = Release|Any CPU
{3B87330F-A303-4413-B653-1C9536C74109}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3B87330F-A303-4413-B653-1C9536C74109}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B87330F-A303-4413-B653-1C9536C74109}.Debug|Any CPU.Build.0 = Debug|Any CPU {3B87330F-A303-4413-B653-1C9536C74109}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B87330F-A303-4413-B653-1C9536C74109}.Release|Any CPU.ActiveCfg = Release|Any CPU {3B87330F-A303-4413-B653-1C9536C74109}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B87330F-A303-4413-B653-1C9536C74109}.Release|Any CPU.Build.0 = Release|Any CPU {3B87330F-A303-4413-B653-1C9536C74109}.Release|Any CPU.Build.0 = Release|Any CPU
{3A4601FE-B091-43A3-AEE6-6440BB37B277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A4601FE-B091-43A3-AEE6-6440BB37B277}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A4601FE-B091-43A3-AEE6-6440BB37B277}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A4601FE-B091-43A3-AEE6-6440BB37B277}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -164,9 +164,9 @@ Global
{78164C5C-63B9-4FB6-ACC9-6496E236C946} = {0C7AA298-2957-4D71-A8F1-1C3C7932A1B3} {78164C5C-63B9-4FB6-ACC9-6496E236C946} = {0C7AA298-2957-4D71-A8F1-1C3C7932A1B3}
{D7B2B2BE-C32C-47AE-A46C-62B7EF8C318E} = {78164C5C-63B9-4FB6-ACC9-6496E236C946} {D7B2B2BE-C32C-47AE-A46C-62B7EF8C318E} = {78164C5C-63B9-4FB6-ACC9-6496E236C946}
{93971F1F-F6AC-4F83-8119-21260FCE2828} = {C00828FB-E7D5-4086-BA50-02022594AB73} {93971F1F-F6AC-4F83-8119-21260FCE2828} = {C00828FB-E7D5-4086-BA50-02022594AB73}
{ADB894C3-8CED-4809-8D85-478D2335CDA2} = {78164C5C-63B9-4FB6-ACC9-6496E236C946}
{3B87330F-A303-4413-B653-1C9536C74109} = {78164C5C-63B9-4FB6-ACC9-6496E236C946} {3B87330F-A303-4413-B653-1C9536C74109} = {78164C5C-63B9-4FB6-ACC9-6496E236C946}
{D58F1DF5-2DFE-40A2-B136-7606D4CDE903} = {0C7AA298-2957-4D71-A8F1-1C3C7932A1B3} {D58F1DF5-2DFE-40A2-B136-7606D4CDE903} = {0C7AA298-2957-4D71-A8F1-1C3C7932A1B3}
{3A4601FE-B091-43A3-AEE6-6440BB37B277} = {78164C5C-63B9-4FB6-ACC9-6496E236C946}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6238659A-7267-49B9-A499-8746BDEED6B8} SolutionGuid = {6238659A-7267-49B9-A499-8746BDEED6B8}

22
aspnet-core/database/ApiGateway-Init-SqlServer.sql

File diff suppressed because one or more lines are too long

126
aspnet-core/database/ApiGateway-Init.sql

@ -11,7 +11,7 @@
Target Server Version : 80020 Target Server Version : 80020
File Encoding : 65001 File Encoding : 65001
Date: 31/10/2020 11:28:59 Date: 20/11/2020 17:35:45
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
@ -54,13 +54,16 @@ CREATE TABLE `appapigatewayaggregate` (
`Priority` int(0) NULL DEFAULT NULL, `Priority` int(0) NULL DEFAULT NULL,
`UpstreamHttpMethod` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `UpstreamHttpMethod` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`Id`) USING BTREE PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayaggregate -- Records of appapigatewayaggregate
-- ---------------------------- -- ----------------------------
INSERT INTO `appapigatewayaggregate` VALUES (5, '{}', 'db569f15577848568bee9616d6b8b53c', 'TEST-APP', 'abp接口代理服务', 1263083077348196352, 'platform-api-definition,backend-admin-api-definition,messages-api-definition,apigateway-api-definition,identity-server-api-definition,', '/api/abp/api-definition', '', 1, 'AbpApiDefinitionAggregator', NULL, ''); INSERT INTO `appapigatewayaggregate` VALUES (5, '{}', 'db569f15577848568bee9616d6b8b53c', 'TEST-APP', 'abp接口代理服务', 1263083077348196352, 'platform-api-definition,backend-admin-api-definition,messages-api-definition,apigateway-api-definition,identity-server-api-definition,', '/api/abp/api-definition', '', 1, 'AbpApiDefinitionAggregator', NULL, '');
INSERT INTO `appapigatewayaggregate` VALUES (6, '{}', '870a2c5df9b34f8c9514aef0250fbb47', 'TEST-APP', 'abp框架配置', 1263102116090970112, 'apigateway-configuration,platform-configuration,backend-admin-configuration,messages-configuration,identity-server-configuration,', '/api/abp/application-configuration', '', 1, 'AbpApiDefinitionAggregator', NULL, ''); INSERT INTO `appapigatewayaggregate` VALUES (6, '{}', '870a2c5df9b34f8c9514aef0250fbb47', 'TEST-APP', 'abp框架配置', 1263102116090970112, 'apigateway-configuration,platform-configuration,backend-admin-configuration,messages-configuration,identity-server-configuration,', '/api/abp/application-configuration', '', 1, 'AbpApiDefinitionAggregator', NULL, '');
INSERT INTO `appapigatewayaggregate` VALUES (8, '{}', 'edc962f7e0844bb09cb0fb731f358b4b', 'TEST-APP', '我的消息订阅', 1322503807309881344, 'assignables-notifilers,my-subscribes,', '/api/my-subscribes/assignables-notifilers', '', 1, 'AbpApiDefinitionAggregator', NULL, '');
INSERT INTO `appapigatewayaggregate` VALUES (9, '{}', 'dbfc4b5972034e8ba875551fa8dd29a1', 'TEST-APP', '全局设置', 1329708867127799808, 'setting-global,wechat-setting-global,', '/api/setting-management/settings/by-global', '', 1, 'AbpApiDefinitionAggregator', NULL, '');
INSERT INTO `appapigatewayaggregate` VALUES (10, '{}', '2035b334da4b450eaa3f0c4c54998d8b', 'TEST-APP', '当前租户设置', 1329709265255329792, 'setting-current-tenant,wechat-setting-current-tenant,', '/api/setting-management/settings/by-current-tenant', '', 1, 'AbpApiDefinitionAggregator', NULL, '');
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayaggregateconfig -- Table structure for appapigatewayaggregateconfig
@ -76,7 +79,7 @@ CREATE TABLE `appapigatewayaggregateconfig` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
INDEX `IX_AppApiGatewayAggregateConfig_AggregateReRouteId`(`AggregateReRouteId`) USING BTREE, INDEX `IX_AppApiGatewayAggregateConfig_AggregateReRouteId`(`AggregateReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayAggregateConfig_AppApiGatewayAggregate_Aggregat~` FOREIGN KEY (`AggregateReRouteId`) REFERENCES `appapigatewayaggregate` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayAggregateConfig_AppApiGatewayAggregate_Aggregat~` FOREIGN KEY (`AggregateReRouteId`) REFERENCES `appapigatewayaggregate` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayauthoptions -- Table structure for appapigatewayauthoptions
@ -90,7 +93,7 @@ CREATE TABLE `appapigatewayauthoptions` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayAuthOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayAuthOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayAuthOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayAuthOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 149 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 160 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayauthoptions -- Records of appapigatewayauthoptions
@ -210,6 +213,16 @@ INSERT INTO `appapigatewayauthoptions` VALUES (146, 1321002059803136000, '', '')
INSERT INTO `appapigatewayauthoptions` VALUES (147, 1321002256440496128, '', ''); INSERT INTO `appapigatewayauthoptions` VALUES (147, 1321002256440496128, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (148, 1321002350686507008, '', ''); INSERT INTO `appapigatewayauthoptions` VALUES (148, 1321002350686507008, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (149, 1322190027988525056, '', ''); INSERT INTO `appapigatewayauthoptions` VALUES (149, 1322190027988525056, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (150, 1322452079688458240, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (151, 1322452183929495552, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (152, 1322452308651319296, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (153, 1322452858176446464, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (154, 1322452989235863552, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (155, 1322453089655889920, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (156, 1329706860249804800, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (157, 1329707002411544576, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (158, 1329708512277098496, '', '');
INSERT INTO `appapigatewayauthoptions` VALUES (159, 1329708625917571072, '', '');
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewaybalanceroptions -- Table structure for appapigatewaybalanceroptions
@ -227,7 +240,7 @@ CREATE TABLE `appapigatewaybalanceroptions` (
UNIQUE INDEX `IX_AppApiGatewayBalancerOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayBalancerOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayGlobalConfiguratio~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayGlobalConfiguratio~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 152 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 163 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewaybalanceroptions -- Records of appapigatewaybalanceroptions
@ -348,6 +361,16 @@ INSERT INTO `appapigatewaybalanceroptions` VALUES (149, NULL, 132100205980313600
INSERT INTO `appapigatewaybalanceroptions` VALUES (150, NULL, 1321002256440496128, '', '', 0); INSERT INTO `appapigatewaybalanceroptions` VALUES (150, NULL, 1321002256440496128, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (151, NULL, 1321002350686507008, '', '', 0); INSERT INTO `appapigatewaybalanceroptions` VALUES (151, NULL, 1321002350686507008, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (152, NULL, 1322190027988525056, '', '', 0); INSERT INTO `appapigatewaybalanceroptions` VALUES (152, NULL, 1322190027988525056, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (153, NULL, 1322452079688458240, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (154, NULL, 1322452183929495552, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (155, NULL, 1322452308651319296, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (156, NULL, 1322452858176446464, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (157, NULL, 1322452989235863552, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (158, NULL, 1322453089655889920, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (159, NULL, 1329706860249804800, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (160, NULL, 1329707002411544576, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (161, NULL, 1329708512277098496, '', '', 0);
INSERT INTO `appapigatewaybalanceroptions` VALUES (162, NULL, 1329708625917571072, '', '', 0);
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewaycacheoptions -- Table structure for appapigatewaycacheoptions
@ -361,7 +384,7 @@ CREATE TABLE `appapigatewaycacheoptions` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayCacheOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayCacheOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayCacheOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayCacheOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 149 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 160 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewaycacheoptions -- Records of appapigatewaycacheoptions
@ -481,6 +504,16 @@ INSERT INTO `appapigatewaycacheoptions` VALUES (146, 1321002059803136000, 0, '')
INSERT INTO `appapigatewaycacheoptions` VALUES (147, 1321002256440496128, 0, ''); INSERT INTO `appapigatewaycacheoptions` VALUES (147, 1321002256440496128, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (148, 1321002350686507008, 0, ''); INSERT INTO `appapigatewaycacheoptions` VALUES (148, 1321002350686507008, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (149, 1322190027988525056, 0, ''); INSERT INTO `appapigatewaycacheoptions` VALUES (149, 1322190027988525056, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (150, 1322452079688458240, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (151, 1322452183929495552, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (152, 1322452308651319296, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (153, 1322452858176446464, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (154, 1322452989235863552, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (155, 1322453089655889920, NULL, NULL);
INSERT INTO `appapigatewaycacheoptions` VALUES (156, 1329706860249804800, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (157, 1329707002411544576, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (158, 1329708512277098496, 0, '');
INSERT INTO `appapigatewaycacheoptions` VALUES (159, 1329708625917571072, 0, '');
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewaydiscovery -- Table structure for appapigatewaydiscovery
@ -500,7 +533,7 @@ CREATE TABLE `appapigatewaydiscovery` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayDiscovery_ItemId`(`ItemId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayDiscovery_ItemId`(`ItemId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayDiscovery_AppApiGatewayGlobalConfiguration_Item~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayDiscovery_AppApiGatewayGlobalConfiguration_Item~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewaydiscovery -- Records of appapigatewaydiscovery
@ -521,7 +554,7 @@ CREATE TABLE `appapigatewaydynamicreroute` (
`AppId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `AppId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `AK_AppApiGatewayDynamicReRoute_DynamicReRouteId`(`DynamicReRouteId`) USING BTREE UNIQUE INDEX `AK_AppApiGatewayDynamicReRoute_DynamicReRouteId`(`DynamicReRouteId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayglobalconfiguration -- Table structure for appapigatewayglobalconfiguration
@ -541,7 +574,7 @@ CREATE TABLE `appapigatewayglobalconfiguration` (
`AppId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `AppId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `AK_AppApiGatewayGlobalConfiguration_ItemId`(`ItemId`) USING BTREE UNIQUE INDEX `AK_AppApiGatewayGlobalConfiguration_ItemId`(`ItemId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayglobalconfiguration -- Records of appapigatewayglobalconfiguration
@ -590,7 +623,7 @@ CREATE TABLE `appapigatewayhttpoptions` (
UNIQUE INDEX `IX_AppApiGatewayHttpOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayHttpOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayGlobalConfiguration_It~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayGlobalConfiguration_It~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 152 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 163 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayhttpoptions -- Records of appapigatewayhttpoptions
@ -711,6 +744,16 @@ INSERT INTO `appapigatewayhttpoptions` VALUES (149, NULL, 1321002059803136000, 0
INSERT INTO `appapigatewayhttpoptions` VALUES (150, NULL, 1321002256440496128, 0, 0, 0, 0, 0); INSERT INTO `appapigatewayhttpoptions` VALUES (150, NULL, 1321002256440496128, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (151, NULL, 1321002350686507008, 0, 0, 0, 0, 0); INSERT INTO `appapigatewayhttpoptions` VALUES (151, NULL, 1321002350686507008, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (152, NULL, 1322190027988525056, 0, 0, 0, 0, 0); INSERT INTO `appapigatewayhttpoptions` VALUES (152, NULL, 1322190027988525056, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (153, NULL, 1322452079688458240, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (154, NULL, 1322452183929495552, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (155, NULL, 1322452308651319296, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (156, NULL, 1322452858176446464, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (157, NULL, 1322452989235863552, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (158, NULL, 1322453089655889920, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (159, NULL, 1329706860249804800, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (160, NULL, 1329707002411544576, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (161, NULL, 1329708512277098496, 0, 0, 0, 0, 0);
INSERT INTO `appapigatewayhttpoptions` VALUES (162, NULL, 1329708625917571072, 0, 0, 0, 0, 0);
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayqosoptions -- Table structure for appapigatewayqosoptions
@ -728,7 +771,7 @@ CREATE TABLE `appapigatewayqosoptions` (
UNIQUE INDEX `IX_AppApiGatewayQoSOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayQoSOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayGlobalConfiguration_Ite~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayGlobalConfiguration_Ite~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 152 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 163 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayqosoptions -- Records of appapigatewayqosoptions
@ -849,6 +892,16 @@ INSERT INTO `appapigatewayqosoptions` VALUES (149, NULL, 1321002059803136000, 50
INSERT INTO `appapigatewayqosoptions` VALUES (150, NULL, 1321002256440496128, 50, 60000, 30000); INSERT INTO `appapigatewayqosoptions` VALUES (150, NULL, 1321002256440496128, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (151, NULL, 1321002350686507008, 50, 60000, 30000); INSERT INTO `appapigatewayqosoptions` VALUES (151, NULL, 1321002350686507008, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (152, NULL, 1322190027988525056, 50, 60000, 30000); INSERT INTO `appapigatewayqosoptions` VALUES (152, NULL, 1322190027988525056, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (153, NULL, 1322452079688458240, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (154, NULL, 1322452183929495552, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (155, NULL, 1322452308651319296, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (156, NULL, 1322452858176446464, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (157, NULL, 1322452989235863552, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (158, NULL, 1322453089655889920, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (159, NULL, 1329706860249804800, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (160, NULL, 1329707002411544576, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (161, NULL, 1329708512277098496, 50, 60000, 30000);
INSERT INTO `appapigatewayqosoptions` VALUES (162, NULL, 1329708625917571072, 50, 60000, 30000);
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayratelimitoptions -- Table structure for appapigatewayratelimitoptions
@ -865,7 +918,7 @@ CREATE TABLE `appapigatewayratelimitoptions` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayRateLimitOptions_ItemId`(`ItemId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayRateLimitOptions_ItemId`(`ItemId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayRateLimitOptions_AppApiGatewayGlobalConfigurati~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayRateLimitOptions_AppApiGatewayGlobalConfigurati~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayratelimitoptions -- Records of appapigatewayratelimitoptions
@ -890,7 +943,7 @@ CREATE TABLE `appapigatewayratelimitrule` (
UNIQUE INDEX `IX_AppApiGatewayRateLimitRule_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayRateLimitRule_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayDynamicReRoute_Dynam~` FOREIGN KEY (`DynamicReRouteId`) REFERENCES `appapigatewaydynamicreroute` (`DynamicReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayDynamicReRoute_Dynam~` FOREIGN KEY (`DynamicReRouteId`) REFERENCES `appapigatewaydynamicreroute` (`DynamicReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT,
CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 149 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 160 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayratelimitrule -- Records of appapigatewayratelimitrule
@ -1010,6 +1063,16 @@ INSERT INTO `appapigatewayratelimitrule` VALUES (146, 1321002059803136000, NULL,
INSERT INTO `appapigatewayratelimitrule` VALUES (147, 1321002256440496128, NULL, '', 0, NULL, NULL, NULL); INSERT INTO `appapigatewayratelimitrule` VALUES (147, 1321002256440496128, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (148, 1321002350686507008, NULL, '', 0, NULL, NULL, NULL); INSERT INTO `appapigatewayratelimitrule` VALUES (148, 1321002350686507008, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (149, 1322190027988525056, NULL, '', 0, NULL, NULL, NULL); INSERT INTO `appapigatewayratelimitrule` VALUES (149, 1322190027988525056, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (150, 1322452079688458240, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (151, 1322452183929495552, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (152, 1322452308651319296, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (153, 1322452858176446464, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (154, 1322452989235863552, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (155, 1322453089655889920, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (156, 1329706860249804800, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (157, 1329707002411544576, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (158, 1329708512277098496, NULL, '', 0, NULL, NULL, NULL);
INSERT INTO `appapigatewayratelimitrule` VALUES (159, 1329708625917571072, NULL, '', 0, NULL, NULL, NULL);
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayreroute -- Table structure for appapigatewayreroute
@ -1049,7 +1112,7 @@ CREATE TABLE `appapigatewayreroute` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `AK_AppApiGatewayReRoute_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `AK_AppApiGatewayReRoute_ReRouteId`(`ReRouteId`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewayReRoute_AppId_DownstreamPathTemplate_UpstreamPa~`(`AppId`, `DownstreamPathTemplate`, `UpstreamPathTemplate`) USING BTREE UNIQUE INDEX `IX_AppApiGatewayReRoute_AppId_DownstreamPathTemplate_UpstreamPa~`(`AppId`, `DownstreamPathTemplate`, `UpstreamPathTemplate`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 156 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 167 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewayreroute -- Records of appapigatewayreroute
@ -1106,7 +1169,7 @@ INSERT INTO `appapigatewayreroute` VALUES (62, '{}', '530ab314560f41678b40f48da9
INSERT INTO `appapigatewayreroute` VALUES (63, '{}', '21334c6da4c349cc883c38c13de0e754', 1263305106250047488, '【后台管理】- 特定租户管理', '/api/tenant-management/tenants/{id}', '', '', '/api/tenant-management/tenants/{id}', 'GET,PUT,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (63, '{}', '21334c6da4c349cc883c38c13de0e754', 1263305106250047488, '【后台管理】- 特定租户管理', '/api/tenant-management/tenants/{id}', '', '', '/api/tenant-management/tenants/{id}', 'GET,PUT,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (64, '{}', 'cc8fdf1b2d0b414ebf2dc51a6dc78305', 1263305244594970624, '【后台管理】- 租户连接字符串', '/api/tenant-management/tenants/{id}/connection-string', '', '', '/api/tenant-management/tenants/{id}/concatenation', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 2, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (64, '{}', 'cc8fdf1b2d0b414ebf2dc51a6dc78305', 1263305244594970624, '【后台管理】- 租户连接字符串', '/api/tenant-management/tenants/{id}/connection-string', '', '', '/api/tenant-management/tenants/{id}/concatenation', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 2, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (65, '{}', 'aaf285ed10da4024ba561d5cf8c6322b', 1263305430536855552, '【后台管理】- 特定租户连接字符串', '/api/tenant-management/tenants/{id}/connection-string/{name}', '', '', '/api/tenant-management/tenants/{id}/concatenation/{name}', 'GET,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 1, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (65, '{}', 'aaf285ed10da4024ba561d5cf8c6322b', 1263305430536855552, '【后台管理】- 特定租户连接字符串', '/api/tenant-management/tenants/{id}/connection-string/{name}', '', '', '/api/tenant-management/tenants/{id}/concatenation/{name}', 'GET,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 1, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (66, '{}', 'b6ec80673b354c239def3bdce31b4cc0', 1263639172959174656, '【后台管理】- 全局设置', '/api/setting-management/settings/by-global', '', '', '/api/setting-management/settings/by-global', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (66, '{}', '6a7da198f4c84d94969a437adc47642b', 1263639172959174656, '【后台管理】- 全局设置', '/api/setting-management/settings/by-global', '', '', '/api/setting-management/settings/by-global/app', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', 'setting-global', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (67, '{}', '755b4dce5c34444785fa3b647fef4131', 1264799968944640000, '【身份认证服务】- 验证手机号', '/api/account/phone/verify', '', '', '/api/account/phone/verify', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (67, '{}', '755b4dce5c34444785fa3b647fef4131', 1264799968944640000, '【身份认证服务】- 验证手机号', '/api/account/phone/verify', '', '', '/api/account/phone/verify', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (68, '{}', '535191c570ae453ab320012304d7a62c', 1264800070161584128, '【身份认证服务】- 手机号注册', '/api/account/phone/register', '', '', '/api/account/phone/register', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (68, '{}', '535191c570ae453ab320012304d7a62c', 1264800070161584128, '【身份认证服务】- 手机号注册', '/api/account/phone/register', '', '', '/api/account/phone/register', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (69, '{}', '723c9b111f9f4a1aa804118cdde193d3', 1267360794414161920, '【消息服务】- 通知', '/signalr-hubs/notifications/{everything}', '', '', '/signalr-hubs/notifications/{everything}', 'POST,GET,OPTIONS,PUT,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'ws', '127.0.0.1:30020,', '', '', '', 1, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (69, '{}', '723c9b111f9f4a1aa804118cdde193d3', 1267360794414161920, '【消息服务】- 通知', '/signalr-hubs/notifications/{everything}', '', '', '/signalr-hubs/notifications/{everything}', 'POST,GET,OPTIONS,PUT,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'ws', '127.0.0.1:30020,', '', '', '', 1, 30000, 1, '', 'TEST-APP');
@ -1121,7 +1184,7 @@ INSERT INTO `appapigatewayreroute` VALUES (104, '{}', '3515e75becf9447492ad60466
INSERT INTO `appapigatewayreroute` VALUES (105, '{}', 'aab0a24d930f4f9687497e5ccaac2a31', 1288658491216289792, '【身份认证服务】- 查询组织机构最后一个子节点', '/api/identity/organization-units/last-children', '', '', '/api/identity/organization-units/last-children', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (105, '{}', 'aab0a24d930f4f9687497e5ccaac2a31', 1288658491216289792, '【身份认证服务】- 查询组织机构最后一个子节点', '/api/identity/organization-units/last-children', '', '', '/api/identity/organization-units/last-children', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (106, '{}', '9b7c999b1c5140c497bc15914a815401', 1288658638302142464, '【身份认证服务】- 未加入组织机构角色', '/api/identity/organization-units/{id}/unadded-roles', '', '', '/api/identity/organization-units/{id}/unadded-roles', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (106, '{}', '9b7c999b1c5140c497bc15914a815401', 1288658638302142464, '【身份认证服务】- 未加入组织机构角色', '/api/identity/organization-units/{id}/unadded-roles', '', '', '/api/identity/organization-units/{id}/unadded-roles', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (107, '{}', 'b0cdb3f6908e42bd934ca99a78f22c3f', 1288658791784308736, '【身份认证服务】- 未加入组织机构用户', '/api/identity/organization-units/{id}/unadded-users', '', '', '/api/identity/organization-units/{id}/unadded-users', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (107, '{}', 'b0cdb3f6908e42bd934ca99a78f22c3f', 1288658791784308736, '【身份认证服务】- 未加入组织机构用户', '/api/identity/organization-units/{id}/unadded-users', '', '', '/api/identity/organization-units/{id}/unadded-users', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (108, '{}', '1982bc6ffd92445b9b3f47067378d1fc', 1290849478956199936, '【后台管理】- 当前租户设置', '/api/setting-management/settings/by-current-tenant', '', '', '/api/setting-management/settings/by-current-tenant', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (108, '{}', '9362040d10a94fb991f60bc391efcb85', 1290849478956199936, '【后台管理】- 当前租户设置', '/api/setting-management/settings/by-current-tenant', '', '', '/api/setting-management/settings/by-current-tenant/app', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', 'setting-current-tenant', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (109, '{}', 'a7df3a04805d4cc8a6e6b3823c6dd468', 1290849628051124224, '【后台管理】- 用户设置', '/api/setting-management/settings/by-user/{userId}', '', '', '/api/setting-management/settings/by-user/{userId}', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (109, '{}', 'a7df3a04805d4cc8a6e6b3823c6dd468', 1290849628051124224, '【后台管理】- 用户设置', '/api/setting-management/settings/by-user/{userId}', '', '', '/api/setting-management/settings/by-user/{userId}', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (110, '{}', 'ef6e38a529a345fab67f6a627cf20635', 1290849798553776128, '【后台管理】- 当前用户设置', '/api/setting-management/settings/by-current-user', '', '', '/api/setting-management/settings/by-current-user', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (110, '{}', 'ef6e38a529a345fab67f6a627cf20635', 1290849798553776128, '【后台管理】- 当前用户设置', '/api/setting-management/settings/by-current-user', '', '', '/api/setting-management/settings/by-current-user', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (112, '{}', '9844fed6507844f2ac64bd08649bd3a6', 1291259822512693248, '【身份认证服务】- 查询组织机构根节点', '/api/identity/organization-units/root-node', '', '', '/api/identity/organization-units/root-node', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (112, '{}', '9844fed6507844f2ac64bd08649bd3a6', 1291259822512693248, '【身份认证服务】- 查询组织机构根节点', '/api/identity/organization-units/root-node', '', '', '/api/identity/organization-units/root-node', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
@ -1169,6 +1232,16 @@ INSERT INTO `appapigatewayreroute` VALUES (153, '{}', '4867ad188ca54acb8b961d202
INSERT INTO `appapigatewayreroute` VALUES (154, '{}', '291ab802d7bc4af98fc15c509f98fa75', 1321002256440496128, '【消息服务】- 我的朋友', '/api/im/my-friends', '', '', '/api/im/my-friends', 'GET,POST,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (154, '{}', '291ab802d7bc4af98fc15c509f98fa75', 1321002256440496128, '【消息服务】- 我的朋友', '/api/im/my-friends', '', '', '/api/im/my-friends', 'GET,POST,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (155, '{}', '08438dabb1e849988e0c304f82b08a10', 1321002350686507008, '【消息服务】- 我的所有朋友', '/api/im/my-friends/all', '', '', '/api/im/my-friends/all', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (155, '{}', '08438dabb1e849988e0c304f82b08a10', 1321002350686507008, '【消息服务】- 我的所有朋友', '/api/im/my-friends/all', '', '', '/api/im/my-friends/all', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (156, '{}', 'cecf632785b7402299764698369c751f', 1322190027988525056, '【消息服务】- 发送好友请求', '/api/im/my-friends/add-request', '', '', '/api/im/my-friends/add-request', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (156, '{}', 'cecf632785b7402299764698369c751f', 1322190027988525056, '【消息服务】- 发送好友请求', '/api/im/my-friends/add-request', '', '', '/api/im/my-friends/add-request', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (157, '{}', '91b088ab3e164116b8c4a2b6109e37e9', 1322452079688458240, '【消息服务】- 我的订阅', '/api/my-subscribes', '', '', '/api/my-subscribes', 'GET,POST,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (158, '{}', 'b9f57600634b40c087ac0730926895e2', 1322452183929495552, '【消息服务】- 我的订阅列表', '/api/my-subscribes/all', '', '', '/api/my-subscribes/all', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', 'my-subscribes', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (159, '{}', '8e6a0c6759df42e29b9abd4d833646a3', 1322452308651319296, '【消息服务】- 是否已订阅', '/api/my-subscribes/is-subscribed/{Name}', '', '', '/api/my-subscribes/is-subscribed/{Name}', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (160, '{}', '6b747d0acfee478ea64241b7ea519861', 1322452858176446464, '【消息服务】- 我的通知', '/api/my-notifilers', '', '', '/api/my-notifilers', 'GET,POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (161, '{}', '25a64613f37f44cf8efff8d0cf6cd0ca', 1322452989235863552, '【消息服务】- 管理我的通知', '/api/my-notifilers/{id}', '', '', '/api/my-notifilers/{id}', 'GET,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (162, '{}', 'ddc7f13aaa2741b28c2102fbff18d836', 1322453089655889920, '【消息服务】- 可用通知列表', '/api/my-notifilers/assignables', '', '', '/api/my-notifilers/assignables', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', 'assignables-notifilers', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (163, '{}', '1d586107d7e240b3bfc14c8ca04baea8', 1329706860249804800, '【微信管理】- 微信公共配置', '/api/setting-management/wechat/by-global', '', '', '/api/setting-management/wechat/by-global', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', 'wechat-setting-global', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (164, '{}', 'bd9b34dd564f405bb3a063d6a719ce6e', 1329707002411544576, '【微信管理】- 微信租户配置', '/api/setting-management/wechat/by-current-tenant', '', '', '/api/setting-management/wechat/by-current-tenant', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', 'wechat-setting-current-tenant', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (165, '{}', 'e9847659244b47dc80101b1c3f4edb31', 1329708512277098496, '【后台管理】- 变更全局设置', '/api/setting-management/settings/change-global', '', '', '/api/setting-management/settings/change-global', 'PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
INSERT INTO `appapigatewayreroute` VALUES (166, '{}', '94c3692dea394b39ac0cc19f60fc1964', 1329708625917571072, '【后台管理】- 变更当前租户设置', '/api/setting-management/settings/change-current-tenant', '', '', '/api/setting-management/settings/change-current-tenant', 'PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30010,', '', '', '', 0, 30000, 1, '', 'TEST-APP');
-- ---------------------------- -- ----------------------------
-- Table structure for appapigatewayroutegroup -- Table structure for appapigatewayroutegroup
@ -1212,7 +1285,7 @@ CREATE TABLE `appapigatewaysecurityoptions` (
PRIMARY KEY (`Id`) USING BTREE, PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IX_AppApiGatewaySecurityOptions_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewaySecurityOptions_ReRouteId`(`ReRouteId`) USING BTREE,
CONSTRAINT `FK_AppApiGatewaySecurityOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT CONSTRAINT `FK_AppApiGatewaySecurityOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 149 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 160 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
-- ---------------------------- -- ----------------------------
-- Records of appapigatewaysecurityoptions -- Records of appapigatewaysecurityoptions
@ -1332,6 +1405,16 @@ INSERT INTO `appapigatewaysecurityoptions` VALUES (146, 1321002059803136000, '',
INSERT INTO `appapigatewaysecurityoptions` VALUES (147, 1321002256440496128, '', ''); INSERT INTO `appapigatewaysecurityoptions` VALUES (147, 1321002256440496128, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (148, 1321002350686507008, '', ''); INSERT INTO `appapigatewaysecurityoptions` VALUES (148, 1321002350686507008, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (149, 1322190027988525056, '', ''); INSERT INTO `appapigatewaysecurityoptions` VALUES (149, 1322190027988525056, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (150, 1322452079688458240, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (151, 1322452183929495552, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (152, 1322452308651319296, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (153, 1322452858176446464, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (154, 1322452989235863552, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (155, 1322453089655889920, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (156, 1329706860249804800, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (157, 1329707002411544576, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (158, 1329708512277098496, '', '');
INSERT INTO `appapigatewaysecurityoptions` VALUES (159, 1329708625917571072, '', '');
-- ---------------------------- -- ----------------------------
-- Table structure for cap.published -- Table structure for cap.published
@ -1353,7 +1436,14 @@ CREATE TABLE `cap.published` (
-- ---------------------------- -- ----------------------------
-- Records of cap.published -- Records of cap.published
-- ---------------------------- -- ----------------------------
INSERT INTO `cap.published` VALUES (1322190029573971968, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1322190029573971968\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/30 22:54:02 +08:00\",\"cap-corr-id\":\"1322190029573971968\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-30T22:54:02.8070185+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-30 22:54:03', '2020-10-31 22:54:03', 'Succeeded'); INSERT INTO `cap.published` VALUES (1329706861734588416, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1329706861734588416\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/11/20 16:43:15 +08:00\",\"cap-corr-id\":\"1329706861734588416\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-11-20T16:43:15.2508199+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-11-20 16:43:15', '2020-11-21 16:43:15', 'Succeeded');
INSERT INTO `cap.published` VALUES (1329707002549956608, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1329707002549956608\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/11/20 16:43:48 +08:00\",\"cap-corr-id\":\"1329707002549956608\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-11-20T16:43:48.825984+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-11-20 16:43:49', '2020-11-21 16:43:49', 'Succeeded');
INSERT INTO `cap.published` VALUES (1329708211352563712, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1329708211352563712\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/11/20 16:48:37 +08:00\",\"cap-corr-id\":\"1329708211352563712\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-11-20T16:48:37.0273285+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-11-20 16:48:37', '2020-11-21 16:48:37', 'Succeeded');
INSERT INTO `cap.published` VALUES (1329708364180418560, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1329708364180418560\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/11/20 16:49:13 +08:00\",\"cap-corr-id\":\"1329708364180418560\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-11-20T16:49:13.4642334+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-11-20 16:49:13', '2020-11-21 16:49:13', 'Succeeded');
INSERT INTO `cap.published` VALUES (1329708512352595968, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1329708512352595968\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/11/20 16:49:48 +08:00\",\"cap-corr-id\":\"1329708512352595968\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-11-20T16:49:48.7915448+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-11-20 16:49:49', '2020-11-21 16:49:49', 'Succeeded');
INSERT INTO `cap.published` VALUES (1329708626014040064, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1329708626014040064\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/11/20 16:50:15 +08:00\",\"cap-corr-id\":\"1329708626014040064\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-11-20T16:50:15.8881875+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-11-20 16:50:16', '2020-11-21 16:50:16', 'Succeeded');
INSERT INTO `cap.published` VALUES (1329708867152965632, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1329708867152965632\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/11/20 16:51:13 +08:00\",\"cap-corr-id\":\"1329708867152965632\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-11-20T16:51:13.3820372+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"AggregateRoute\"}}', 0, '2020-11-20 16:51:13', '2020-11-21 16:51:13', 'Succeeded');
INSERT INTO `cap.published` VALUES (1329709265259524096, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1329709265259524096\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/11/20 16:52:48 +08:00\",\"cap-corr-id\":\"1329709265259524096\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-11-20T16:52:48.2979878+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"AggregateRoute\"}}', 0, '2020-11-20 16:52:48', '2020-11-21 16:52:48', 'Succeeded');
-- ---------------------------- -- ----------------------------
-- Table structure for cap.received -- Table structure for cap.received

2
aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs

@ -12,7 +12,7 @@ namespace LINGYUN.Abp.Account
/// <returns></returns> /// <returns></returns>
Task RegisterAsync(PhoneRegisterDto input); Task RegisterAsync(PhoneRegisterDto input);
/// <summary> /// <summary>
/// 通过微信注册用户账户 /// 通过微信小程序注册用户账户
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>

2
aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj

@ -15,7 +15,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\common\LINGYUN.Abp.Settings\LINGYUN.Abp.Settings.csproj" /> <ProjectReference Include="..\..\common\LINGYUN.Abp.Settings\LINGYUN.Abp.Settings.csproj" />
<ProjectReference Include="..\..\identity\LINGYUN.Abp.Identity.Domain\LINGYUN.Abp.Identity.Domain.csproj" /> <ProjectReference Include="..\..\identity\LINGYUN.Abp.Identity.Domain\LINGYUN.Abp.Identity.Domain.csproj" />
<ProjectReference Include="..\..\wechat\LINGYUN.Abp.WeChat.Authorization\LINGYUN.Abp.WeChat.Authorization.csproj" /> <ProjectReference Include="..\..\wechat\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Account.Application.Contracts\LINGYUN.Abp.Account.Application.Contracts.csproj" /> <ProjectReference Include="..\LINGYUN.Abp.Account.Application.Contracts\LINGYUN.Abp.Account.Application.Contracts.csproj" />
</ItemGroup> </ItemGroup>

4
aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AbpAccountApplicationModule.cs

@ -1,5 +1,5 @@
using LINGYUN.Abp.Identity; using LINGYUN.Abp.Identity;
using LINGYUN.Abp.WeChat.Authorization; using LINGYUN.Abp.WeChat.MiniProgram;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Account namespace LINGYUN.Abp.Account
@ -8,7 +8,7 @@ namespace LINGYUN.Abp.Account
typeof(Volo.Abp.Account.AbpAccountApplicationModule), typeof(Volo.Abp.Account.AbpAccountApplicationModule),
typeof(AbpAccountApplicationContractsModule), typeof(AbpAccountApplicationContractsModule),
typeof(AbpIdentityDomainModule), typeof(AbpIdentityDomainModule),
typeof(AbpWeChatAuthorizationModule))] typeof(AbpWeChatMiniProgramModule))]
public class AbpAccountApplicationModule : AbpModule public class AbpAccountApplicationModule : AbpModule
{ {

16
aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs

@ -1,9 +1,12 @@
using LINGYUN.Abp.Identity; using LINGYUN.Abp.Identity;
using LINGYUN.Abp.Identity.Security; using LINGYUN.Abp.Identity.Security;
using LINGYUN.Abp.Identity.Settings; using LINGYUN.Abp.Identity.Settings;
using LINGYUN.Abp.WeChat.Authorization; using LINGYUN.Abp.WeChat;
using LINGYUN.Abp.WeChat.MiniProgram;
using LINGYUN.Abp.WeChat.OpenId;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Options;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Text; using System.Text;
@ -27,6 +30,7 @@ namespace LINGYUN.Abp.Account
protected IIdentityUserRepository UserRepository { get; } protected IIdentityUserRepository UserRepository { get; }
protected IUserSecurityCodeSender SecurityCodeSender { get; } protected IUserSecurityCodeSender SecurityCodeSender { get; }
protected IWeChatOpenIdFinder WeChatOpenIdFinder { get; } protected IWeChatOpenIdFinder WeChatOpenIdFinder { get; }
protected AbpWeChatMiniProgramOptions MiniProgramOptions { get; }
protected IDistributedCache<SmsSecurityTokenCacheItem> SecurityTokenCache { get; } protected IDistributedCache<SmsSecurityTokenCacheItem> SecurityTokenCache { get; }
@ -37,7 +41,8 @@ namespace LINGYUN.Abp.Account
IWeChatOpenIdFinder weChatOpenIdFinder, IWeChatOpenIdFinder weChatOpenIdFinder,
IIdentityUserRepository userRepository, IIdentityUserRepository userRepository,
IUserSecurityCodeSender securityCodeSender, IUserSecurityCodeSender securityCodeSender,
IDistributedCache<SmsSecurityTokenCacheItem> securityTokenCache) IDistributedCache<SmsSecurityTokenCacheItem> securityTokenCache,
IOptions<AbpWeChatMiniProgramOptions> miniProgramOptions)
{ {
TotpService = totpService; TotpService = totpService;
UserStore = userStore; UserStore = userStore;
@ -46,6 +51,7 @@ namespace LINGYUN.Abp.Account
WeChatOpenIdFinder = weChatOpenIdFinder; WeChatOpenIdFinder = weChatOpenIdFinder;
SecurityCodeSender = securityCodeSender; SecurityCodeSender = securityCodeSender;
SecurityTokenCache = securityTokenCache; SecurityTokenCache = securityTokenCache;
MiniProgramOptions = miniProgramOptions.Value;
LocalizationResource = typeof(AccountResource); LocalizationResource = typeof(AccountResource);
} }
@ -55,9 +61,9 @@ namespace LINGYUN.Abp.Account
ThowIfInvalidEmailAddress(input.EmailAddress); ThowIfInvalidEmailAddress(input.EmailAddress);
await CheckSelfRegistrationAsync(); await CheckSelfRegistrationAsync();
var wehchatOpenId = await WeChatOpenIdFinder.FindAsync(input.Code); var wehchatOpenId = await WeChatOpenIdFinder.FindAsync(input.Code, MiniProgramOptions.AppId, MiniProgramOptions.AppSecret);
var user = await UserManager.FindByLoginAsync(AbpWeChatAuthorizationConsts.ProviderKey, wehchatOpenId.OpenId); var user = await UserManager.FindByLoginAsync(AbpWeChatMiniProgramConsts.ProviderKey, wehchatOpenId.OpenId);
if (user != null) if (user != null)
{ {
// 应该要抛出微信号已注册异常,而不是直接返回注册用户数据,否则造成用户信息泄露 // 应该要抛出微信号已注册异常,而不是直接返回注册用户数据,否则造成用户信息泄露
@ -80,7 +86,7 @@ namespace LINGYUN.Abp.Account
(await UserManager.AddDefaultRolesAsync(user)).CheckErrors(); (await UserManager.AddDefaultRolesAsync(user)).CheckErrors();
var userLogin = new UserLoginInfo(AbpWeChatAuthorizationConsts.ProviderKey, wehchatOpenId.OpenId, AbpWeChatAuthorizationConsts.DisplayName); var userLogin = new UserLoginInfo(AbpWeChatMiniProgramConsts.ProviderKey, wehchatOpenId.OpenId, AbpWeChatGlobalConsts.DisplayName);
(await UserManager.AddLoginAsync(user, userLogin)).CheckErrors(); (await UserManager.AddLoginAsync(user, userLogin)).CheckErrors();
await CurrentUnitOfWork.SaveChangesAsync(); await CurrentUnitOfWork.SaveChangesAsync();

24
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN.Abp.IdentityServer.WeChat.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\IdentityServer\WeChat\Localization\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\IdentityServer\WeChat\Localization\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="3.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\wechat\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj" />
<ProjectReference Include="..\..\wechat\LINGYUN.Abp.WeChat.Official\LINGYUN.Abp.WeChat.Official.csproj" />
</ItemGroup>
</Project>

54
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/AbpIdentityServerWeChatModule.cs

@ -0,0 +1,54 @@
using LINGYUN.Abp.IdentityServer.WeChat.MiniProgram;
using LINGYUN.Abp.IdentityServer.WeChat.Official;
using LINGYUN.Abp.WeChat.MiniProgram;
using LINGYUN.Abp.WeChat.Official;
using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.IdentityServer;
using Volo.Abp.IdentityServer.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.IdentityServer.WeChat
{
[DependsOn(
typeof(AbpWeChatOfficialModule),
typeof(AbpWeChatMiniProgramModule),
typeof(AbpIdentityServerDomainModule))]
public class AbpIdentityServerWeChatModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
PreConfigure<IIdentityServerBuilder>(builder =>
{
builder.AddProfileService<WeChatMiniProgramProfileService>();
// TODO: 两个类型不通用配置项,不然只需要一个
builder.AddExtensionGrantValidator<WeChatMiniProgramGrantValidator>();
builder.AddExtensionGrantValidator<WeChatOfficialGrantValidator>();
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpIdentityServerWeChatModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<AbpIdentityServerResource>()
.AddVirtualJson("/LINGYUN/Abp/IdentityServer/WeChat/Localization");
});
context.Services
.AddAuthentication()
.AddWeChat();
}
}
}

9
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/IWeChatResourceDataSeeder.cs

@ -0,0 +1,9 @@
using System.Threading.Tasks;
namespace LINGYUN.Abp.IdentityServer
{
public interface IWeChatResourceDataSeeder
{
Task CreateStandardResourcesAsync();
}
}

10
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Localization/en.json

@ -0,0 +1,10 @@
{
"culture": "en",
"texts": {
"SelfRegistrationDisabledMessage": "Self-registration is disabled for this application. Please contact the application administrator to register a new user.",
"InvalidGrant:GrantTypeInvalid": "The type of authorization that is not allowed!",
"InvalidGrant:WeChatTokenInvalid": "WeChat authentication failed!",
"InvalidGrant:WeChatCodeNotFound": "The code obtained when WeChat is logged in is empty or does not exist!",
"InvalidGrant:WeChatNotRegister": "User WeChat account not registed!"
}
}

10
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Localization/zh-Hans.json

@ -0,0 +1,10 @@
{
"culture": "zh-Hans",
"texts": {
"SelfRegistrationDisabledMessage": "应用程序未开放注册,请联系管理员添加新用户.",
"InvalidGrant:GrantTypeInvalid": "不被允许的授权类型!",
"InvalidGrant:WeChatTokenInvalid": "微信认证失败!",
"InvalidGrant:WeChatCodeNotFound": "微信登录时获取的 code 为空或不存在!",
"InvalidGrant:WeChatNotRegister": "用户微信账号未绑定!"
}
}

118
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/MiniProgram/WeChatMiniProgramGrantValidator.cs

@ -0,0 +1,118 @@
using IdentityModel;
using IdentityServer4.Events;
using IdentityServer4.Models;
using IdentityServer4.Services;
using IdentityServer4.Validation;
using LINGYUN.Abp.WeChat;
using LINGYUN.Abp.WeChat.MiniProgram;
using LINGYUN.Abp.WeChat.OpenId;
using LINGYUN.Abp.WeChat.Security.Claims;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Security.Claims;
using System.Threading.Tasks;
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer.Localization;
using Volo.Abp.Security.Claims;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace LINGYUN.Abp.IdentityServer.WeChat.MiniProgram
{
/// <summary>
/// 对于小程序绑定用户的扩展授权验证器
/// </summary>
public class WeChatMiniProgramGrantValidator : IExtensionGrantValidator
{
protected ILogger<WeChatMiniProgramGrantValidator> Logger { get; }
protected AbpWeChatMiniProgramOptions Options { get; }
protected IHttpClientFactory HttpClientFactory{ get; }
protected IEventService EventService { get; }
protected IWeChatOpenIdFinder WeChatOpenIdFinder { get; }
protected IIdentityUserRepository UserRepository { get; }
protected UserManager<IdentityUser> UserManager { get; }
protected SignInManager<IdentityUser> SignInManager { get; }
protected IStringLocalizer<AbpIdentityServerResource> Localizer { get; }
protected PhoneNumberTokenProvider<IdentityUser> PhoneNumberTokenProvider { get; }
public WeChatMiniProgramGrantValidator(
IEventService eventService,
IWeChatOpenIdFinder weChatOpenIdFinder,
IHttpClientFactory httpClientFactory,
UserManager<IdentityUser> userManager,
IIdentityUserRepository userRepository,
SignInManager<IdentityUser> signInManager,
IStringLocalizer<AbpIdentityServerResource> stringLocalizer,
PhoneNumberTokenProvider<IdentityUser> phoneNumberTokenProvider,
IOptions<AbpWeChatMiniProgramOptions> options,
ILogger<WeChatMiniProgramGrantValidator> logger)
{
Logger = logger;
Options = options.Value;
EventService = eventService;
UserManager = userManager;
SignInManager = signInManager;
Localizer = stringLocalizer;
UserRepository = userRepository;
WeChatOpenIdFinder = weChatOpenIdFinder;
HttpClientFactory = httpClientFactory;
PhoneNumberTokenProvider = phoneNumberTokenProvider;
}
public string GrantType => AbpWeChatMiniProgramConsts.GrantType;
public async Task ValidateAsync(ExtensionGrantValidationContext context)
{
var raw = context.Request.Raw;
var credential = raw.Get(OidcConstants.TokenRequest.GrantType);
if (credential == null || !credential.Equals(GrantType))
{
Logger.LogWarning("Invalid grant type: not allowed");
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
Localizer["InvalidGrant:GrantTypeInvalid"]);
return;
}
// TODO: 统一命名规范, 微信认证传递的 code 改为 WeChatOpenIdConsts.WeCahtCodeKey
var wechatCode = raw.Get(AbpWeChatGlobalConsts.TokenName);
if (wechatCode.IsNullOrWhiteSpace() || wechatCode.IsNullOrWhiteSpace())
{
Logger.LogWarning("Invalid grant type: wechat code not found");
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
Localizer["InvalidGrant:WeChatCodeNotFound"]);
return;
}
var wechatOpenId = await WeChatOpenIdFinder.FindAsync(wechatCode, Options.AppId, Options.AppSecret);
// 如果存在 UnionId优先使用
var currentUser = await UserManager.FindByLoginAsync(AbpWeChatMiniProgramConsts.ProviderKey, wechatOpenId.UnionId ?? wechatOpenId.OpenId);
if(currentUser == null)
{
Logger.LogWarning("Invalid grant type: wechat openid: {0} not register", wechatOpenId.OpenId);
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
Localizer["InvalidGrant:WeChatNotRegister"]);
return;
}
var sub = await UserManager.GetUserIdAsync(currentUser);
var additionalClaims = new List<Claim>();
if (currentUser.TenantId.HasValue)
{
additionalClaims.Add(new Claim(AbpClaimTypes.TenantId, currentUser.TenantId?.ToString()));
}
additionalClaims.Add(new Claim(AbpWeChatClaimTypes.OpenId, wechatOpenId.OpenId));
if (!wechatOpenId.UnionId.IsNullOrWhiteSpace())
{
additionalClaims.Add(new Claim(AbpWeChatClaimTypes.UnionId, wechatOpenId.UnionId));
}
await EventService.RaiseAsync(new UserLoginSuccessEvent(currentUser.UserName, wechatOpenId.OpenId, null));
context.Result = new GrantValidationResult(sub,
AbpWeChatMiniProgramConsts.AuthenticationMethod, additionalClaims.ToArray());
}
}
}

61
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/MiniProgram/WeChatMiniProgramProfileService.cs

@ -0,0 +1,61 @@
using IdentityServer4.AspNetIdentity;
using IdentityServer4.Models;
using LINGYUN.Abp.WeChat.Security.Claims;
using Microsoft.AspNetCore.Identity;
using System.Linq;
using System.Security.Principal;
using System.Threading.Tasks;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Uow;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace LINGYUN.Abp.IdentityServer.WeChat.MiniProgram
{
public class WeChatMiniProgramProfileService : ProfileService<IdentityUser>
{
protected ICurrentTenant CurrentTenant { get; }
public WeChatMiniProgramProfileService(
IdentityUserManager userManager,
IUserClaimsPrincipalFactory<IdentityUser> claimsFactory,
ICurrentTenant currentTenant)
: base(userManager, claimsFactory)
{
CurrentTenant = currentTenant;
}
[UnitOfWork]
public override async Task GetProfileDataAsync(ProfileDataRequestContext context)
{
using (CurrentTenant.Change(context.Subject.FindTenantId()))
{
await base.GetProfileDataAsync(context);
// TODO: 可以从令牌获取openid, 安全性呢?
TryAddWeChatClaim(context, AbpWeChatClaimTypes.OpenId);
TryAddWeChatClaim(context, AbpWeChatClaimTypes.UnionId);
}
}
[UnitOfWork]
public override async Task IsActiveAsync(IsActiveContext context)
{
using (CurrentTenant.Change(context.Subject.FindTenantId()))
{
await base.IsActiveAsync(context);
}
}
protected virtual void TryAddWeChatClaim(ProfileDataRequestContext context, string weChatClaimType)
{
if (context.RequestedClaimTypes.Any(rc => rc.Contains(weChatClaimType)))
{
var weChatClaim = context.Subject.FindFirst(weChatClaimType);
if (weChatClaim != null)
{
context.IssuedClaims.Add(weChatClaim);
}
}
}
}
}

117
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Official/WeChatOfficialGrantValidator.cs

@ -0,0 +1,117 @@
using IdentityModel;
using IdentityServer4.Events;
using IdentityServer4.Models;
using IdentityServer4.Services;
using IdentityServer4.Validation;
using LINGYUN.Abp.WeChat;
using LINGYUN.Abp.WeChat.Official;
using LINGYUN.Abp.WeChat.OpenId;
using LINGYUN.Abp.WeChat.Security.Claims;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Security.Claims;
using System.Threading.Tasks;
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer.Localization;
using Volo.Abp.Security.Claims;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace LINGYUN.Abp.IdentityServer.WeChat.Official
{
/// <summary>
/// 对于公众平台绑定用户的扩展授权验证器
/// </summary>
public class WeChatOfficialGrantValidator : IExtensionGrantValidator
{
protected ILogger<WeChatOfficialGrantValidator> Logger { get; }
protected AbpWeChatOfficialOptions Options { get; }
protected IHttpClientFactory HttpClientFactory { get; }
protected IEventService EventService { get; }
protected IWeChatOpenIdFinder WeChatOpenIdFinder { get; }
protected IIdentityUserRepository UserRepository { get; }
protected UserManager<IdentityUser> UserManager { get; }
protected SignInManager<IdentityUser> SignInManager { get; }
protected IStringLocalizer<AbpIdentityServerResource> Localizer { get; }
protected PhoneNumberTokenProvider<IdentityUser> PhoneNumberTokenProvider { get; }
public WeChatOfficialGrantValidator(
IEventService eventService,
IWeChatOpenIdFinder weChatOpenIdFinder,
IHttpClientFactory httpClientFactory,
UserManager<IdentityUser> userManager,
IIdentityUserRepository userRepository,
SignInManager<IdentityUser> signInManager,
IStringLocalizer<AbpIdentityServerResource> stringLocalizer,
PhoneNumberTokenProvider<IdentityUser> phoneNumberTokenProvider,
IOptions<AbpWeChatOfficialOptions> options,
ILogger<WeChatOfficialGrantValidator> logger)
{
Logger = logger;
Options = options.Value;
EventService = eventService;
UserManager = userManager;
SignInManager = signInManager;
Localizer = stringLocalizer;
UserRepository = userRepository;
WeChatOpenIdFinder = weChatOpenIdFinder;
HttpClientFactory = httpClientFactory;
PhoneNumberTokenProvider = phoneNumberTokenProvider;
}
public string GrantType => AbpWeChatOfficialConsts.GrantType;
public async Task ValidateAsync(ExtensionGrantValidationContext context)
{
var raw = context.Request.Raw;
var credential = raw.Get(OidcConstants.TokenRequest.GrantType);
if (credential == null || !credential.Equals(GrantType))
{
Logger.LogWarning("Invalid grant type: not allowed");
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
Localizer["InvalidGrant:GrantTypeInvalid"]);
return;
}
// TODO: 统一命名规范, 微信认证传递的 code 改为 WeChatOpenIdConsts.WeCahtCodeKey
var wechatCode = raw.Get(AbpWeChatGlobalConsts.TokenName);
if (wechatCode.IsNullOrWhiteSpace() || wechatCode.IsNullOrWhiteSpace())
{
Logger.LogWarning("Invalid grant type: wechat code not found");
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
Localizer["InvalidGrant:WeChatCodeNotFound"]);
return;
}
var wechatOpenId = await WeChatOpenIdFinder.FindAsync(wechatCode, Options.AppId, Options.AppSecret);
var currentUser = await UserManager.FindByLoginAsync(AbpWeChatOfficialConsts.ProviderKey, wechatOpenId.OpenId);
if (currentUser == null)
{
Logger.LogWarning("Invalid grant type: wechat openid: {0} not register", wechatOpenId.OpenId);
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant,
Localizer["InvalidGrant:WeChatNotRegister"]);
return;
}
var sub = await UserManager.GetUserIdAsync(currentUser);
var additionalClaims = new List<Claim>();
if (currentUser.TenantId.HasValue)
{
additionalClaims.Add(new Claim(AbpClaimTypes.TenantId, currentUser.TenantId?.ToString()));
}
additionalClaims.Add(new Claim(AbpWeChatClaimTypes.OpenId, wechatOpenId.OpenId));
if (!wechatOpenId.UnionId.IsNullOrWhiteSpace())
{
additionalClaims.Add(new Claim(AbpWeChatClaimTypes.UnionId, wechatOpenId.UnionId));
}
await EventService.RaiseAsync(new UserLoginSuccessEvent(currentUser.UserName, wechatOpenId.OpenId, null));
context.Result = new GrantValidationResult(sub,
AbpWeChatOfficialConsts.AuthenticationMethod, additionalClaims.ToArray());
}
}
}

71
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Official/WeChatOfficialOAuthConsts.cs

@ -0,0 +1,71 @@
using LINGYUN.Abp.WeChat;
using LINGYUN.Abp.WeChat.Official;
namespace LINGYUN.Abp.IdentityServer.WeChat.Official
{
/// <summary>
/// 与微信公众号认证相关的静态(可变)常量
/// </summary>
public static class WeChatOfficialOAuthConsts
{
/// <summary>
/// 微信个人信息标识
/// </summary>
public static string ProfileKey { get; set; } = "wechat.profile";
/// <summary>
/// 微信提供者标识
/// </summary>
public static string ProviderKey => AbpWeChatOfficialConsts.ProviderKey;
/// <summary>
/// 微信提供者显示名称
/// </summary>
public static string DisplayName => AbpWeChatGlobalConsts.DisplayName;
/// <summary>
/// 回调地址
/// </summary>
public static string CallbackPath { get; set; } = "/signin-wechat";
/// <summary>
/// 微信客户端外的网页登录
/// </summary>
public const string QrConnectEndpoint = "https://open.weixin.qq.com/connect/qrconnect";
/// <summary>
/// 微信客户端内的网页登录
/// </summary>
public const string AuthorizationEndpoint = "https://open.weixin.qq.com/connect/oauth2/authorize";
/// <summary>
/// 用户允许授权后通过返回的code换取access_token地址
/// </summary>
public const string TokenEndpoint = "https://api.weixin.qq.com/sns/oauth2/access_token";
/// <summary>
/// 使用access_token获取用户个人信息地址
/// </summary>
public const string UserInformationEndpoint = "https://api.weixin.qq.com/sns/userinfo";
/// <summary>
/// 弹出授权页面,可通过openid拿到昵称、性别、所在地。
/// 并且, 即使在未关注的情况下,只要用户授权,也能获取其信息
/// <br />
/// <br />
/// 详询: <see cref="https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html"/>
/// </summary>
/// <remarks>
/// 以snsapi_userinfo为scope发起的网页授权,是用来获取用户的基本信息的。
/// 但这种授权需要用户手动同意,并且由于用户同意过,所以无须关注,就可在授权后获取该用户的基本信息
/// </remarks>
public const string UserInfoScope = "snsapi_userinfo";
/// <summary>
/// 不弹出授权页面,直接跳转,只能获取用户openid
/// <br />
/// <br />
/// 详询: <see cref="https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html"/>
/// </summary>
/// <remarks>
/// 以snsapi_base为scope发起的网页授权,是用来获取进入页面的用户的openid的,并且是静默授权并自动跳转到回调页的。
/// 用户感知的就是直接进入了回调页(往往是业务页面)
/// </remarks>
public const string LoginScope = "snsapi_login";
}
}

75
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/Official/WeChatOfficialSignatureMiddleware.cs

@ -0,0 +1,75 @@
using LINGYUN.Abp.WeChat.Official;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using System;
using System.Collections;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.IdentityServer.WeChat.Official
{
public class WeChatOfficialSignatureMiddleware : IMiddleware, ITransientDependency
{
protected AbpWeChatOfficialOptions Options { get; }
public WeChatOfficialSignatureMiddleware(IOptions<AbpWeChatOfficialOptions> options)
{
Options = options.Value;
}
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
if (context.Request.Path.HasValue)
{
var requestPath = context.Request.Path.Value;
// 访问地址是否与定义的地址匹配
if (requestPath.Equals(Options.Url))
{
var timestamp = context.Request.Query["timestamp"];
var nonce = context.Request.Query["nonce"];
var signature = context.Request.Query["signature"];
var echostr = context.Request.Query["echostr"];
// 验证消息合法性
var check = CheckWeChatSignature(Options.Token, timestamp, nonce, signature);
if (check)
{
// 验证通过需要把微信服务器传递的字符原封不动传回
await context.Response.WriteAsync(echostr);
return;
}
// 微信消息验证不通过
throw new AbpException("Invalid wechat signature");
}
}
// 不属于微信的消息进入下一个中间件
await next(context);
}
protected bool CheckWeChatSignature(string token, string timestamp, string nonce, string signature)
{
var al = new ArrayList
{
token,
timestamp,
nonce
};
// step1 排序
al.Sort();
string signatureStr = string.Empty;
// step2 拼接
for (int i = 0; i < al.Count; i++)
{
signatureStr += al[i];
}
// step3 SHA1加密
byte[] bytes_out = signatureStr.Sha1();
string result = BitConverter.ToString(bytes_out).Replace("-", "");
// step4 比对
if (result.Equals(signature, StringComparison.CurrentCultureIgnoreCase))
{
return true;
}
return false;
}
}
}

86
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/LINGYUN/Abp/IdentityServer/WeChat/WeChatResourceDataSeeder.cs

@ -0,0 +1,86 @@
using LINGYUN.Abp.IdentityServer.WeChat.Official;
using LINGYUN.Abp.WeChat.Security.Claims;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer.IdentityResources;
namespace LINGYUN.Abp.IdentityServer
{
public class WeChatResourceDataSeeder : IWeChatResourceDataSeeder, ITransientDependency
{
protected IIdentityClaimTypeRepository ClaimTypeRepository { get; }
protected IIdentityResourceRepository IdentityResourceRepository { get; }
protected IGuidGenerator GuidGenerator { get; }
public WeChatResourceDataSeeder(
IIdentityResourceRepository identityResourceRepository,
IGuidGenerator guidGenerator,
IIdentityClaimTypeRepository claimTypeRepository)
{
IdentityResourceRepository = identityResourceRepository;
GuidGenerator = guidGenerator;
ClaimTypeRepository = claimTypeRepository;
}
public virtual async Task CreateStandardResourcesAsync()
{
var wechatClaimTypes = new string[]
{
AbpWeChatClaimTypes.AvatarUrl,
AbpWeChatClaimTypes.City,
AbpWeChatClaimTypes.Country,
AbpWeChatClaimTypes.NickName,
AbpWeChatClaimTypes.OpenId,
AbpWeChatClaimTypes.Privilege,
AbpWeChatClaimTypes.Province,
AbpWeChatClaimTypes.Sex,
AbpWeChatClaimTypes.UnionId
};
var wechatResource = new IdentityServer4.Models.IdentityResource(
WeChatOfficialOAuthConsts.ProfileKey,
WeChatOfficialOAuthConsts.DisplayName,
wechatClaimTypes);
foreach (var claimType in wechatClaimTypes)
{
await AddClaimTypeIfNotExistsAsync(claimType);
}
await AddIdentityResourceIfNotExistsAsync(wechatResource);
}
protected virtual async Task AddIdentityResourceIfNotExistsAsync(IdentityServer4.Models.IdentityResource resource)
{
if (await IdentityResourceRepository.CheckNameExistAsync(resource.Name))
{
return;
}
await IdentityResourceRepository.InsertAsync(
new IdentityResource(
GuidGenerator.Create(),
resource
)
);
}
protected virtual async Task AddClaimTypeIfNotExistsAsync(string claimType)
{
if (await ClaimTypeRepository.AnyAsync(claimType))
{
return;
}
await ClaimTypeRepository.InsertAsync(
new IdentityClaimType(
GuidGenerator.Create(),
claimType,
isStatic: true
)
);
}
}
}

331
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthHandler.cs

@ -0,0 +1,331 @@
using LINGYUN.Abp.IdentityServer.WeChat.Official;
using LINGYUN.Abp.WeChat.Official;
using Microsoft.AspNetCore.Authentication.OAuth;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;
using Microsoft.Net.Http.Headers;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Net.Http;
using System.Security.Claims;
using System.Text;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Threading.Tasks;
using Volo.Abp.Caching;
namespace Microsoft.AspNetCore.Authentication.WeChat.Official
{
/// <summary>
/// 网页授权只有公众平台的实现
/// </summary>
public class WeChatOfficialOAuthHandler : OAuthHandler<WeChatOfficialOAuthOptions>
{
protected IDistributedCache<WeChatOfficialStateCacheItem> Cache { get; }
protected AbpWeChatOfficialOptions WeChatOfficialOptions { get; }
public WeChatOfficialOAuthHandler(
IDistributedCache<WeChatOfficialStateCacheItem> cache,
IOptionsMonitor<WeChatOfficialOAuthOptions> options,
IOptions<AbpWeChatOfficialOptions> weChatOfficialOptions,
ILoggerFactory logger,
UrlEncoder encoder,
ISystemClock clock)
: base(options, logger, encoder, clock)
{
Cache = cache;
WeChatOfficialOptions = weChatOfficialOptions.Value;
}
protected override Task InitializeHandlerAsync()
{
// 用配置项重写
Options.ClientId = WeChatOfficialOptions.AppId;
Options.ClientSecret = WeChatOfficialOptions.AppSecret;
return base.InitializeHandlerAsync();
}
protected override async Task<AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens)
{
var address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string>
{
["access_token"] = tokens.AccessToken,
["openid"] = tokens.Response.GetRootString("openid")
});
var response = await Backchannel.GetAsync(address);
if (!response.IsSuccessStatusCode)
{
Logger.LogError("An error occurred while retrieving the user profile: the remote server " +
"returned a {Status} response with the following payload: {Headers} {Body}.",
/* Status: */ response.StatusCode,
/* Headers: */ response.Headers.ToString(),
/* Body: */ await response.Content.ReadAsStringAsync());
throw new HttpRequestException("An error occurred while retrieving user information.");
}
var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
if (!string.IsNullOrEmpty(payload.GetRootString("errcode")))
{
Logger.LogError("An error occurred while retrieving the user profile: the remote server " +
"returned a {Status} response with the following payload: {Headers} {Body}.",
/* Status: */ response.StatusCode,
/* Headers: */ response.Headers.ToString(),
/* Body: */ await response.Content.ReadAsStringAsync());
throw new HttpRequestException("An error occurred while retrieving user information.");
}
var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
context.RunClaimActions();
await Events.CreatingTicket(context);
// TODO: 此处通过唯一的 CorrelationId, 将 properties生成的State缓存删除
var state = Request.Query["state"];
var stateCacheKey = WeChatOfficialStateCacheItem.CalculateCacheKey(state, null);
await Cache.RemoveAsync(stateCacheKey, token: Context.RequestAborted);
return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
}
/// <summary>
/// code换取access_token
/// </summary>
protected override async Task<OAuthTokenResponse> ExchangeCodeAsync(OAuthCodeExchangeContext context)
{
var address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary<string, string>()
{
["appid"] = Options.ClientId,
["secret"] = Options.ClientSecret,
["code"] = context.Code,
["grant_type"] = "authorization_code"
});
var response = await Backchannel.GetAsync(address);
if (!response.IsSuccessStatusCode)
{
Logger.LogError("An error occurred while retrieving an access token: the remote server " +
"returned a {Status} response with the following payload: {Headers} {Body}.",
/* Status: */ response.StatusCode,
/* Headers: */ response.Headers.ToString(),
/* Body: */ await response.Content.ReadAsStringAsync());
return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token."));
}
var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
if (!string.IsNullOrEmpty(payload.GetRootString("errcode")))
{
Logger.LogError("An error occurred while retrieving an access token: the remote server " +
"returned a {Status} response with the following payload: {Headers} {Body}.",
/* Status: */ response.StatusCode,
/* Headers: */ response.Headers.ToString(),
/* Body: */ await response.Content.ReadAsStringAsync());
return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token."));
}
return OAuthTokenResponse.Success(payload);
}
protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
{
await base.HandleChallengeAsync(properties);
// TODO: 此处已经生成唯一的 CorrelationId, 可以借此将 properties生成State之后再进行缓存
var state = properties.Items[".xsrf"];
var stateToken = Options.StateDataFormat.Protect(properties);
var stateCacheKey = WeChatOfficialStateCacheItem.CalculateCacheKey(state, null);
await Cache
.SetAsync(
stateCacheKey,
new WeChatOfficialStateCacheItem(stateToken),
new DistributedCacheEntryOptions
{
AbsoluteExpiration = Clock.UtcNow.AddMinutes(2) // TODO: 设定2分钟过期?
},
token: Context.RequestAborted);
}
/// <summary>
/// 构建用户授权地址
/// </summary>
protected override string BuildChallengeUrl(AuthenticationProperties properties, string redirectUri)
{
var state = properties.Items[".xsrf"];
var isWeChatBrewserRequest = IsWeChatBrowser();
var scope = isWeChatBrewserRequest
? WeChatOfficialOAuthConsts.UserInfoScope
: FormatScope();
var endPoint = isWeChatBrewserRequest
? Options.AuthorizationEndpoint
: WeChatOfficialOAuthConsts.QrConnectEndpoint;
var challengeUrl = QueryHelpers.AddQueryString(endPoint, new Dictionary<string, string>
{
["appid"] = Options.ClientId,
["redirect_uri"] = redirectUri,
["response_type"] = "code"
});
challengeUrl += $"&scope={scope}&state={state}";
return challengeUrl;
}
protected override async Task<HandleRequestResult> HandleRemoteAuthenticateAsync()
{
var query = Request.Query;
// TODO: 此处借用唯一的 CorrelationId, 将 properties生成的State缓存取出,进行解密
var state = query["state"];
var stateCacheKey = WeChatOfficialStateCacheItem.CalculateCacheKey(state, null);
var stateCacheItem = await Cache.GetAsync(stateCacheKey, token: Context.RequestAborted);
var properties = Options.StateDataFormat.Unprotect(stateCacheItem.State);
if (properties == null)
{
return HandleRequestResult.Fail("The oauth state was missing or invalid.");
}
// OAuth2 10.12 CSRF
if (!ValidateCorrelationId(properties))
{
return HandleRequestResult.Fail("Correlation failed.", properties);
}
var error = query["error"];
if (!StringValues.IsNullOrEmpty(error))
{
// Note: access_denied errors are special protocol errors indicating the user didn't
// approve the authorization demand requested by the remote authorization server.
// Since it's a frequent scenario (that is not caused by incorrect configuration),
// denied errors are handled differently using HandleAccessDeniedErrorAsync().
// Visit https://tools.ietf.org/html/rfc6749#section-4.1.2.1 for more information.
var errorDescription = query["error_description"];
var errorUri = query["error_uri"];
if (StringValues.Equals(error, "access_denied"))
{
var result = await HandleAccessDeniedErrorAsync(properties);
if (!result.None)
{
return result;
}
var deniedEx = new Exception("Access was denied by the resource owner or by the remote server.");
deniedEx.Data["error"] = error.ToString();
deniedEx.Data["error_description"] = errorDescription.ToString();
deniedEx.Data["error_uri"] = errorUri.ToString();
return HandleRequestResult.Fail(deniedEx, properties);
}
var failureMessage = new StringBuilder();
failureMessage.Append(error);
if (!StringValues.IsNullOrEmpty(errorDescription))
{
failureMessage.Append(";Description=").Append(errorDescription);
}
if (!StringValues.IsNullOrEmpty(errorUri))
{
failureMessage.Append(";Uri=").Append(errorUri);
}
var ex = new Exception(failureMessage.ToString());
ex.Data["error"] = error.ToString();
ex.Data["error_description"] = errorDescription.ToString();
ex.Data["error_uri"] = errorUri.ToString();
return HandleRequestResult.Fail(ex, properties);
}
var code = query["code"];
if (StringValues.IsNullOrEmpty(code))
{
return HandleRequestResult.Fail("Code was not found.", properties);
}
var codeExchangeContext = new OAuthCodeExchangeContext(properties, code, BuildRedirectUri(Options.CallbackPath));
using var tokens = await ExchangeCodeAsync(codeExchangeContext);
if (tokens.Error != null)
{
return HandleRequestResult.Fail(tokens.Error, properties);
}
if (string.IsNullOrEmpty(tokens.AccessToken))
{
return HandleRequestResult.Fail("Failed to retrieve access token.", properties);
}
var identity = new ClaimsIdentity(ClaimsIssuer);
if (Options.SaveTokens)
{
var authTokens = new List<AuthenticationToken>();
authTokens.Add(new AuthenticationToken { Name = "access_token", Value = tokens.AccessToken });
if (!string.IsNullOrEmpty(tokens.RefreshToken))
{
authTokens.Add(new AuthenticationToken { Name = "refresh_token", Value = tokens.RefreshToken });
}
if (!string.IsNullOrEmpty(tokens.TokenType))
{
authTokens.Add(new AuthenticationToken { Name = "token_type", Value = tokens.TokenType });
}
if (!string.IsNullOrEmpty(tokens.ExpiresIn))
{
int value;
if (int.TryParse(tokens.ExpiresIn, NumberStyles.Integer, CultureInfo.InvariantCulture, out value))
{
// https://www.w3.org/TR/xmlschema-2/#dateTime
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
var expiresAt = Clock.UtcNow + TimeSpan.FromSeconds(value);
authTokens.Add(new AuthenticationToken
{
Name = "expires_at",
Value = expiresAt.ToString("o", CultureInfo.InvariantCulture)
});
}
}
properties.StoreTokens(authTokens);
}
var ticket = await CreateTicketAsync(identity, properties, tokens);
if (ticket != null)
{
return HandleRequestResult.Success(ticket);
}
else
{
return HandleRequestResult.Fail("Failed to retrieve user information from remote server.", properties);
}
}
protected override string FormatScope()
{
return string.Join(",", Options.Scope);
}
protected virtual bool IsWeChatBrowser()
{
var userAgent = Request.Headers[HeaderNames.UserAgent].ToString();
return userAgent.Contains("micromessenger", StringComparison.InvariantCultureIgnoreCase);
}
}
}

47
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthOptions.cs

@ -0,0 +1,47 @@
using LINGYUN.Abp.IdentityServer.WeChat.Official;
using LINGYUN.Abp.WeChat.Security.Claims;
using Microsoft.AspNetCore.Authentication.OAuth;
using Microsoft.AspNetCore.Http;
using System.Security.Claims;
using System.Text.Json;
namespace Microsoft.AspNetCore.Authentication.WeChat.Official
{
public class WeChatOfficialOAuthOptions : OAuthOptions
{
public WeChatOfficialOAuthOptions()
{
// 用于防止初始化错误
ClientId = "WeChatOfficial";
ClientSecret = "WeChatOfficial";
ClaimsIssuer = WeChatOfficialOAuthConsts.ProviderKey;
CallbackPath = new PathString(WeChatOfficialOAuthConsts.CallbackPath);
AuthorizationEndpoint = WeChatOfficialOAuthConsts.AuthorizationEndpoint;
TokenEndpoint = WeChatOfficialOAuthConsts.TokenEndpoint;
UserInformationEndpoint = WeChatOfficialOAuthConsts.UserInformationEndpoint;
Scope.Add(WeChatOfficialOAuthConsts.LoginScope);
Scope.Add(WeChatOfficialOAuthConsts.UserInfoScope);
// 这个原始的属性一定要写进去,框架与UserLogin.ProviderKey进行关联判断是否绑定微信
ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "openid");
ClaimActions.MapJsonKey(ClaimTypes.Name, "nickname");
// 把自定义的身份标识写进令牌
ClaimActions.MapJsonKey(AbpWeChatClaimTypes.OpenId, "openid");
ClaimActions.MapJsonKey(AbpWeChatClaimTypes.UnionId, "unionid");// 公众号如果与小程序关联,这个可以用上
ClaimActions.MapJsonKey(AbpWeChatClaimTypes.NickName, "nickname");
ClaimActions.MapJsonKey(AbpWeChatClaimTypes.Sex, "sex", ClaimValueTypes.Integer);
ClaimActions.MapJsonKey(AbpWeChatClaimTypes.Country, "country");
ClaimActions.MapJsonKey(AbpWeChatClaimTypes.Province, "province");
ClaimActions.MapJsonKey(AbpWeChatClaimTypes.City, "city");
ClaimActions.MapJsonKey(AbpWeChatClaimTypes.AvatarUrl, "headimgurl");
ClaimActions.MapCustomJson(AbpWeChatClaimTypes.Privilege, user =>
{
return string.Join(",", user.GetStrings("privilege"));
});
}
}
}

18
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialStateCacheItem.cs

@ -0,0 +1,18 @@
namespace Microsoft.AspNetCore.Authentication.WeChat.Official
{
public class WeChatOfficialStateCacheItem
{
public string State { get; set; }
public WeChatOfficialStateCacheItem() { }
public WeChatOfficialStateCacheItem(string state)
{
State = state;
}
public static string CalculateCacheKey(string correlationId, string purpose)
{
return $"ci:{correlationId};p:{purpose ?? "null"}";
}
}
}

65
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Authentication/WeChatAuthenticationExtensions.cs

@ -0,0 +1,65 @@
using LINGYUN.Abp.IdentityServer.WeChat.Official;
using LINGYUN.Abp.WeChat;
using Microsoft.AspNetCore.Authentication.WeChat.Official;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace Microsoft.AspNetCore.Authentication
{
public static class WeChatAuthenticationExtensions
{
/// <summary>
/// </summary>
public static AuthenticationBuilder AddWeChat(
this AuthenticationBuilder builder)
{
return builder
.AddWeChat(
AbpWeChatGlobalConsts.AuthenticationScheme,
AbpWeChatGlobalConsts.DisplayName,
options => { });
}
/// <summary>
/// </summary>
public static AuthenticationBuilder AddWeChat(
this AuthenticationBuilder builder,
Action<WeChatOfficialOAuthOptions> configureOptions)
{
return builder
.AddWeChat(
AbpWeChatGlobalConsts.AuthenticationScheme,
AbpWeChatGlobalConsts.DisplayName,
configureOptions);
}
/// <summary>
/// </summary>
public static AuthenticationBuilder AddWeChat(
this AuthenticationBuilder builder,
string authenticationScheme,
Action<WeChatOfficialOAuthOptions> configureOptions)
{
return builder
.AddWeChat(
authenticationScheme,
WeChatOfficialOAuthConsts.DisplayName,
configureOptions);
}
/// <summary>
/// </summary>
public static AuthenticationBuilder AddWeChat(
this AuthenticationBuilder builder,
string authenticationScheme,
string displayName,
Action<WeChatOfficialOAuthOptions> configureOptions)
{
return builder
.AddOAuth<WeChatOfficialOAuthOptions, WeChatOfficialOAuthHandler>(
authenticationScheme,
displayName,
configureOptions);
}
}
}

22
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/Microsoft/AspNetCore/Builder/IdentityServerApplicationBuilderExtensions.cs

@ -0,0 +1,22 @@
using LINGYUN.Abp.IdentityServer.WeChat.Official;
namespace Microsoft.AspNetCore.Builder
{
public static class IdentityServerApplicationBuilderExtensions
{
/// <summary>
/// 启用中间件可以处理微信服务器消息
/// 用于验证消息是否来自于微信服务器
/// </summary>
/// <param name="builder"></param>
/// <remarks>
/// 也可以用Controller的形式来实现
/// </remarks>
/// <returns></returns>
public static IApplicationBuilder UseWeChatSignature(this IApplicationBuilder builder)
{
builder.UseMiddleware<WeChatOfficialSignatureMiddleware>();
return builder;
}
}
}

16
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/System/BytesExtensions.cs

@ -0,0 +1,16 @@
using System.Security.Cryptography;
namespace System
{
internal static class BytesExtensions
{
public static byte[] Sha1(this byte[] data)
{
using (var sha = SHA1.Create())
{
var hashBytes = sha.ComputeHash(data);
return hashBytes;
}
}
}
}

17
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/System/StringExtensions.cs

@ -0,0 +1,17 @@
using System.Security.Cryptography;
using System.Text;
namespace System
{
internal static class StringExtensions
{
public static byte[] Sha1(this string str)
{
using (var sha = SHA1.Create())
{
var hashBytes = sha.ComputeHash(Encoding.ASCII.GetBytes(str));
return hashBytes;
}
}
}
}

63
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat/System/Text/Json/JsonElementExtensions.cs

@ -0,0 +1,63 @@
using System.Collections.Generic;
namespace System.Text.Json
{
internal static class JsonElementExtensions
{
public static IEnumerable<string> GetRootStrings(this JsonDocument json, string key)
{
return json.RootElement.GetStrings(key);
}
public static IEnumerable<string> GetStrings(this JsonElement json, string key)
{
var result = new List<string>();
if (json.TryGetProperty(key, out JsonElement property) && property.ValueKind == JsonValueKind.Array)
{
foreach (var jsonProp in property.EnumerateArray())
{
result.Add(jsonProp.GetString());
}
}
return result;
}
public static string GetRootString(this JsonDocument json, string key, string defaultValue = "")
{
if (json.RootElement.TryGetProperty(key, out JsonElement property))
{
return property.GetString();
}
return defaultValue;
}
public static string GetString(this JsonElement json, string key, string defaultValue = "")
{
if (json.TryGetProperty(key, out JsonElement property))
{
return property.GetString();
}
return defaultValue;
}
public static int GetRootInt32(this JsonDocument json, string key, int defaultValue = 0)
{
if (json.RootElement.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value))
{
return value;
}
return defaultValue;
}
public static int GetInt32(this JsonElement json, string key, int defaultValue = 0)
{
if (json.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value))
{
return value;
}
return defaultValue;
}
}
}

4
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN.Abp.IdentityServer.WeChatValidator.csproj

@ -21,10 +21,6 @@
<PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="3.3.0" /> <PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="3.3.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\wechat\LINGYUN.Abp.WeChat.Authorization\LINGYUN.Abp.WeChat.Authorization.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Microsoft\DependencyInjection\" /> <Folder Include="Microsoft\DependencyInjection\" />
</ItemGroup> </ItemGroup>

17
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/README.md

@ -0,0 +1,17 @@
# LINGYUN.Abp.IdentityServer.WeChatValidator
废弃模块,模块层次不清晰,微信有多端平台,不同平台授权规则不一致
#### 注意
## 配置使用
```csharp
[DependsOn(typeof(AbpIdentityServerWeChatValidatorModule))]
public class YouProjectModule : AbpModule
{
// other
}

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

@ -18,14 +18,14 @@ namespace LINGYUN.Abp.SettingManagement
} }
[HttpPut] [HttpPut]
[Route("by-current-tenant")] [Route("change-current-tenant")]
public virtual async Task SetCurrentTenantAsync(UpdateSettingsDto input) public virtual async Task SetCurrentTenantAsync(UpdateSettingsDto input)
{ {
await _settingAppService.SetCurrentTenantAsync(input); await _settingAppService.SetCurrentTenantAsync(input);
} }
[HttpPut] [HttpPut]
[Route("by-global")] [Route("change-global")]
public virtual async Task SetGlobalAsync(UpdateSettingsDto input) public virtual async Task SetGlobalAsync(UpdateSettingsDto input)
{ {
await _settingAppService.SetGlobalAsync(input); await _settingAppService.SetGlobalAsync(input);

2
aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat/LINGYUN.Abp.Notifications.WeChat.WeApp.csproj

@ -11,7 +11,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\common\LINGYUN.Abp.Features.LimitValidation\LINGYUN.Abp.Features.LimitValidation.csproj" /> <ProjectReference Include="..\..\common\LINGYUN.Abp.Features.LimitValidation\LINGYUN.Abp.Features.LimitValidation.csproj" />
<ProjectReference Include="..\..\common\LINGYUN.Abp.Notifications\LINGYUN.Abp.Notifications.csproj" /> <ProjectReference Include="..\..\common\LINGYUN.Abp.Notifications\LINGYUN.Abp.Notifications.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.WeChat.Authorization\LINGYUN.Abp.WeChat.Authorization.csproj" /> <ProjectReference Include="..\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

11
aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/AbpNotificationsWeChatWeAppModule.cs

@ -1,13 +1,11 @@
using LINGYUN.Abp.WeChat.Authorization; using LINGYUN.Abp.WeChat.MiniProgram;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Polly;
using System;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Notifications.WeChat.WeApp namespace LINGYUN.Abp.Notifications.WeChat.WeApp
{ {
[DependsOn( [DependsOn(
typeof(AbpWeChatAuthorizationModule), typeof(AbpWeChatMiniProgramModule),
typeof(AbpNotificationModule))] typeof(AbpNotificationModule))]
public class AbpNotificationsWeChatWeAppModule : AbpModule public class AbpNotificationsWeChatWeAppModule : AbpModule
{ {
@ -16,11 +14,6 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp
var configuration = context.Services.GetConfiguration(); var configuration = context.Services.GetConfiguration();
Configure<AbpWeChatWeAppNotificationOptions>(configuration.GetSection("Notifications:WeChat:WeApp")); Configure<AbpWeChatWeAppNotificationOptions>(configuration.GetSection("Notifications:WeChat:WeApp"));
// TODO:是否有必要启用重试机制?
context.Services.AddHttpClient(WeChatWeAppNotificationSender.SendNotificationClientName)
.AddTransientHttpErrorPolicy(builder =>
builder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))));
Configure<AbpNotificationOptions>(options => Configure<AbpNotificationOptions>(options =>
{ {
options.PublishProviders.Add<WeChatWeAppNotificationPublishProvider>(); options.PublishProviders.Add<WeChatWeAppNotificationPublishProvider>();

45
aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationPublishProvider.cs

@ -1,5 +1,6 @@
using LINGYUN.Abp.Notifications.WeChat.WeApp.Features; using LINGYUN.Abp.Notifications.WeChat.WeApp.Features;
using LINGYUN.Abp.WeChat.Authorization; using LINGYUN.Abp.WeChat.MiniProgram.Messages;
using LINGYUN.Abp.WeChat.Security.Claims;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using System; using System;
@ -19,20 +20,16 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp
private IFeatureChecker _featureChecker; private IFeatureChecker _featureChecker;
protected IFeatureChecker FeatureChecker => LazyGetRequiredService(ref _featureChecker); protected IFeatureChecker FeatureChecker => LazyGetRequiredService(ref _featureChecker);
protected ISubscribeMessager SubscribeMessager { get; }
private IUserWeChatOpenIdFinder _userWeChatOpenIdFinder;
protected IUserWeChatOpenIdFinder UserWeChatOpenIdFinder => LazyGetRequiredService(ref _userWeChatOpenIdFinder);
protected IWeChatWeAppNotificationSender NotificationSender { get; }
protected AbpWeChatWeAppNotificationOptions Options { get; } protected AbpWeChatWeAppNotificationOptions Options { get; }
public WeChatWeAppNotificationPublishProvider( public WeChatWeAppNotificationPublishProvider(
IServiceProvider serviceProvider, IServiceProvider serviceProvider,
IWeChatWeAppNotificationSender notificationSender, ISubscribeMessager subscribeMessager,
IOptions<AbpWeChatWeAppNotificationOptions> options) IOptions<AbpWeChatWeAppNotificationOptions> options)
: base(serviceProvider) : base(serviceProvider)
{ {
Options = options.Value; Options = options.Value;
NotificationSender = notificationSender; SubscribeMessager = subscribeMessager;
} }
protected override async Task PublishAsync(NotificationInfo notification, IEnumerable<UserIdentifier> identifiers, CancellationToken cancellationToken = default) protected override async Task PublishAsync(NotificationInfo notification, IEnumerable<UserIdentifier> identifiers, CancellationToken cancellationToken = default)
@ -79,22 +76,30 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp
var weAppLang = GetOrDefault(notification.Data, "WeAppLanguage", Options.DefaultWeAppLanguage); var weAppLang = GetOrDefault(notification.Data, "WeAppLanguage", Options.DefaultWeAppLanguage);
Logger.LogDebug($"Get wechat weapp language: {weAppLang ?? null}"); Logger.LogDebug($"Get wechat weapp language: {weAppLang ?? null}");
// TODO: 如果微信端发布通知,请组装好 openid 字段在通知数据内容里面 var notificationData = NotificationData.ToStandardData(Options.DefaultMsgPrefix, notification.Data);
string weChatCode = GetOrDefault(notification.Data, AbpWeChatClaimTypes.OpenId, "");
var openId = !weChatCode.IsNullOrWhiteSpace() ? weChatCode // TODO: 如果微信端发布通知,请组装好 openid 字段在通知数据内容里面
: await UserWeChatOpenIdFinder.FindByUserIdAsync(identifier.UserId); string openId = GetOrDefault(notification.Data, AbpWeChatClaimTypes.OpenId, "");
var weChatWeAppNotificationData = new WeChatWeAppSendNotificationData(openId,
templateId, redirect, weAppState, weAppLang);
// 写入模板数据 if (openId.IsNullOrWhiteSpace())
weChatWeAppNotificationData.WriteStandardData(NotificationData.ToStandardData(Options.DefaultMsgPrefix, notification.Data)); {
// 发送小程序订阅消息
await SubscribeMessager
.SendAsync(
identifier.UserId, templateId, redirect, weAppLang,
weAppState, notificationData.Properties, cancellationToken);
}
else
{
var weChatWeAppNotificationData = new SubscribeMessage(templateId, redirect, weAppState, weAppLang);
// 写入模板数据
weChatWeAppNotificationData.WriteData(notificationData.Properties);
Logger.LogDebug($"Sending wechat weapp notification: {notification.Name}"); Logger.LogDebug($"Sending wechat weapp notification: {notification.Name}");
// 发送小程序订阅消息 // 发送小程序订阅消息
await NotificationSender.SendAsync(weChatWeAppNotificationData); await SubscribeMessager.SendAsync(weChatWeAppNotificationData, cancellationToken);
}
} }
protected string GetOrDefaultTemplateId(NotificationData data) protected string GetOrDefaultTemplateId(NotificationData data)

12
aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationSender.cs

@ -1,8 +1,10 @@
using LINGYUN.Abp.Features.LimitValidation; using LINGYUN.Abp.Features.LimitValidation;
using LINGYUN.Abp.Notifications.WeChat.WeApp.Features; using LINGYUN.Abp.Notifications.WeChat.WeApp.Features;
using LINGYUN.Abp.WeChat.Authorization; using LINGYUN.Abp.WeChat.MiniProgram;
using LINGYUN.Abp.WeChat.Token;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
@ -11,7 +13,6 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Features;
using Volo.Abp.Json; using Volo.Abp.Json;
namespace LINGYUN.Abp.Notifications.WeChat.WeApp namespace LINGYUN.Abp.Notifications.WeChat.WeApp
@ -22,15 +23,18 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp
public ILogger<WeChatWeAppNotificationSender> Logger { get; set; } public ILogger<WeChatWeAppNotificationSender> Logger { get; set; }
protected IHttpClientFactory HttpClientFactory { get; } protected IHttpClientFactory HttpClientFactory { get; }
protected IJsonSerializer JsonSerializer { get; } protected IJsonSerializer JsonSerializer { get; }
protected AbpWeChatMiniProgramOptions MiniProgramOptions { get; }
protected IWeChatTokenProvider WeChatTokenProvider { get; } protected IWeChatTokenProvider WeChatTokenProvider { get; }
public WeChatWeAppNotificationSender( public WeChatWeAppNotificationSender(
IJsonSerializer jsonSerializer, IJsonSerializer jsonSerializer,
IHttpClientFactory httpClientFactory, IHttpClientFactory httpClientFactory,
IWeChatTokenProvider weChatTokenProvider) IWeChatTokenProvider weChatTokenProvider,
IOptions<AbpWeChatMiniProgramOptions> miniProgramOptions)
{ {
JsonSerializer = jsonSerializer; JsonSerializer = jsonSerializer;
HttpClientFactory = httpClientFactory; HttpClientFactory = httpClientFactory;
WeChatTokenProvider = weChatTokenProvider; WeChatTokenProvider = weChatTokenProvider;
MiniProgramOptions = miniProgramOptions.Value;
Logger = NullLogger<WeChatWeAppNotificationSender>.Instance; Logger = NullLogger<WeChatWeAppNotificationSender>.Instance;
} }
@ -44,7 +48,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp
)] )]
public virtual async Task SendAsync(WeChatWeAppSendNotificationData notificationData, CancellationToken cancellationToken = default) public virtual async Task SendAsync(WeChatWeAppSendNotificationData notificationData, CancellationToken cancellationToken = default)
{ {
var weChatToken = await WeChatTokenProvider.GetTokenAsync(); var weChatToken = await WeChatTokenProvider.GetTokenAsync(MiniProgramOptions.AppId, MiniProgramOptions.AppSecret, cancellationToken);
var requestParamters = new Dictionary<string, string> var requestParamters = new Dictionary<string, string>
{ {
{ "access_token", weChatToken.AccessToken } { "access_token", weChatToken.AccessToken }

6
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN.Abp.WeChat.Authorization.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" /> <Import Project="..\..\..\common.props" />
@ -17,4 +17,8 @@
<ProjectReference Include="..\..\wechat\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj" /> <ProjectReference Include="..\..\wechat\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="LINGYUN\Abp\WeChat\Authorization\OpenId\" />
</ItemGroup>
</Project> </Project>

1
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/AbpWeChatAuthorizationOptions.cs

@ -3,6 +3,7 @@
public class AbpWeChatAuthorizationOptions public class AbpWeChatAuthorizationOptions
{ {
public string AppId { get; set; } public string AppId { get; set; }
public string AppSecret { get; set; } public string AppSecret { get; set; }
} }
} }

47
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/AbpWeChatAuthorizationOptionsFactory.cs

@ -0,0 +1,47 @@
using LINGYUN.Abp.WeChat.Authorization.Settings;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Options;
using Volo.Abp.Settings;
using Volo.Abp.Threading;
namespace LINGYUN.Abp.WeChat.Authorization
{
public class AbpWeChatAuthorizationOptionsFactory : AbpOptionsFactory<AbpWeChatAuthorizationOptions>
{
protected ISettingProvider SettingProvider { get; }
public AbpWeChatAuthorizationOptionsFactory(
ISettingProvider settingProvider,
IEnumerable<IConfigureOptions<AbpWeChatAuthorizationOptions>> setups,
IEnumerable<IPostConfigureOptions<AbpWeChatAuthorizationOptions>> postConfigures)
: base(setups, postConfigures)
{
SettingProvider = settingProvider;
}
public override AbpWeChatAuthorizationOptions Create(string name)
{
var options = base.Create(name);
OverrideOptions(options);
return options;
}
protected virtual void OverrideOptions(AbpWeChatAuthorizationOptions options)
{
AsyncHelper.RunSync(() => OverrideOptionsAsync(options));
}
protected virtual async Task OverrideOptionsAsync(AbpWeChatAuthorizationOptions options)
{
var appId = await SettingProvider.GetOrNullAsync(WeChatAuthorizationSettingNames.AppId);
var appSecret = await SettingProvider.GetOrNullAsync(WeChatAuthorizationSettingNames.AppSecret);
options.AppId = appId ?? options.AppId;
options.AppSecret = appSecret ?? options.AppSecret;
}
}
}

12
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IUserWeChatOpenIdFinder.cs

@ -1,12 +0,0 @@
using System;
using System.Threading.Tasks;
namespace LINGYUN.Abp.WeChat.Authorization
{
public interface IUserWeChatOpenIdFinder
{
Task<string> FindByUserIdAsync(Guid userId);
Task<string> FindByUserNameAsync(string userName);
}
}

10
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IWeChatOpenIdFinder.cs

@ -1,10 +0,0 @@
using System;
using System.Threading.Tasks;
namespace LINGYUN.Abp.WeChat.Authorization
{
public interface IWeChatOpenIdFinder
{
Task<WeChatOpenId> FindAsync(string code);
}
}

11
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Settings/WeChatAuthorizationSettingNames.cs

@ -0,0 +1,11 @@
using LINGYUN.Abp.WeChat.Settings;
namespace LINGYUN.Abp.WeChat.Authorization.Settings
{
public class WeChatAuthorizationSettingNames
{
private const string Prefix = WeChatSettingNames.Prefix + ".Authorization";
public static string AppId = Prefix + "." + nameof(AbpWeChatAuthorizationOptions.AppId);
public static string AppSecret = Prefix + "." + nameof(AbpWeChatAuthorizationOptions.AppSecret);
}
}

32
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Settings/WeChatAuthorizationSettingProvider.cs

@ -0,0 +1,32 @@
using LINGYUN.Abp.WeChat.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
namespace LINGYUN.Abp.WeChat.Authorization.Settings
{
public class WeChatAuthorizationSettingProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
context.Add(
new SettingDefinition(
WeChatAuthorizationSettingNames.AppId, "",
L("DisplayName:WeChat.Auth.AppId"),
L("Description:WeChat.Auth.AppId"),
isVisibleToClients: true,
isEncrypted: true),
new SettingDefinition(
WeChatAuthorizationSettingNames.AppSecret, "",
L("DisplayName:WeChat.Auth.AppSecret"),
L("Description:WeChat.Auth.AppSecret"),
isVisibleToClients: true,
isEncrypted: true)
);
}
protected ILocalizableString L(string name)
{
return LocalizableString.Create<WeChatResource>(name);
}
}
}

17
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/README.md

@ -0,0 +1,17 @@
# LINGYUN.Abp.WeChat.Authorization
废弃模块,模块层次不清晰,微信有多端平台,不同平台授权规则不一致
#### 注意
## 配置使用
```csharp
[DependsOn(typeof(AbpWeChatAuthorizationModule))]
public class YouProjectModule : AbpModule
{
// other
}

24
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN.Abp.WeChat.MiniProgram.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\WeChat\MiniProgram\Localization\Resources\en.json" />
<None Remove="LINGYUN\Abp\WeChat\MiniProgram\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\WeChat\MiniProgram\Localization\Resources\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\WeChat\MiniProgram\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj" />
</ItemGroup>
</Project>

21
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramConsts.cs

@ -0,0 +1,21 @@
namespace LINGYUN.Abp.WeChat.MiniProgram
{
public class AbpWeChatMiniProgramConsts
{
/// <summary>
/// 全局对应的Provider名称
/// </summary>
public static string ProviderKey { get; set; } = "WeChat.MiniProgram";
/// <summary>
/// 微信小程序授权类型
/// </summary>
public static string GrantType { get; set; } = "wx-mp";
/// <summary>
/// 微信小程序授权方法名称
/// </summary>
public static string AuthenticationMethod { get; set; } = "wma";
public static string HttpClient { get; set; } = "Abp.WeChat.MiniProgram";
}
}

46
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramModule.cs

@ -0,0 +1,46 @@
using LINGYUN.Abp.WeChat.Localization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using System;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Settings;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.WeChat.MiniProgram
{
[DependsOn(
typeof(AbpWeChatModule),
typeof(AbpSettingsModule))]
public class AbpWeChatMiniProgramModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpWeChatMiniProgramModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<WeChatResource>()
.AddVirtualJson("/LINGYUN/Abp/WeChat/MiniProgram/Localization/Resources");
});
context.Services.AddHttpClient(AbpWeChatMiniProgramConsts.HttpClient, options =>
{
options.BaseAddress = new Uri("https://api.weixin.qq.com");
});
AddAbpWeChatMiniProgramOptionsFactory(context.Services);
}
private static void AddAbpWeChatMiniProgramOptionsFactory(IServiceCollection services)
{
services.Replace(ServiceDescriptor.Transient<IOptionsFactory<AbpWeChatMiniProgramOptions>, AbpWeChatMiniProgramOptionsFactory>());
services.Replace(ServiceDescriptor.Scoped<IOptions<AbpWeChatMiniProgramOptions>, OptionsManager<AbpWeChatMiniProgramOptions>>());
}
}
}

22
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs

@ -0,0 +1,22 @@
namespace LINGYUN.Abp.WeChat.MiniProgram
{
public class AbpWeChatMiniProgramOptions
{
/// <summary>
/// 小程序AppId
/// </summary>
public string AppId { get; set; }
/// <summary>
/// 小程序AppSecret
/// </summary>
public string AppSecret { get; set; }
/// <summary>
/// 小程序消息解密Token
/// </summary>
public string Token { get; set; }
/// <summary>
/// 小程序消息解密AESKey
/// </summary>
public string EncodingAESKey { get; set; }
}
}

50
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsFactory.cs

@ -0,0 +1,50 @@
using LINGYUN.Abp.WeChat.MiniProgram.Settings;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Options;
using Volo.Abp.Settings;
using Volo.Abp.Threading;
namespace LINGYUN.Abp.WeChat.MiniProgram
{
public class AbpWeChatMiniProgramOptionsFactory : AbpOptionsFactory<AbpWeChatMiniProgramOptions>
{
protected ISettingProvider SettingProvider { get; }
public AbpWeChatMiniProgramOptionsFactory(
ISettingProvider settingProvider,
IEnumerable<IConfigureOptions<AbpWeChatMiniProgramOptions>> setups,
IEnumerable<IPostConfigureOptions<AbpWeChatMiniProgramOptions>> postConfigures)
: base(setups, postConfigures)
{
SettingProvider = settingProvider;
}
public override AbpWeChatMiniProgramOptions Create(string name)
{
var options = base.Create(name);
OverrideOptions(options);
return options;
}
protected virtual void OverrideOptions(AbpWeChatMiniProgramOptions options)
{
AsyncHelper.RunSync(() => OverrideOptionsAsync(options));
}
protected virtual async Task OverrideOptionsAsync(AbpWeChatMiniProgramOptions options)
{
var appId = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.AppId);
var appSecret = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.AppSecret);
var token = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.Token);
var aesKey = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.EncodingAESKey);
options.AppId = appId ?? options.AppId;
options.AppSecret = appSecret ?? options.AppSecret;
options.Token = token ?? options.Token;
options.EncodingAESKey = aesKey ?? options.EncodingAESKey;
}
}
}

15
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Localization/Resources/en.json

@ -0,0 +1,15 @@
{
"culture": "en",
"texts": {
"DisplayName:WeChat.MiniProgram": "WeChat Mini Program",
"Description:WeChat.MiniProgram": "WeChat Mini Program",
"DisplayName:WeChat.MiniProgram.AppId": "AppId",
"Description:WeChat.MiniProgram.AppId": "AppId,See:https://developers.weixin.qq.com/miniprogram/dev/framework/",
"DisplayName:WeChat.MiniProgram.AppSecret": "App Secret",
"Description:WeChat.MiniProgram.AppSecret": "App Secret,See:https://developers.weixin.qq.com/miniprogram/dev/framework/",
"DisplayName:WeChat.MiniProgram.Token": "Token",
"Description:WeChat.MiniProgram.Token": "Token,See:https://developers.weixin.qq.com/miniprogram/dev/framework/",
"DisplayName:WeChat.MiniProgram.EncodingAESKey": "Encoding AES Key",
"Description:WeChat.MiniProgram.EncodingAESKey": "Encoding AES Key,See:https://developers.weixin.qq.com/miniprogram/dev/framework/"
}
}

15
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Localization/Resources/zh-Hans.json

@ -0,0 +1,15 @@
{
"culture": "zh-Hans",
"texts": {
"DisplayName:WeChat.MiniProgram": "微信小程序",
"Description:WeChat.MiniProgram": "微信小程序",
"DisplayName:WeChat.MiniProgram.AppId": "小程序AppId",
"Description:WeChat.MiniProgram.AppId": "微信小程序AppId,详情见:https://developers.weixin.qq.com/miniprogram/dev/framework/",
"DisplayName:WeChat.MiniProgram.AppSecret": "小程序AppSecret",
"Description:WeChat.MiniProgram.AppSecret": "微信小程序AppSecret,详情见:https://developers.weixin.qq.com/miniprogram/dev/framework/",
"DisplayName:WeChat.MiniProgram.Token": "小程序Token",
"Description:WeChat.MiniProgram.Token": "微信小程序Token,详情见:https://developers.weixin.qq.com/miniprogram/dev/framework/",
"DisplayName:WeChat.MiniProgram.EncodingAESKey": "小程序EncodingAESKey",
"Description:WeChat.MiniProgram.EncodingAESKey": "微信小程序EncodingAESKey,详情见:https://developers.weixin.qq.com/miniprogram/dev/framework/"
}
}

44
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.WeChat.MiniProgram.Messages
{
/// <summary>
/// 小程序模板消息
/// 详情: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html
/// </summary>
/// <remarks>
/// 暂时仅实现发送订阅消息
/// </remarks>
public interface ISubscribeMessager
{
/// <summary>
/// 发送订阅消息
/// </summary>
/// <param name="message"></param>
/// <param name="cancellation"></param>
/// <returns></returns>
Task SendAsync(SubscribeMessage message, CancellationToken cancellation = default);
/// <summary>
/// 发送订阅消息
/// </summary>
/// <param name="toUser">用户</param>
/// <param name="templateId">模板</param>
/// <param name="page">跳转页面</param>
/// <param name="lang">语言</param>
/// <param name="state">类型</param>
/// <param name="data">数据</param>
/// <param name="cancellation"></param>
/// <returns></returns>
Task SendAsync(
Guid toUser,
string templateId,
string page = "",
string lang = "zh_CN",
string state = "formal",
Dictionary<string, object> data = null,
CancellationToken cancellation = default);
}
}

24
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs

@ -0,0 +1,24 @@
using Newtonsoft.Json;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.MiniProgram.Messages
{
public class SubscribeMessageResponse
{
[JsonProperty("errcode")]
public int ErrorCode { get; set; }
[JsonProperty("errmsg")]
public string ErrorMessage { get; set; }
public bool IsSuccessed => ErrorCode == 0;
public void ThrowIfNotSuccess()
{
if (ErrorCode != 0)
{
throw new AbpException($"Send wechat weapp notification error:{ErrorMessage}");
}
}
}
}

106
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs

@ -0,0 +1,106 @@
using Newtonsoft.Json;
using System.Collections.Generic;
namespace LINGYUN.Abp.WeChat.MiniProgram.Messages
{
public class SubscribeMessage
{
/// <summary>
/// 接收者(用户)的 openid
/// </summary>
[JsonProperty("touser")]
public string ToUser { get; set; }
/// <summary>
/// 所需下发的订阅模板id
/// </summary>
[JsonProperty("template_id")]
public string TemplateId { get; set; }
/// <summary>
/// 点击模板卡片后的跳转页面,仅限本小程序内的页面。
/// 支持带参数,(示例index?foo=bar)。
/// 该字段不填则模板无跳转
/// </summary>
[JsonProperty("page")]
public string Page { get; set; }
/// <summary>
/// 跳转小程序类型:
/// developer为开发版;trial为体验版;formal为正式版;
/// 默认为正式版
/// </summary>
[JsonProperty("miniprogram_state")]
public string MiniProgramState { get; set; }
/// <summary>
/// 进入小程序查看”的语言类型,
/// 支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),
/// 默认为zh_CN
/// </summary>
[JsonProperty("lang")]
public string Lang { get; set; } = "zh_CN";
/// <summary>
/// 模板内容,
/// 格式形如 { "key1": { "value": any }, "key2": { "value": any } }
/// </summary>
[JsonProperty("data")]
public Dictionary<string, MessageData> Data { get; set; } = new Dictionary<string, MessageData>();
public SubscribeMessage() { }
public SubscribeMessage(
string openId,
string templateId,
string redirectPage = "",
string state = "formal",
string miniLang = "zh_CN")
{
ToUser = openId;
TemplateId = templateId;
Page = redirectPage;
MiniProgramState = state;
Lang = miniLang;
}
public SubscribeMessage WriteData(string prefix, string key, object value)
{
// 只截取符合标记的数据
if (key.StartsWith(prefix))
{
key = key.Replace(prefix, "");
if (!Data.ContainsKey(key))
{
Data.Add(key, new MessageData(value));
}
}
return this;
}
public SubscribeMessage WriteData(string prefix, IDictionary<string, object> setData)
{
foreach (var kv in setData)
{
WriteData(prefix, kv.Key, kv.Value);
}
return this;
}
public SubscribeMessage WriteData(IDictionary<string, object> setData)
{
foreach (var kv in setData)
{
if (!Data.ContainsKey(kv.Key))
{
Data.Add(kv.Key, new MessageData(kv.Value));
}
}
return this;
}
}
public class MessageData
{
public object Value { get; }
public MessageData(object value)
{
Value = value;
}
}
}

119
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs

@ -0,0 +1,119 @@
using LINGYUN.Abp.WeChat.OpenId;
using LINGYUN.Abp.WeChat.Token;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Json;
namespace LINGYUN.Abp.WeChat.MiniProgram.Messages
{
public class SubscribeMessager : ISubscribeMessager, ITransientDependency
{
public ILogger<SubscribeMessager> Logger { get; set; }
protected IHttpClientFactory HttpClientFactory { get; }
protected IJsonSerializer JsonSerializer { get; }
protected AbpWeChatMiniProgramOptions MiniProgramOptions { get; }
protected IWeChatTokenProvider WeChatTokenProvider { get; }
protected IUserWeChatOpenIdFinder UserWeChatOpenIdFinder { get; }
public SubscribeMessager(
IJsonSerializer jsonSerializer,
IHttpClientFactory httpClientFactory,
IWeChatTokenProvider weChatTokenProvider,
IUserWeChatOpenIdFinder userWeChatOpenIdFinder,
IOptions<AbpWeChatMiniProgramOptions> miniProgramOptions)
{
JsonSerializer = jsonSerializer;
HttpClientFactory = httpClientFactory;
WeChatTokenProvider = weChatTokenProvider;
UserWeChatOpenIdFinder = userWeChatOpenIdFinder;
MiniProgramOptions = miniProgramOptions.Value;
Logger = NullLogger<SubscribeMessager>.Instance;
}
public virtual async Task SendAsync(
Guid toUser,
string templateId,
string page = "",
string lang = "zh_CN",
string state = "formal",
Dictionary<string, object> data = null,
CancellationToken cancellation = default)
{
var openId = await UserWeChatOpenIdFinder.FindByUserIdAsync(toUser, AbpWeChatMiniProgramConsts.ProviderKey);
if (openId.IsNullOrWhiteSpace())
{
Logger.LogWarning("Can not found openId, Unable to send WeChat message!");
return;
}
var messageData = new SubscribeMessage(openId, templateId, page, state, lang);
if (data != null)
{
messageData.WriteData(data);
}
await SendAsync(messageData, cancellation);
}
public virtual async Task SendAsync(SubscribeMessage message, CancellationToken cancellationToken = default)
{
var weChatToken = await WeChatTokenProvider.GetTokenAsync(MiniProgramOptions.AppId, MiniProgramOptions.AppSecret, cancellationToken);
var requestParamters = new Dictionary<string, string>
{
{ "access_token", weChatToken.AccessToken }
};
var weChatSendNotificationUrl = "https://api.weixin.qq.com";
var weChatSendNotificationPath = "/cgi-bin/message/subscribe/send";
var requestUrl = BuildRequestUrl(weChatSendNotificationUrl, weChatSendNotificationPath, requestParamters);
var responseContent = await MakeRequestAndGetResultAsync(requestUrl, message, cancellationToken);
var response = JsonSerializer.Deserialize<SubscribeMessageResponse>(responseContent);
if (!response.IsSuccessed)
{
Logger.LogWarning("Send wechat we app subscribe message failed");
Logger.LogWarning($"Error code: {response.ErrorCode}, message: {response.ErrorMessage}");
}
}
protected virtual async Task<string> MakeRequestAndGetResultAsync(string url, SubscribeMessage message, CancellationToken cancellationToken = default)
{
var client = HttpClientFactory.CreateClient(AbpWeChatMiniProgramConsts.HttpClient);
var sendDataContent = JsonSerializer.Serialize(message);
var requestContent = new StringContent(sendDataContent);
var requestMessage = new HttpRequestMessage(HttpMethod.Post, url)
{
Content = requestContent
};
var response = await client.SendAsync(requestMessage, cancellationToken);
if (!response.IsSuccessStatusCode)
{
throw new AbpException($"WeChat send subscribe message http request service returns error! HttpStatusCode: {response.StatusCode}, ReasonPhrase: {response.ReasonPhrase}");
}
var resultContent = await response.Content.ReadAsStringAsync();
return resultContent;
}
protected virtual string BuildRequestUrl(string uri, string path, IDictionary<string, string> paramters)
{
var requestUrlBuilder = new StringBuilder(128);
requestUrlBuilder.Append(uri);
requestUrlBuilder.Append(path).Append("?");
foreach (var paramter in paramters)
{
requestUrlBuilder.AppendFormat("{0}={1}", paramter.Key, paramter.Value);
requestUrlBuilder.Append("&");
}
requestUrlBuilder.Remove(requestUrlBuilder.Length - 1, 1);
return requestUrlBuilder.ToString();
}
}
}

44
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingDefinitionProvider.cs

@ -0,0 +1,44 @@
using LINGYUN.Abp.WeChat.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
namespace LINGYUN.Abp.WeChat.MiniProgram.Settings
{
public class WeChatMiniProgramSettingDefinitionProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
context.Add(
new SettingDefinition(
WeChatMiniProgramSettingNames.AppId, "",
L("DisplayName:WeChat.MiniProgram.AppId"),
L("Description:WeChat.MiniProgram.AppId"),
isVisibleToClients: true,
isEncrypted: true),
new SettingDefinition(
WeChatMiniProgramSettingNames.AppSecret, "",
L("DisplayName:WeChat.MiniProgram.AppSecret"),
L("Description:WeChat.MiniProgram.AppSecret"),
isVisibleToClients: true,
isEncrypted: true),
new SettingDefinition(
WeChatMiniProgramSettingNames.Token, "",
L("DisplayName:WeChat.MiniProgram.Token"),
L("Description:WeChat.MiniProgram.Token"),
isVisibleToClients: true,
isEncrypted: true),
new SettingDefinition(
WeChatMiniProgramSettingNames.EncodingAESKey, "",
L("DisplayName:WeChat.MiniProgram.EncodingAESKey"),
L("Description:WeChat.MiniProgram.EncodingAESKey"),
isVisibleToClients: true,
isEncrypted: true)
);
}
protected ILocalizableString L(string name)
{
return LocalizableString.Create<WeChatResource>(name);
}
}
}

14
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingNames.cs

@ -0,0 +1,14 @@
using LINGYUN.Abp.WeChat.Settings;
namespace LINGYUN.Abp.WeChat.MiniProgram.Settings
{
public class WeChatMiniProgramSettingNames
{
private const string Prefix = WeChatSettingNames.Prefix + ".MiniProgram";
public static string AppId = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.AppId);
public static string AppSecret = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.AppSecret);
public static string Token = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.Token);
public static string EncodingAESKey = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.EncodingAESKey);
}
}

20
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.MiniProgram/README.md

@ -0,0 +1,20 @@
# LINGYUN.Abp.WeChat.MiniProgram
微信小程序SDK集成,考虑是否需要集成[Senparc.Weixin SDK](https://github.com/JeffreySu/WeiXinMPSDK)
大部分重写的模块都和官方模块名称保持一致,通过命名空间区分,主要是只改写了一小部分或者增加额外的功能
如果大部分模块代码都重写,或者完全就是扩展模块,才会定义自己的名字
#### 注意
## 配置使用
```csharp
[DependsOn(typeof(AbpWeChatMiniProgramModule))]
public class YouProjectModule : AbpModule
{
// other
}

24
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN.Abp.WeChat.Official.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\WeChat\Official\Localization\Resources\en.json" />
<None Remove="LINGYUN\Abp\WeChat\Official\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\WeChat\Official\Localization\Resources\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\WeChat\Official\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj" />
</ItemGroup>
</Project>

22
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialConsts.cs

@ -0,0 +1,22 @@
namespace LINGYUN.Abp.WeChat.Official
{
public class AbpWeChatOfficialConsts
{
/// <summary>
/// 微信公众号全局对应的Provider名称
/// </summary>
public static string ProviderKey { get; set; } = "WeChat.Official";
/// <summary>
/// 微信公众平台授权类型
/// </summary>
public static string GrantType { get; set; } = "wx-op";
/// <summary>
/// 微信公众平台授权方法名称
/// </summary>
public static string AuthenticationMethod { get; set; } = "woa";
public static string HttpClient { get; set; } = "Abp.WeChat.Official";
}
}

38
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialModule.cs

@ -0,0 +1,38 @@
using LINGYUN.Abp.WeChat.Localization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.WeChat.Official
{
[DependsOn(
typeof(AbpWeChatModule))]
public class AbpWeChatOfficialModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpWeChatOfficialModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<WeChatResource>()
.AddVirtualJson("/LINGYUN/Abp/WeChat/Official/Localization/Resources");
});
AddAbpWeChatOfficialOptionsFactory(context.Services);
}
private static void AddAbpWeChatOfficialOptionsFactory(IServiceCollection services)
{
services.Replace(ServiceDescriptor.Transient<IOptionsFactory<AbpWeChatOfficialOptions>, AbpWeChatOfficialOptionsFactory>());
services.Replace(ServiceDescriptor.Scoped<IOptions<AbpWeChatOfficialOptions>, OptionsManager<AbpWeChatOfficialOptions>>());
}
}
}

26
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs

@ -0,0 +1,26 @@
namespace LINGYUN.Abp.WeChat.Official
{
public class AbpWeChatOfficialOptions
{
/// <summary>
/// 公众号服务器消息Url
/// </summary>
public string Url { get; set; }
/// <summary>
/// 公众号AppId
/// </summary>
public string AppId { get; set; }
/// <summary>
/// 公众号AppSecret
/// </summary>
public string AppSecret { get; set; }
/// <summary>
/// 公众号消息解密Token
/// </summary>
public string Token { get; set; }
/// <summary>
/// 公众号消息解密AESKey
/// </summary>
public string EncodingAESKey { get; set; }
}
}

52
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsFactory.cs

@ -0,0 +1,52 @@
using LINGYUN.Abp.WeChat.Official.Settings;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Options;
using Volo.Abp.Settings;
using Volo.Abp.Threading;
namespace LINGYUN.Abp.WeChat.Official
{
public class AbpWeChatOfficialOptionsFactory : AbpOptionsFactory<AbpWeChatOfficialOptions>
{
protected ISettingProvider SettingProvider { get; }
public AbpWeChatOfficialOptionsFactory(
ISettingProvider settingProvider,
IEnumerable<IConfigureOptions<AbpWeChatOfficialOptions>> setups,
IEnumerable<IPostConfigureOptions<AbpWeChatOfficialOptions>> postConfigures)
: base(setups, postConfigures)
{
SettingProvider = settingProvider;
}
public override AbpWeChatOfficialOptions Create(string name)
{
var options = base.Create(name);
OverrideOptions(options);
return options;
}
protected virtual void OverrideOptions(AbpWeChatOfficialOptions options)
{
AsyncHelper.RunSync(() => OverrideOptionsAsync(options));
}
protected virtual async Task OverrideOptionsAsync(AbpWeChatOfficialOptions options)
{
var appId = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.AppId);
var appSecret = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.AppSecret);
var url = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.Url);
var token = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.Token);
var aesKey = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.EncodingAESKey);
options.AppId = appId ?? options.AppId;
options.AppSecret = appSecret ?? options.AppSecret;
options.Url = url ?? options.Url;
options.Token = token ?? options.Token;
options.EncodingAESKey = aesKey ?? options.EncodingAESKey;
}
}
}

17
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Localization/Resources/en.json

@ -0,0 +1,17 @@
{
"culture": "en",
"texts": {
"DisplayName:WeChat.Official": "WeChat Official",
"Description:WeChat.Official": "WeChat Official",
"DisplayName:WeChat.Official.AppId": "AppId",
"Description:WeChat.Official.AppId": "AppId,See:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html",
"DisplayName:WeChat.Official.AppSecret": "App Secret",
"Description:WeChat.Official.AppSecret": "App Secret,See:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html",
"DisplayName:WeChat.Official.Url": "Url",
"Description:WeChat.Official.Url": "Url,See:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html",
"DisplayName:WeChat.Official.Token": "Token",
"Description:WeChat.Official.Token": "Token,See:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html",
"DisplayName:WeChat.Official.EncodingAESKey": "Encoding AES Key",
"Description:WeChat.Official.EncodingAESKey": "Encoding AES Key,See:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html"
}
}

17
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Localization/Resources/zh-Hans.json

@ -0,0 +1,17 @@
{
"culture": "zh-Hans",
"texts": {
"DisplayName:WeChat.Official": "微信公众号",
"Description:WeChat.Official": "微信公众号",
"DisplayName:WeChat.Official.AppId": "公众号AppId",
"Description:WeChat.Official.AppId": "微信公众号AppId,详情见:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html",
"DisplayName:WeChat.Official.AppSecret": "公众号AppSecret",
"Description:WeChat.Official.AppSecret": "微信公众号AppSecret,详情见:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html",
"DisplayName:WeChat.Official.Url": "公众号Url",
"Description:WeChat.Official.Url": "微信公众号Url,详情见:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html",
"DisplayName:WeChat.Official.Token": "公众号Token",
"Description:WeChat.Official.Token": "微信公众号Token,详情见:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html",
"DisplayName:WeChat.Official.EncodingAESKey": "公众号EncodingAESKey",
"Description:WeChat.Official.EncodingAESKey": "微信公众号EncodingAESKey,详情见:https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html"
}
}

50
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingDefinitionProvider.cs

@ -0,0 +1,50 @@
using LINGYUN.Abp.WeChat.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
namespace LINGYUN.Abp.WeChat.Official.Settings
{
public class WeChatOfficialSettingDefinitionProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
context.Add(
new SettingDefinition(
WeChatOfficialSettingNames.AppId, "",
L("DisplayName:WeChat.Official.AppId"),
L("Description:WeChat.Official.AppId"),
isVisibleToClients: true,
isEncrypted: true),
new SettingDefinition(
WeChatOfficialSettingNames.AppSecret, "",
L("DisplayName:WeChat.Official.AppSecret"),
L("Description:WeChat.Official.AppSecret"),
isVisibleToClients: true,
isEncrypted: true),
new SettingDefinition(
WeChatOfficialSettingNames.Url, "",
L("DisplayName:WeChat.Official.Url"),
L("Description:WeChat.Official.Url"),
isVisibleToClients: true,
isEncrypted: false),
new SettingDefinition(
WeChatOfficialSettingNames.Token, "",
L("DisplayName:WeChat.Official.Token"),
L("Description:WeChat.Official.Token"),
isVisibleToClients: true,
isEncrypted: true),
new SettingDefinition(
WeChatOfficialSettingNames.EncodingAESKey, "",
L("DisplayName:WeChat.Official.EncodingAESKey"),
L("Description:WeChat.Official.EncodingAESKey"),
isVisibleToClients: true,
isEncrypted: true)
);
}
protected ILocalizableString L(string name)
{
return LocalizableString.Create<WeChatResource>(name);
}
}
}

15
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingNames.cs

@ -0,0 +1,15 @@
using LINGYUN.Abp.WeChat.Settings;
namespace LINGYUN.Abp.WeChat.Official.Settings
{
public class WeChatOfficialSettingNames
{
private const string Prefix = WeChatSettingNames.Prefix + ".Official";
public static string AppId = Prefix + "." + nameof(AbpWeChatOfficialOptions.AppId);
public static string AppSecret = Prefix + "." + nameof(AbpWeChatOfficialOptions.AppSecret);
public static string Url = Prefix + "." + nameof(AbpWeChatOfficialOptions.Url);
public static string Token = Prefix + "." + nameof(AbpWeChatOfficialOptions.Token);
public static string EncodingAESKey = Prefix + "." + nameof(AbpWeChatOfficialOptions.EncodingAESKey);
}
}

20
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Official/README.md

@ -0,0 +1,20 @@
# LINGYUN.Abp.WeChat.Official
微信公众号SDK集成,考虑是否需要集成[Senparc.Weixin SDK](https://github.com/JeffreySu/WeiXinMPSDK)
大部分重写的模块都和官方模块名称保持一致,通过命名空间区分,主要是只改写了一小部分或者增加额外的功能
如果大部分模块代码都重写,或者完全就是扩展模块,才会定义自己的名字
#### 注意
## 配置使用
```csharp
[DependsOn(typeof(AbpWeChatOfficialModule))]
public class YouProjectModule : AbpModule
{
// other
}

31
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj

@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\WeChat\SettingManagement\Localization\Resources\en.json" />
<None Remove="LINGYUN\Abp\WeChat\SettingManagement\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\WeChat\SettingManagement\Localization\Resources\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\WeChat\SettingManagement\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.3.0" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="3.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\settings\LINGYUN.Abp.SettingManagement.Application.Contracts\LINGYUN.Abp.SettingManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.WeChat.Official\LINGYUN.Abp.WeChat.Official.csproj" />
</ItemGroup>
</Project>

51
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/AbpWeChatSettingManagementModule.cs

@ -0,0 +1,51 @@
using LINGYUN.Abp.WeChat.Localization;
using LINGYUN.Abp.WeChat.MiniProgram;
using LINGYUN.Abp.WeChat.Official;
using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.WeChat.SettingManagement
{
[DependsOn(
typeof(AbpWeChatOfficialModule),
typeof(AbpWeChatMiniProgramModule),
typeof(AbpAspNetCoreMvcModule))]
public class AbpWeChatSettingManagementModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpWeChatSettingManagementModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpWeChatSettingManagementModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<WeChatResource>()
.AddVirtualJson("/LINGYUN/Abp/WeChat/SettingManagement/Localization/Resources");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<WeChatResource>()
.AddBaseTypes(
typeof(AbpUiResource)
);
});
}
}
}

13
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/IWeChatSettingAppService.cs

@ -0,0 +1,13 @@
using LINGYUN.Abp.SettingManagement;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.WeChat.SettingManagement
{
public interface IWeChatSettingAppService
{
Task<ListResultDto<SettingGroupDto>> GetAllForGlobalAsync();
Task<ListResultDto<SettingGroupDto>> GetAllForCurrentTenantAsync();
}
}

7
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/Localization/Resources/en.json

@ -0,0 +1,7 @@
{
"culture": "en",
"texts": {
"Permission:WeChat.Official": "Official",
"Permission:WeChat.MiniProgram": "Mini Program"
}
}

7
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/Localization/Resources/zh-Hans.json

@ -0,0 +1,7 @@
{
"culture": "zh-Hans",
"texts": {
"Permission:WeChat.Official": "公众平台",
"Permission:WeChat.MiniProgram": "小程序"
}
}

116
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs

@ -0,0 +1,116 @@
using LINGYUN.Abp.SettingManagement;
using LINGYUN.Abp.WeChat.Localization;
using LINGYUN.Abp.WeChat.MiniProgram.Settings;
using LINGYUN.Abp.WeChat.Official.Settings;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.MultiTenancy;
using Volo.Abp.SettingManagement;
using Volo.Abp.Settings;
namespace LINGYUN.Abp.WeChat.SettingManagement
{
public class WeChatSettingAppService : ApplicationService, IWeChatSettingAppService
{
protected ISettingManager SettingManager { get; }
protected IPermissionChecker PermissionChecker { get; }
protected ISettingDefinitionManager SettingDefinitionManager { get; }
public WeChatSettingAppService(
ISettingManager settingManager,
IPermissionChecker permissionChecker,
ISettingDefinitionManager settingDefinitionManager)
{
SettingManager = settingManager;
PermissionChecker = permissionChecker;
SettingDefinitionManager = settingDefinitionManager;
LocalizationResource = typeof(WeChatResource);
}
public virtual async Task<ListResultDto<SettingGroupDto>> GetAllForCurrentTenantAsync()
{
return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString());
}
public virtual async Task<ListResultDto<SettingGroupDto>> GetAllForGlobalAsync()
{
return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null);
}
protected virtual async Task<ListResultDto<SettingGroupDto>> GetAllForProviderAsync(string providerName, string providerKey)
{
var settingGroups = new List<SettingGroupDto>();
var wechatSettingGroup = new SettingGroupDto(L["DisplayName:WeChat"], L["Description:WeChat"]);
// 无权限返回空结果,直接报错的话,网关聚合会抛出异常
if (await PermissionChecker.IsGrantedAsync(WeChatSettingPermissionNames.Official))
{
#region 公众号
var officialSetting = wechatSettingGroup.AddSetting(L["DisplayName:WeChat.Official"], L["Description:WeChat.Official"]);
officialSetting.AddDetail(
SettingDefinitionManager.Get(WeChatOfficialSettingNames.AppId),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.AppId, providerName, providerKey),
ValueType.String);
officialSetting.AddDetail(
SettingDefinitionManager.Get(WeChatOfficialSettingNames.AppSecret),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.AppSecret, providerName, providerKey),
ValueType.String);
officialSetting.AddDetail(
SettingDefinitionManager.Get(WeChatOfficialSettingNames.Url),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.Url, providerName, providerKey),
ValueType.String);
officialSetting.AddDetail(
SettingDefinitionManager.Get(WeChatOfficialSettingNames.Token),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.Token, providerName, providerKey),
ValueType.String);
officialSetting.AddDetail(
SettingDefinitionManager.Get(WeChatOfficialSettingNames.EncodingAESKey),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.EncodingAESKey, providerName, providerKey),
ValueType.String);
#endregion
}
if (await PermissionChecker.IsGrantedAsync(WeChatSettingPermissionNames.MiniProgram))
{
#region 小程序
var miniProgramSetting = wechatSettingGroup.AddSetting(L["DisplayName:WeChat.MiniProgram"], L["Description:WeChat.MiniProgram"]);
miniProgramSetting.AddDetail(
SettingDefinitionManager.Get(WeChatMiniProgramSettingNames.AppId),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.AppId, providerName, providerKey),
ValueType.String);
miniProgramSetting.AddDetail(
SettingDefinitionManager.Get(WeChatMiniProgramSettingNames.AppSecret),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.AppSecret, providerName, providerKey),
ValueType.String);
miniProgramSetting.AddDetail(
SettingDefinitionManager.Get(WeChatMiniProgramSettingNames.Token),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.Token, providerName, providerKey),
ValueType.String);
miniProgramSetting.AddDetail(
SettingDefinitionManager.Get(WeChatMiniProgramSettingNames.EncodingAESKey),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.EncodingAESKey, providerName, providerKey),
ValueType.String);
#endregion
}
settingGroups.Add(wechatSettingGroup);
return new ListResultDto<SettingGroupDto>(settingGroups);
}
}
}

37
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingController.cs

@ -0,0 +1,37 @@
using LINGYUN.Abp.SettingManagement;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.WeChat.SettingManagement
{
[RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)]
[Area("settingManagement")]
[Route("api/setting-management/wechat")]
public class WeChatSettingController : AbpController, IWeChatSettingAppService
{
protected IWeChatSettingAppService WeChatSettingAppService { get; }
public WeChatSettingController(
IWeChatSettingAppService weChatSettingAppService)
{
WeChatSettingAppService = weChatSettingAppService;
}
[HttpGet]
[Route("by-current-tenant")]
public virtual async Task<ListResultDto<SettingGroupDto>> GetAllForCurrentTenantAsync()
{
return await WeChatSettingAppService.GetAllForCurrentTenantAsync();
}
[HttpGet]
[Route("by-global")]
public virtual async Task<ListResultDto<SettingGroupDto>> GetAllForGlobalAsync()
{
return await WeChatSettingAppService.GetAllForGlobalAsync();
}
}
}

27
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionDefinitionProvider.cs

@ -0,0 +1,27 @@
using LINGYUN.Abp.WeChat.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace LINGYUN.Abp.WeChat.SettingManagement
{
public class WeChatSettingPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var wechatGroup = context.AddGroup(
WeChatSettingPermissionNames.GroupName,
L("Permission:WeChat"));
wechatGroup.AddPermission(
WeChatSettingPermissionNames.Official, L("Permission:WeChat.Official"));
wechatGroup.AddPermission(
WeChatSettingPermissionNames.MiniProgram, L("Permission:WeChat.MiniProgram"));
}
protected LocalizableString L(string name)
{
return LocalizableString.Create<WeChatResource>(name);
}
}
}

10
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionNames.cs

@ -0,0 +1,10 @@
namespace LINGYUN.Abp.WeChat.SettingManagement
{
public class WeChatSettingPermissionNames
{
public const string GroupName = "Abp.WeChat";
public const string Official = GroupName + ".Official";
public const string MiniProgram = GroupName + ".MiniProgram";
}
}

5
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" /> <Import Project="..\..\..\common.props" />
@ -19,6 +19,9 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Features" Version="3.3.0" /> <PackageReference Include="Volo.Abp.Features" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Caching" Version="3.3.0" />
<PackageReference Include="Volo.Abp.Json" Version="3.3.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="3.1.8" />
</ItemGroup> </ItemGroup>
</Project> </Project>

18
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatGlobalConsts.cs

@ -0,0 +1,18 @@
namespace LINGYUN.Abp.WeChat
{
public class AbpWeChatGlobalConsts
{
/// <summary>
/// 微信授权名称
/// </summary>
public static string AuthenticationScheme { get; set; }= "WeChat";
/// <summary>
/// 微信授权Token参数名称
/// </summary>
public static string TokenName { get; set; }= "code";
/// <summary>
/// 微信授权显示名称
/// </summary>
public static string DisplayName { get; set; } = "WeChat";
}
}

16
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatModule.cs

@ -1,12 +1,20 @@
using LINGYUN.Abp.WeChat.Localization; using LINGYUN.Abp.WeChat.Localization;
using Microsoft.Extensions.DependencyInjection;
using Polly;
using System;
using Volo.Abp.Caching;
using Volo.Abp.Features; using Volo.Abp.Features;
using Volo.Abp.Json;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem; using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.WeChat namespace LINGYUN.Abp.WeChat
{ {
[DependsOn(typeof(AbpFeaturesModule))] [DependsOn(
typeof(AbpCachingModule),
typeof(AbpFeaturesModule),
typeof(AbpJsonModule))]
public class AbpWeChatModule : AbpModule public class AbpWeChatModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
@ -22,6 +30,12 @@ namespace LINGYUN.Abp.WeChat
.Add<WeChatResource>("zh-Hans") .Add<WeChatResource>("zh-Hans")
.AddVirtualJson("/LINGYUN/Abp/WeChat/Localization/Resources"); .AddVirtualJson("/LINGYUN/Abp/WeChat/Localization/Resources");
}); });
context.Services.AddHttpClient("WeChatRequestClient", options =>
{
options.BaseAddress = new Uri("https://api.weixin.qq.com");
}).AddTransientHttpErrorPolicy(builder =>
builder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))));
} }
} }
} }

5
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/en.json

@ -1,6 +1,9 @@
{ {
"culture": "en", "culture": "en",
"texts": { "texts": {
"Features:WeChat": "WeChat" "Features:WeChat": "WeChat",
"Permission:WeChat": "WeChat",
"DisplayName:WeChat": "WeChat",
"Description:WeChat": "WeChat"
} }
} }

5
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/zh-Hans.json

@ -1,6 +1,9 @@
{ {
"culture": "zh-Hans", "culture": "zh-Hans",
"texts": { "texts": {
"Features:WeChat": "微信开发" "Features:WeChat": "微信开发",
"Permission:WeChat": "微信开发",
"DisplayName:WeChat": "微信开发平台",
"Description:WeChat": "微信开发平台"
} }
} }

12
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs

@ -0,0 +1,12 @@
using System;
using System.Threading.Tasks;
namespace LINGYUN.Abp.WeChat.OpenId
{
public interface IUserWeChatOpenIdFinder
{
Task<string> FindByUserIdAsync(Guid userId, string provider);
Task<string> FindByUserNameAsync(string userName, string provider);
}
}

9
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs

@ -0,0 +1,9 @@
using System.Threading.Tasks;
namespace LINGYUN.Abp.WeChat.OpenId
{
public interface IWeChatOpenIdFinder
{
Task<WeChatOpenId> FindAsync(string code, string appId, string appSecret);
}
}

6
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/NullUserWeChatOpenIdFinder.cs → aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs

@ -2,16 +2,16 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.WeChat.Authorization namespace LINGYUN.Abp.WeChat.OpenId
{ {
public class NullUserWeChatOpenIdFinder : IUserWeChatOpenIdFinder, ISingletonDependency public class NullUserWeChatOpenIdFinder : IUserWeChatOpenIdFinder, ISingletonDependency
{ {
public Task<string> FindByUserIdAsync(Guid userId) public Task<string> FindByUserIdAsync(Guid userId, string provider)
{ {
return Task.FromResult(""); return Task.FromResult("");
} }
public Task<string> FindByUserNameAsync(string userName) public Task<string> FindByUserNameAsync(string userName, string provider)
{ {
return Task.FromResult(""); return Task.FromResult("");
} }

2
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenId.cs → aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs

@ -1,4 +1,4 @@
namespace LINGYUN.Abp.WeChat.Authorization namespace LINGYUN.Abp.WeChat.OpenId
{ {
public class WeChatOpenId public class WeChatOpenId
{ {

8
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdCacheItem.cs → aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs

@ -1,6 +1,4 @@
using System; namespace LINGYUN.Abp.WeChat.OpenId
namespace LINGYUN.Abp.WeChat.Authorization
{ {
public class WeChatOpenIdCacheItem public class WeChatOpenIdCacheItem
{ {
@ -18,9 +16,9 @@ namespace LINGYUN.Abp.WeChat.Authorization
WeChatOpenId = weChatOpenId; WeChatOpenId = weChatOpenId;
} }
public static string CalculateCacheKey(string code) public static string CalculateCacheKey(string appId, string code)
{ {
return "c:" + code; return "app:" + appId + ";code:" + code;
} }
} }
} }

18
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdFinder.cs → aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs

@ -2,7 +2,6 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using System; using System;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -11,14 +10,13 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.WeChat.Authorization namespace LINGYUN.Abp.WeChat.OpenId
{ {
[Dependency(ServiceLifetime.Singleton, ReplaceServices = true)] [Dependency(ServiceLifetime.Singleton, ReplaceServices = true)]
[ExposeServices(typeof(IWeChatOpenIdFinder))] [ExposeServices(typeof(IWeChatOpenIdFinder))]
public class WeChatOpenIdFinder : IWeChatOpenIdFinder public class WeChatOpenIdFinder : IWeChatOpenIdFinder
{ {
public ILogger<WeChatOpenIdFinder> Logger { get; set; } public ILogger<WeChatOpenIdFinder> Logger { get; set; }
protected AbpWeChatAuthorizationOptions Options { get; }
protected ICurrentTenant CurrentTenant { get; } protected ICurrentTenant CurrentTenant { get; }
protected IHttpClientFactory HttpClientFactory { get; } protected IHttpClientFactory HttpClientFactory { get; }
protected IJsonSerializer JsonSerializer { get; } protected IJsonSerializer JsonSerializer { get; }
@ -27,7 +25,6 @@ namespace LINGYUN.Abp.WeChat.Authorization
ICurrentTenant currentTenant, ICurrentTenant currentTenant,
IJsonSerializer jsonSerializer, IJsonSerializer jsonSerializer,
IHttpClientFactory httpClientFactory, IHttpClientFactory httpClientFactory,
IOptions<AbpWeChatAuthorizationOptions> options,
IDistributedCache<WeChatOpenIdCacheItem> cache) IDistributedCache<WeChatOpenIdCacheItem> cache)
{ {
CurrentTenant = currentTenant; CurrentTenant = currentTenant;
@ -35,20 +32,19 @@ namespace LINGYUN.Abp.WeChat.Authorization
HttpClientFactory = httpClientFactory; HttpClientFactory = httpClientFactory;
Cache = cache; Cache = cache;
Options = options.Value;
Logger = NullLogger<WeChatOpenIdFinder>.Instance; Logger = NullLogger<WeChatOpenIdFinder>.Instance;
} }
public virtual async Task<WeChatOpenId> FindAsync(string code) public virtual async Task<WeChatOpenId> FindAsync(string code, string appId, string appSecret)
{ {
// TODO: 如果需要获取SessionKey的话呢,需要再以openid作为标识来缓存一下吗 // TODO: 如果需要获取SessionKey的话呢,需要再以openid作为标识来缓存一下吗
// 或者前端保存code,通过传递code来获取 // 或者前端保存code,通过传递code来获取
return (await GetCacheItemAsync(code)).WeChatOpenId; return (await GetCacheItemAsync(code, appId, appSecret)).WeChatOpenId;
} }
protected virtual async Task<WeChatOpenIdCacheItem> GetCacheItemAsync(string code) protected virtual async Task<WeChatOpenIdCacheItem> GetCacheItemAsync(string code, string appId, string appSecret)
{ {
var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(code); var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(appId, code);
Logger.LogDebug($"WeChatOpenIdFinder.GetCacheItemAsync: {cacheKey}"); Logger.LogDebug($"WeChatOpenIdFinder.GetCacheItemAsync: {cacheKey}");
@ -67,8 +63,8 @@ namespace LINGYUN.Abp.WeChat.Authorization
var request = new WeChatOpenIdRequest var request = new WeChatOpenIdRequest
{ {
BaseUrl = client.BaseAddress.AbsoluteUri, BaseUrl = client.BaseAddress.AbsoluteUri,
AppId = Options.AppId, AppId = appId,
Secret = Options.AppSecret, Secret = appSecret,
Code = code Code = code
}; };

2
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdRequest.cs → aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs

@ -1,4 +1,4 @@
namespace LINGYUN.Abp.WeChat.Authorization namespace LINGYUN.Abp.WeChat.OpenId
{ {
public class WeChatOpenIdRequest public class WeChatOpenIdRequest
{ {

4
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdResponse.cs → aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs

@ -2,7 +2,7 @@
using System; using System;
using Volo.Abp; using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Authorization namespace LINGYUN.Abp.WeChat.OpenId
{ {
/// <summary> /// <summary>
/// 微信OpenId返回对象 /// 微信OpenId返回对象
@ -42,7 +42,7 @@ namespace LINGYUN.Abp.WeChat.Authorization
case "0": return string.Empty; case "0": return string.Empty;
case "40029": return "code 无效"; case "40029": return "code 无效";
case "45011": return "频率限制,每个用户每分钟100次"; case "45011": return "频率限制,每个用户每分钟100次";
default: return "未知的异常,请重试"; default: return $"未定义的异常代码:{ErrorCode},请重试";
}; };
} }
} }

48
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Security/Claims/AbpWeChatClaimTypes.cs

@ -0,0 +1,48 @@
namespace LINGYUN.Abp.WeChat.Security.Claims
{
/// <summary>
/// 微信认证身份类型,可以像 <see cref="Volo.Abp.Security.Claims.AbpClaimTypes"/> 自行配置
/// <br />
/// See: <see cref="https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html"/>
/// </summary>
public class AbpWeChatClaimTypes
{
/// <summary>
/// 用户的唯一标识
/// </summary>
public static string OpenId { get; set; } = "wx-openid"; // 可变更
/// <summary>
/// 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。
/// </summary>
public static string UnionId { get; set; } = "wx-unionid"; //可变更
/// <summary>
/// 用户昵称
/// </summary>
public static string NickName { get; set; } = "nickname";
/// <summary>
/// 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知
/// </summary>
public static string Sex { get; set; } = "sex";
/// <summary>
/// 国家,如中国为CN
/// </summary>
public static string Country { get; set; } = "country";
/// <summary>
/// 用户个人资料填写的省份
/// </summary>
public static string Province { get; set; } = "province";
/// <summary>
/// 普通用户个人资料填写的城市
/// </summary>
public static string City { get; set; } = "city";
/// <summary>
/// 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空。
/// 若用户更换头像,原有头像URL将失效。
/// </summary>
public static string AvatarUrl { get; set; } = "avatar";
/// <summary>
/// 用户特权信息,json 数组,如微信沃卡用户为(chinaunicom)
/// </summary>
public static string Privilege { get; set; } = "privilege";
}
}

7
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingNames.cs

@ -0,0 +1,7 @@
namespace LINGYUN.Abp.WeChat.Settings
{
public static class WeChatSettingNames
{
public const string Prefix = "Abp.WeChat";
}
}

10
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/IWeChatTokenProvider.cs

@ -0,0 +1,10 @@
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.WeChat.Token
{
public interface IWeChatTokenProvider
{
Task<WeChatToken> GetTokenAsync(string appId, string appSecret, CancellationToken cancellationToken = default);
}
}

26
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs

@ -0,0 +1,26 @@
namespace LINGYUN.Abp.WeChat.Token
{
/// <summary>
/// 微信令牌
/// </summary>
public class WeChatToken
{
/// <summary>
/// 访问令牌
/// </summary>
public string AccessToken { get; set; }
/// <summary>
/// 过期时间,单位(s)
/// </summary>
public int ExpiresIn { get; set; }
public WeChatToken()
{
}
public WeChatToken(string token, int expiresIn)
{
AccessToken = token;
ExpiresIn = expiresIn;
}
}
}

24
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs

@ -0,0 +1,24 @@
namespace LINGYUN.Abp.WeChat.Token
{
public class WeChatTokenCacheItem
{
public string AppId { get; set; }
public WeChatToken WeChatToken { get; set; }
public WeChatTokenCacheItem()
{
}
public WeChatTokenCacheItem(string appId, WeChatToken weChatToken)
{
AppId = appId;
WeChatToken = weChatToken;
}
public static string CalculateCacheKey(string provider, string appId)
{
return "p:" + provider + ",o:" + appId;
}
}
}

92
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs

@ -0,0 +1,92 @@
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Json;
namespace LINGYUN.Abp.WeChat.Token
{
public class WeChatTokenProvider : IWeChatTokenProvider, ISingletonDependency
{
public ILogger<WeChatTokenProvider> Logger { get; set; }
protected IHttpClientFactory HttpClientFactory { get; }
protected IJsonSerializer JsonSerializer { get; }
protected IDistributedCache<WeChatTokenCacheItem> Cache { get; }
public WeChatTokenProvider(
IJsonSerializer jsonSerializer,
IHttpClientFactory httpClientFactory,
IDistributedCache<WeChatTokenCacheItem> cache)
{
JsonSerializer = jsonSerializer;
HttpClientFactory = httpClientFactory;
Cache = cache;
Logger = NullLogger<WeChatTokenProvider>.Instance;
}
public virtual async Task<WeChatToken> GetTokenAsync(
string appId,
string appSecret,
CancellationToken cancellationToken = default)
{
return (await GetCacheItemAsync("WeChatToken", appId, appSecret, cancellationToken)).WeChatToken;
}
protected virtual async Task<WeChatTokenCacheItem> GetCacheItemAsync(
string provider,
string appId,
string appSecret,
CancellationToken cancellationToken = default)
{
var cacheKey = WeChatTokenCacheItem.CalculateCacheKey(provider, appId);
Logger.LogDebug($"WeChatTokenProvider.GetCacheItemAsync: {cacheKey}");
var cacheItem = await Cache.GetAsync(cacheKey, token: cancellationToken);
if (cacheItem != null)
{
Logger.LogDebug($"Found in the cache: {cacheKey}");
return cacheItem;
}
Logger.LogDebug($"Not found in the cache, getting from the httpClient: {cacheKey}");
var client = HttpClientFactory.CreateClient("WeChatRequestClient");
var request = new WeChatTokenRequest
{
BaseUrl = client.BaseAddress.AbsoluteUri,
AppSecret = appSecret,
AppId = appId,
GrantType = "client_credential"
};
var response = await client.RequestWeChatCodeTokenAsync(request, cancellationToken);
var responseContent = await response.Content.ReadAsStringAsync();
var weChatTokenResponse = JsonSerializer.Deserialize<WeChatTokenResponse>(responseContent);
var weChatToken = weChatTokenResponse.ToWeChatToken();
cacheItem = new WeChatTokenCacheItem(appId, weChatToken);
Logger.LogDebug($"Setting the cache item: {cacheKey}");
var cacheOptions = new DistributedCacheEntryOptions
{
// 设置绝对过期时间为Token有效期剩余的二分钟
AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(weChatToken.ExpiresIn - 120)
};
await Cache.SetAsync(cacheKey, cacheItem, cacheOptions, token: cancellationToken);
Logger.LogDebug($"Finished setting the cache item: {cacheKey}");
return cacheItem;
}
}
}

10
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs

@ -0,0 +1,10 @@
namespace LINGYUN.Abp.WeChat.Token
{
public class WeChatTokenRequest
{
public string BaseUrl { get; set; }
public string GrantType { get; set; }
public string AppId { get; set; }
public string AppSecret { get; set; }
}
}

41
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs

@ -0,0 +1,41 @@
using Newtonsoft.Json;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Token
{
/// <summary>
/// 微信访问令牌返回对象
/// </summary>
public class WeChatTokenResponse
{
/// <summary>
/// 错误码
/// </summary>
[JsonProperty("errcode")]
public int ErrorCode { get; set; }
/// <summary>
/// 错误消息
/// </summary>
[JsonProperty("errmsg")]
public string ErrorMessage { get; set; }
/// <summary>
/// 访问令牌
/// </summary>
[JsonProperty("access_token")]
public string AccessToken { get; set; }
/// <summary>
/// 过期时间,单位(s)
/// </summary>
[JsonProperty("expires_in")]
public int ExpiresIn { get; set; }
public WeChatToken ToWeChatToken()
{
if(ErrorCode != 0)
{
throw new AbpException(ErrorMessage);
}
return new WeChatToken(AccessToken, ExpiresIn);
}
}
}

46
aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/System/Net/Http/HttpClientWeChatTokenRequestExtensions.cs

@ -0,0 +1,46 @@
using LINGYUN.Abp.WeChat.OpenId;
using LINGYUN.Abp.WeChat.Token;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.Http
{
public static class HttpClientWeChatTokenRequestExtensions
{
public static async Task<HttpResponseMessage> RequestWeChatCodeTokenAsync(this HttpMessageInvoker client, WeChatTokenRequest request, CancellationToken cancellationToken = default)
{
var getResuestUrlBuilder = new StringBuilder();
getResuestUrlBuilder.Append(request.BaseUrl);
getResuestUrlBuilder.Append("cgi-bin/token");
getResuestUrlBuilder.Append("?grant_type=client_credential");
getResuestUrlBuilder.AppendFormat("&appid={0}", request.AppId);
getResuestUrlBuilder.AppendFormat("&secret={0}", request.AppSecret);
var getRequest = new HttpRequestMessage(HttpMethod.Get, getResuestUrlBuilder.ToString());
HttpResponseMessage httpResponse;
httpResponse = await client.SendAsync(getRequest, cancellationToken).ConfigureAwait(false);
return httpResponse;
}
public static async Task<HttpResponseMessage> RequestWeChatOpenIdAsync(this HttpMessageInvoker client, WeChatOpenIdRequest request, CancellationToken cancellationToken = default)
{
var getResuestUrlBuiilder = new StringBuilder();
getResuestUrlBuiilder.Append(request.BaseUrl);
getResuestUrlBuiilder.Append("sns/jscode2session");
getResuestUrlBuiilder.AppendFormat("?appid={0}", request.AppId);
getResuestUrlBuiilder.AppendFormat("&secret={0}", request.Secret);
getResuestUrlBuiilder.AppendFormat("&js_code={0}", request.Code);
getResuestUrlBuiilder.Append("&grant_type=authorization_code");
var getRequest = new HttpRequestMessage(HttpMethod.Get, getResuestUrlBuiilder.ToString());
HttpResponseMessage httpResponse;
httpResponse = await client.SendAsync(getRequest, cancellationToken).ConfigureAwait(false);
return httpResponse;
}
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save