diff --git a/WeChatManagement.sln b/WeChatManagement.sln index bc8283fb..5d1905c9 100644 --- a/WeChatManagement.sln +++ b/WeChatManagement.sln @@ -85,6 +85,36 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{C17A EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WeChatManagementSample", "WeChatManagementSample", "{1A87614D-01D8-43A5-9AD5-D18F5E50D89D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Application", "modules\Common\src\EasyAbp.WeChatManagement.Common.Application\EasyAbp.WeChatManagement.Common.Application.csproj", "{D3E4F434-ACD4-4DE9-AF35-938F69D94C8E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Application.Contracts", "modules\Common\src\EasyAbp.WeChatManagement.Common.Application.Contracts\EasyAbp.WeChatManagement.Common.Application.Contracts.csproj", "{2146CA1E-B9FB-4A06-A461-5D88BED2B985}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Domain", "modules\Common\src\EasyAbp.WeChatManagement.Common.Domain\EasyAbp.WeChatManagement.Common.Domain.csproj", "{C652B37C-96A1-4554-A9B7-5E96DA4B0C0E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.EntityFrameworkCore", "modules\Common\src\EasyAbp.WeChatManagement.Common.EntityFrameworkCore\EasyAbp.WeChatManagement.Common.EntityFrameworkCore.csproj", "{DBA91F3C-76F4-4934-B265-3B860901F9AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.HttpApi", "modules\Common\src\EasyAbp.WeChatManagement.Common.HttpApi\EasyAbp.WeChatManagement.Common.HttpApi.csproj", "{D88A7E5F-DA06-440D-9CBE-58220EDE0A9E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.HttpApi.Client", "modules\Common\src\EasyAbp.WeChatManagement.Common.HttpApi.Client\EasyAbp.WeChatManagement.Common.HttpApi.Client.csproj", "{C20A8A3A-0501-4D29-B11E-AC42FA5461B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.MongoDB", "modules\Common\src\EasyAbp.WeChatManagement.Common.MongoDB\EasyAbp.WeChatManagement.Common.MongoDB.csproj", "{B11938D2-AC06-4AF4-A83B-7EBCE8CDCC92}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Web", "modules\Common\src\EasyAbp.WeChatManagement.Common.Web\EasyAbp.WeChatManagement.Common.Web.csproj", "{AD6701CC-59D0-454B-9582-A0AE378EEF1D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{32D52B09-3F02-4EA3-A295-977D364FCFC7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Application.Tests", "modules\Common\test\EasyAbp.WeChatManagement.Common.Application.Tests\EasyAbp.WeChatManagement.Common.Application.Tests.csproj", "{B740F6B8-24C2-4AC7-A44F-45222ACF12D5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Domain.Tests", "modules\Common\test\EasyAbp.WeChatManagement.Common.Domain.Tests\EasyAbp.WeChatManagement.Common.Domain.Tests.csproj", "{0945EB12-D353-430C-A59E-9688FD52937F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests", "modules\Common\test\EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests\EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests.csproj", "{3F626335-0D2D-424C-9D9E-55E8FFC8544C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp", "modules\Common\test\EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp\EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp.csproj", "{9B78FFE3-32AA-4EDA-8475-F931EA6171B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.MongoDB.Tests", "modules\Common\test\EasyAbp.WeChatManagement.Common.MongoDB.Tests\EasyAbp.WeChatManagement.Common.MongoDB.Tests.csproj", "{E793F3D2-5E8A-4281-9597-3F8EA14FA8E8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.TestBase", "modules\Common\test\EasyAbp.WeChatManagement.Common.TestBase\EasyAbp.WeChatManagement.Common.TestBase.csproj", "{23D54D42-4626-43BE-8949-14B1965F24B4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -215,6 +245,62 @@ Global {EEE6309B-919B-40CA-8CF2-7DB9855B980D}.Debug|Any CPU.Build.0 = Debug|Any CPU {EEE6309B-919B-40CA-8CF2-7DB9855B980D}.Release|Any CPU.ActiveCfg = Release|Any CPU {EEE6309B-919B-40CA-8CF2-7DB9855B980D}.Release|Any CPU.Build.0 = Release|Any CPU + {D3E4F434-ACD4-4DE9-AF35-938F69D94C8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3E4F434-ACD4-4DE9-AF35-938F69D94C8E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3E4F434-ACD4-4DE9-AF35-938F69D94C8E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3E4F434-ACD4-4DE9-AF35-938F69D94C8E}.Release|Any CPU.Build.0 = Release|Any CPU + {2146CA1E-B9FB-4A06-A461-5D88BED2B985}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2146CA1E-B9FB-4A06-A461-5D88BED2B985}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2146CA1E-B9FB-4A06-A461-5D88BED2B985}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2146CA1E-B9FB-4A06-A461-5D88BED2B985}.Release|Any CPU.Build.0 = Release|Any CPU + {C652B37C-96A1-4554-A9B7-5E96DA4B0C0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C652B37C-96A1-4554-A9B7-5E96DA4B0C0E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C652B37C-96A1-4554-A9B7-5E96DA4B0C0E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C652B37C-96A1-4554-A9B7-5E96DA4B0C0E}.Release|Any CPU.Build.0 = Release|Any CPU + {DBA91F3C-76F4-4934-B265-3B860901F9AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DBA91F3C-76F4-4934-B265-3B860901F9AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DBA91F3C-76F4-4934-B265-3B860901F9AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DBA91F3C-76F4-4934-B265-3B860901F9AB}.Release|Any CPU.Build.0 = Release|Any CPU + {D88A7E5F-DA06-440D-9CBE-58220EDE0A9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D88A7E5F-DA06-440D-9CBE-58220EDE0A9E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D88A7E5F-DA06-440D-9CBE-58220EDE0A9E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D88A7E5F-DA06-440D-9CBE-58220EDE0A9E}.Release|Any CPU.Build.0 = Release|Any CPU + {C20A8A3A-0501-4D29-B11E-AC42FA5461B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C20A8A3A-0501-4D29-B11E-AC42FA5461B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C20A8A3A-0501-4D29-B11E-AC42FA5461B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C20A8A3A-0501-4D29-B11E-AC42FA5461B1}.Release|Any CPU.Build.0 = Release|Any CPU + {B11938D2-AC06-4AF4-A83B-7EBCE8CDCC92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B11938D2-AC06-4AF4-A83B-7EBCE8CDCC92}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B11938D2-AC06-4AF4-A83B-7EBCE8CDCC92}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B11938D2-AC06-4AF4-A83B-7EBCE8CDCC92}.Release|Any CPU.Build.0 = Release|Any CPU + {AD6701CC-59D0-454B-9582-A0AE378EEF1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AD6701CC-59D0-454B-9582-A0AE378EEF1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AD6701CC-59D0-454B-9582-A0AE378EEF1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AD6701CC-59D0-454B-9582-A0AE378EEF1D}.Release|Any CPU.Build.0 = Release|Any CPU + {B740F6B8-24C2-4AC7-A44F-45222ACF12D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B740F6B8-24C2-4AC7-A44F-45222ACF12D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B740F6B8-24C2-4AC7-A44F-45222ACF12D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B740F6B8-24C2-4AC7-A44F-45222ACF12D5}.Release|Any CPU.Build.0 = Release|Any CPU + {0945EB12-D353-430C-A59E-9688FD52937F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0945EB12-D353-430C-A59E-9688FD52937F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0945EB12-D353-430C-A59E-9688FD52937F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0945EB12-D353-430C-A59E-9688FD52937F}.Release|Any CPU.Build.0 = Release|Any CPU + {3F626335-0D2D-424C-9D9E-55E8FFC8544C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F626335-0D2D-424C-9D9E-55E8FFC8544C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F626335-0D2D-424C-9D9E-55E8FFC8544C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F626335-0D2D-424C-9D9E-55E8FFC8544C}.Release|Any CPU.Build.0 = Release|Any CPU + {9B78FFE3-32AA-4EDA-8475-F931EA6171B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B78FFE3-32AA-4EDA-8475-F931EA6171B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B78FFE3-32AA-4EDA-8475-F931EA6171B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B78FFE3-32AA-4EDA-8475-F931EA6171B1}.Release|Any CPU.Build.0 = Release|Any CPU + {E793F3D2-5E8A-4281-9597-3F8EA14FA8E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E793F3D2-5E8A-4281-9597-3F8EA14FA8E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E793F3D2-5E8A-4281-9597-3F8EA14FA8E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E793F3D2-5E8A-4281-9597-3F8EA14FA8E8}.Release|Any CPU.Build.0 = Release|Any CPU + {23D54D42-4626-43BE-8949-14B1965F24B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23D54D42-4626-43BE-8949-14B1965F24B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23D54D42-4626-43BE-8949-14B1965F24B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23D54D42-4626-43BE-8949-14B1965F24B4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -259,6 +345,21 @@ Global {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} = {6CC06C70-1A1D-4FAF-A12A-A8D3AFF662B6} {EEE6309B-919B-40CA-8CF2-7DB9855B980D} = {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} {1A87614D-01D8-43A5-9AD5-D18F5E50D89D} = {C17A0276-1AC8-489C-BDDF-9E22DFABD5AF} + {D3E4F434-ACD4-4DE9-AF35-938F69D94C8E} = {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} + {2146CA1E-B9FB-4A06-A461-5D88BED2B985} = {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} + {C652B37C-96A1-4554-A9B7-5E96DA4B0C0E} = {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} + {DBA91F3C-76F4-4934-B265-3B860901F9AB} = {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} + {D88A7E5F-DA06-440D-9CBE-58220EDE0A9E} = {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} + {C20A8A3A-0501-4D29-B11E-AC42FA5461B1} = {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} + {B11938D2-AC06-4AF4-A83B-7EBCE8CDCC92} = {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} + {AD6701CC-59D0-454B-9582-A0AE378EEF1D} = {F4322739-BB8B-44B1-80E4-9FA3EFBEA8EB} + {32D52B09-3F02-4EA3-A295-977D364FCFC7} = {6CC06C70-1A1D-4FAF-A12A-A8D3AFF662B6} + {B740F6B8-24C2-4AC7-A44F-45222ACF12D5} = {32D52B09-3F02-4EA3-A295-977D364FCFC7} + {0945EB12-D353-430C-A59E-9688FD52937F} = {32D52B09-3F02-4EA3-A295-977D364FCFC7} + {3F626335-0D2D-424C-9D9E-55E8FFC8544C} = {32D52B09-3F02-4EA3-A295-977D364FCFC7} + {9B78FFE3-32AA-4EDA-8475-F931EA6171B1} = {32D52B09-3F02-4EA3-A295-977D364FCFC7} + {E793F3D2-5E8A-4281-9597-3F8EA14FA8E8} = {32D52B09-3F02-4EA3-A295-977D364FCFC7} + {23D54D42-4626-43BE-8949-14B1965F24B4} = {32D52B09-3F02-4EA3-A295-977D364FCFC7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} diff --git a/common.props b/common.props index f7c0911f..9914aea6 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 0.13.1 + 1.0.0 $(NoWarn);CS1591 true EasyAbp Team diff --git a/modules/Common/.gitignore b/modules/Common/.gitignore index 2039f0d4..b9a72229 100644 --- a/modules/Common/.gitignore +++ b/modules/Common/.gitignore @@ -256,3 +256,4 @@ host/EasyAbp.WeChatManagement.Common.IdentityServer/Logs/logs.txt host/EasyAbp.WeChatManagement.Common.HttpApi.Host/Logs/logs.txt host/EasyAbp.WeChatManagement.Common.Web.Host/Logs/logs.txt host/EasyAbp.WeChatManagement.Common.Web.Unified/Logs/logs.txt +host/EasyAbp.WeChatManagement.Common.Blazor.Server.Host/Logs/logs.txt \ No newline at end of file diff --git a/modules/Common/.prettierrc b/modules/Common/.prettierrc new file mode 100644 index 00000000..56af76bd --- /dev/null +++ b/modules/Common/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/modules/Common/EasyAbp.WeChatManagement.Common.sln b/modules/Common/EasyAbp.WeChatManagement.Common.sln index e5c74935..98aacd9c 100644 --- a/modules/Common/EasyAbp.WeChatManagement.Common.sln +++ b/modules/Common/EasyAbp.WeChatManagement.Common.sln @@ -5,12 +5,60 @@ VisualStudioVersion = 16.0.29001.49 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Domain.Shared", "src\EasyAbp.WeChatManagement.Common.Domain.Shared\EasyAbp.WeChatManagement.Common.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Domain", "src\EasyAbp.WeChatManagement.Common.Domain\EasyAbp.WeChatManagement.Common.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Application.Contracts", "src\EasyAbp.WeChatManagement.Common.Application.Contracts\EasyAbp.WeChatManagement.Common.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Application", "src\EasyAbp.WeChatManagement.Common.Application\EasyAbp.WeChatManagement.Common.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.EntityFrameworkCore", "src\EasyAbp.WeChatManagement.Common.EntityFrameworkCore\EasyAbp.WeChatManagement.Common.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.MongoDB", "src\EasyAbp.WeChatManagement.Common.MongoDB\EasyAbp.WeChatManagement.Common.MongoDB.csproj", "{F1C58097-4C08-4D88-8976-6B3389391481}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.HttpApi", "src\EasyAbp.WeChatManagement.Common.HttpApi\EasyAbp.WeChatManagement.Common.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.HttpApi.Client", "src\EasyAbp.WeChatManagement.Common.HttpApi.Client\EasyAbp.WeChatManagement.Common.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.TestBase", "test\EasyAbp.WeChatManagement.Common.TestBase\EasyAbp.WeChatManagement.Common.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests", "test\EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests\EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.MongoDB.Tests", "test\EasyAbp.WeChatManagement.Common.MongoDB.Tests\EasyAbp.WeChatManagement.Common.MongoDB.Tests.csproj", "{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Domain.Tests", "test\EasyAbp.WeChatManagement.Common.Domain.Tests\EasyAbp.WeChatManagement.Common.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Application.Tests", "test\EasyAbp.WeChatManagement.Common.Application.Tests\EasyAbp.WeChatManagement.Common.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.HttpApi.Host", "host\EasyAbp.WeChatManagement.Common.HttpApi.Host\EasyAbp.WeChatManagement.Common.HttpApi.Host.csproj", "{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Web", "src\EasyAbp.WeChatManagement.Common.Web\EasyAbp.WeChatManagement.Common.Web.csproj", "{3B7B6317-1B85-4164-8E11-75574F80AE17}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp", "test\EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp\EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Web.Host", "host\EasyAbp.WeChatManagement.Common.Web.Host\EasyAbp.WeChatManagement.Common.Web.Host.csproj", "{73513786-B6C6-4A21-89C5-0FBDD0A46107}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.IdentityServer", "host\EasyAbp.WeChatManagement.Common.IdentityServer\EasyAbp.WeChatManagement.Common.IdentityServer.csproj", "{690203F4-3CD5-4569-88D9-EE831EEA5F5F}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Host.Shared", "host\EasyAbp.WeChatManagement.Common.Host.Shared\EasyAbp.WeChatManagement.Common.Host.Shared.csproj", "{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.WeChatManagement.Common.Web.Unified", "host\EasyAbp.WeChatManagement.Common.Web.Unified\EasyAbp.WeChatManagement.Common.Web.Unified.csproj", "{3D872C41-E226-45C8-89C1-9D3DBD7C73F2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Blazor", "src\EasyAbp.WeChatManagement.Common.Blazor\EasyAbp.WeChatManagement.Common.Blazor.csproj", "{827FCC18-A22B-4175-82CD-1233F6DEE8FB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Blazor.Host", "host\EasyAbp.WeChatManagement.Common.Blazor.Host\EasyAbp.WeChatManagement.Common.Blazor.Host.csproj", "{D7E0F672-F5E2-4338-AFF4-4E5091C55A62}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Blazor.Server", "src\EasyAbp.WeChatManagement.Common.Blazor.Server\EasyAbp.WeChatManagement.Common.Blazor.Server.csproj", "{299BE52E-823F-408E-9C6D-7E2F81BA34FF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Blazor.WebAssembly", "src\EasyAbp.WeChatManagement.Common.Blazor.WebAssembly\EasyAbp.WeChatManagement.Common.Blazor.WebAssembly.csproj", "{F0EE5760-262D-456A-AA7C-E84F484A05F6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.WeChatManagement.Common.Blazor.Server.Host", "host\EasyAbp.WeChatManagement.Common.Blazor.Server.Host\EasyAbp.WeChatManagement.Common.Blazor.Server.Host.csproj", "{FEA752A1-5B4E-49E9-B1F3-DDC25E41BB52}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,17 +69,132 @@ Global {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.Build.0 = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.Build.0 = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.Build.0 = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.Build.0 = Release|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.Build.0 = Release|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.Build.0 = Release|Any CPU + {73513786-B6C6-4A21-89C5-0FBDD0A46107}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73513786-B6C6-4A21-89C5-0FBDD0A46107}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73513786-B6C6-4A21-89C5-0FBDD0A46107}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73513786-B6C6-4A21-89C5-0FBDD0A46107}.Release|Any CPU.Build.0 = Release|Any CPU + {690203F4-3CD5-4569-88D9-EE831EEA5F5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {690203F4-3CD5-4569-88D9-EE831EEA5F5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {690203F4-3CD5-4569-88D9-EE831EEA5F5F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {690203F4-3CD5-4569-88D9-EE831EEA5F5F}.Release|Any CPU.Build.0 = Release|Any CPU {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.Build.0 = Debug|Any CPU {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.Build.0 = Release|Any CPU + {3D872C41-E226-45C8-89C1-9D3DBD7C73F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3D872C41-E226-45C8-89C1-9D3DBD7C73F2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3D872C41-E226-45C8-89C1-9D3DBD7C73F2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3D872C41-E226-45C8-89C1-9D3DBD7C73F2}.Release|Any CPU.Build.0 = Release|Any CPU + {827FCC18-A22B-4175-82CD-1233F6DEE8FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {827FCC18-A22B-4175-82CD-1233F6DEE8FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {827FCC18-A22B-4175-82CD-1233F6DEE8FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {827FCC18-A22B-4175-82CD-1233F6DEE8FB}.Release|Any CPU.Build.0 = Release|Any CPU + {D7E0F672-F5E2-4338-AFF4-4E5091C55A62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7E0F672-F5E2-4338-AFF4-4E5091C55A62}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7E0F672-F5E2-4338-AFF4-4E5091C55A62}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7E0F672-F5E2-4338-AFF4-4E5091C55A62}.Release|Any CPU.Build.0 = Release|Any CPU + {299BE52E-823F-408E-9C6D-7E2F81BA34FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {299BE52E-823F-408E-9C6D-7E2F81BA34FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {299BE52E-823F-408E-9C6D-7E2F81BA34FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {299BE52E-823F-408E-9C6D-7E2F81BA34FF}.Release|Any CPU.Build.0 = Release|Any CPU + {F0EE5760-262D-456A-AA7C-E84F484A05F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0EE5760-262D-456A-AA7C-E84F484A05F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0EE5760-262D-456A-AA7C-E84F484A05F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0EE5760-262D-456A-AA7C-E84F484A05F6}.Release|Any CPU.Build.0 = Release|Any CPU + {FEA752A1-5B4E-49E9-B1F3-DDC25E41BB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FEA752A1-5B4E-49E9-B1F3-DDC25E41BB52}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FEA752A1-5B4E-49E9-B1F3-DDC25E41BB52}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FEA752A1-5B4E-49E9-B1F3-DDC25E41BB52}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F1C58097-4C08-4D88-8976-6B3389391481} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2} = {E400416D-2895-4512-9D17-90681EEC7E0A} + {3B7B6317-1B85-4164-8E11-75574F80AE17} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {73513786-B6C6-4A21-89C5-0FBDD0A46107} = {E400416D-2895-4512-9D17-90681EEC7E0A} + {690203F4-3CD5-4569-88D9-EE831EEA5F5F} = {E400416D-2895-4512-9D17-90681EEC7E0A} {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB} = {E400416D-2895-4512-9D17-90681EEC7E0A} + {3D872C41-E226-45C8-89C1-9D3DBD7C73F2} = {E400416D-2895-4512-9D17-90681EEC7E0A} + {827FCC18-A22B-4175-82CD-1233F6DEE8FB} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {D7E0F672-F5E2-4338-AFF4-4E5091C55A62} = {E400416D-2895-4512-9D17-90681EEC7E0A} + {299BE52E-823F-408E-9C6D-7E2F81BA34FF} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F0EE5760-262D-456A-AA7C-E84F484A05F6} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {FEA752A1-5B4E-49E9-B1F3-DDC25E41BB52} = {E400416D-2895-4512-9D17-90681EEC7E0A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} diff --git a/modules/Common/NuGet.Config b/modules/Common/NuGet.Config new file mode 100644 index 00000000..be8a1ece --- /dev/null +++ b/modules/Common/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/modules/Common/common.props b/modules/Common/common.props new file mode 100644 index 00000000..01eae141 --- /dev/null +++ b/modules/Common/common.props @@ -0,0 +1,24 @@ + + + latest + 0.1.0 + $(NoWarn);CS1591 + module + + + + + + All + runtime; build; native; contentfiles; analyzers + + + + + + + $(NoWarn);0436 + + + + \ No newline at end of file diff --git a/modules/Common/docker-compose.migrations.yml b/modules/Common/docker-compose.migrations.yml new file mode 100644 index 00000000..f3cfeeac --- /dev/null +++ b/modules/Common/docker-compose.migrations.yml @@ -0,0 +1,13 @@ +version: '3.4' + +services: + migrations: + build: + context: ../../ + dockerfile: templates/service/database/Dockerfile + depends_on: + - sqlserver + environment: + - IdentityServer_DB=Common_Identity + - Common_DB=Common_ModuleDb + - SA_PASSWORD=yourStrong(!)Password diff --git a/modules/Common/docker-compose.override.yml b/modules/Common/docker-compose.override.yml new file mode 100644 index 00000000..60c89bad --- /dev/null +++ b/modules/Common/docker-compose.override.yml @@ -0,0 +1,29 @@ +version: '3.4' + +services: + sqlserver: + environment: + - SA_PASSWORD=yourStrong(!)Password + - ACCEPT_EULA=Y + ports: + - "51599:1433" + + identity-server: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=Common_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=Common_Cache;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + ports: + - "51600:80" + + common: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=Common_ModuleDb;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpSettingManagement=Server=sqlserver;Database=Common_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpPermissionManagement=Server=sqlserver;Database=Common_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpAuditLogging=Server=sqlserver;Database=Common_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=Common_Cache;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - AuthServer__Authority=http://identity-server + ports: + - "51601:80" \ No newline at end of file diff --git a/modules/Common/docker-compose.yml b/modules/Common/docker-compose.yml new file mode 100644 index 00000000..57f3a7dd --- /dev/null +++ b/modules/Common/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.4' + +services: + sqlserver: + image: mcr.microsoft.com/mssql/server + volumes: + - dbdata:/var/opt/mssql + + identity-server: + build: + context: ../../ + dockerfile: templates/service/host/IdentityServerHost/Dockerfile + depends_on: + - sqlserver + + common: + build: + context: ../../ + dockerfile: templates/service/host/EasyAbp.WeChatManagement.Common.Host/Dockerfile + depends_on: + - sqlserver + - identity-server + +volumes: + dbdata: \ No newline at end of file diff --git a/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/EasyAbp.WeChatManagement.Common.Host.Shared.csproj b/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/EasyAbp.WeChatManagement.Common.Host.Shared.csproj index 4e2ca47e..6c7c2b77 100644 --- a/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/EasyAbp.WeChatManagement.Common.Host.Shared.csproj +++ b/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/EasyAbp.WeChatManagement.Common.Host.Shared.csproj @@ -4,7 +4,7 @@ netstandard2.0 - EasyAbp.WeChatManagement.MiniPrograms + EasyAbp.WeChatManagement.Common diff --git a/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/FodyWeavers.xml b/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/FodyWeavers.xsd b/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/MultiTenancy/MultiTenancyConsts.cs b/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 00000000..933e9f9f --- /dev/null +++ b/modules/Common/host/EasyAbp.WeChatManagement.Common.Host.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.WeChatManagement.Common.MultiTenancy +{ + public static class MultiTenancyConsts + { + /* Enable/disable multi-tenancy in a single point + * to test your module with multi-tenancy. + */ + public const bool IsEnabled = false; + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp.WeChatManagement.Common.Application.Contracts.csproj b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp.WeChatManagement.Common.Application.Contracts.csproj new file mode 100644 index 00000000..939df6fc --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp.WeChatManagement.Common.Application.Contracts.csproj @@ -0,0 +1,16 @@ + + + + + + netstandard2.0 + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/Permissions/CommonPermissionDefinitionProvider.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/Permissions/CommonPermissionDefinitionProvider.cs new file mode 100644 index 00000000..17ca5d63 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/Permissions/CommonPermissionDefinitionProvider.cs @@ -0,0 +1,27 @@ +using EasyAbp.WeChatManagement.Common.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace EasyAbp.WeChatManagement.Common.Permissions +{ + public class CommonPermissionDefinitionProvider : PermissionDefinitionProvider + { + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(CommonPermissions.GroupName, L("Permission:Common")); + + var weChatAppPermission = myGroup.AddPermission(CommonPermissions.WeChatApp.Default, L("Permission:WeChatApp")); + weChatAppPermission.AddChild(CommonPermissions.WeChatApp.Create, L("Permission:Create")); + weChatAppPermission.AddChild(CommonPermissions.WeChatApp.Update, L("Permission:Update")); + weChatAppPermission.AddChild(CommonPermissions.WeChatApp.Delete, L("Permission:Delete")); + + var weChatAppUserPermission = myGroup.AddPermission(CommonPermissions.WeChatAppUser.Default, L("Permission:WeChatAppUserUser")); + + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/Permissions/CommonPermissions.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/Permissions/CommonPermissions.cs new file mode 100644 index 00000000..88703b28 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/Permissions/CommonPermissions.cs @@ -0,0 +1,27 @@ +using Volo.Abp.Reflection; + +namespace EasyAbp.WeChatManagement.Common.Permissions +{ + public class CommonPermissions + { + public const string GroupName = "EasyAbp.WeChatManagement.Common"; + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(CommonPermissions)); + } + + public class WeChatApp + { + public const string Default = GroupName + ".WeChatApp"; + public const string Update = Default + ".Update"; + public const string Create = Default + ".Create"; + public const string Delete = Default + ".Delete"; + } + + public class WeChatAppUser + { + public const string Default = GroupName + ".WeChatAppUser"; + } + } +} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/Dtos/MiniProgramUserDto.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatAppUsers/Dtos/WeChatAppUserDto.cs similarity index 64% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/Dtos/MiniProgramUserDto.cs rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatAppUsers/Dtos/WeChatAppUserDto.cs index 979af448..54d185f8 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/Dtos/MiniProgramUserDto.cs +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatAppUsers/Dtos/WeChatAppUserDto.cs @@ -1,12 +1,12 @@ using System; using Volo.Abp.Application.Dtos; -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers.Dtos +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers.Dtos { [Serializable] - public class MiniProgramUserDto : FullAuditedEntityDto + public class WeChatAppUserDto : FullAuditedEntityDto { - public Guid MiniProgramId { get; set; } + public Guid WeChatAppId { get; set; } public Guid UserId { get; set; } diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatAppUsers/IWeChatAppUserAppService.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatAppUsers/IWeChatAppUserAppService.cs new file mode 100644 index 00000000..8f91e5dd --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatAppUsers/IWeChatAppUserAppService.cs @@ -0,0 +1,16 @@ +using System; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers +{ + public interface IWeChatAppUserAppService : + IReadOnlyAppService< + WeChatAppUserDto, + Guid, + PagedAndSortedResultRequestDto> + { + + } +} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/Dtos/CreateUpdateMiniProgramDto.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatApps/Dtos/CreateUpdateWeChatAppDto.cs similarity index 74% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/Dtos/CreateUpdateMiniProgramDto.cs rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatApps/Dtos/CreateUpdateWeChatAppDto.cs index 64e24468..37947a26 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/Dtos/CreateUpdateMiniProgramDto.cs +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatApps/Dtos/CreateUpdateWeChatAppDto.cs @@ -1,10 +1,12 @@ using System; -using System.ComponentModel; -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.Dtos + +namespace EasyAbp.WeChatManagement.Common.WeChatApps.Dtos { [Serializable] - public class CreateUpdateMiniProgramDto + public class CreateUpdateWeChatAppDto { + public WeChatAppType Type { get; set; } + public Guid? WeChatComponentId { get; set; } public string Name { get; set; } diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/Dtos/MiniProgramDto.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatApps/Dtos/WeChatAppDto.cs similarity index 75% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/Dtos/MiniProgramDto.cs rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatApps/Dtos/WeChatAppDto.cs index 97fff18a..8e168773 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/Dtos/MiniProgramDto.cs +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatApps/Dtos/WeChatAppDto.cs @@ -1,11 +1,13 @@ using System; using Volo.Abp.Application.Dtos; -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.Dtos +namespace EasyAbp.WeChatManagement.Common.WeChatApps.Dtos { [Serializable] - public class MiniProgramDto : FullAuditedEntityDto + public class WeChatAppDto : FullAuditedEntityDto { + public WeChatAppType Type { get; set; } + public Guid? WeChatComponentId { get; set; } public string Name { get; set; } diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatApps/IWeChatAppAppService.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatApps/IWeChatAppAppService.cs new file mode 100644 index 00000000..a91796f9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatApps/IWeChatAppAppService.cs @@ -0,0 +1,18 @@ +using System; +using EasyAbp.WeChatManagement.Common.WeChatApps.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.WeChatManagement.Common.WeChatApps +{ + public interface IWeChatAppAppService : + ICrudAppService< + WeChatAppDto, + Guid, + PagedAndSortedResultRequestDto, + CreateUpdateWeChatAppDto, + CreateUpdateWeChatAppDto> + { + + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatManagementCommonApplicationContractsModule.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatManagementCommonApplicationContractsModule.cs new file mode 100644 index 00000000..f3368c46 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/EasyAbp/WeChatManagement/Common/WeChatManagementCommonApplicationContractsModule.cs @@ -0,0 +1,16 @@ +using Volo.Abp.Application; +using Volo.Abp.Modularity; +using Volo.Abp.Authorization; + +namespace EasyAbp.WeChatManagement.Common +{ + [DependsOn( + typeof(WeChatManagementCommonDomainSharedModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationModule) + )] + public class WeChatManagementCommonApplicationContractsModule : AbpModule + { + + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/FodyWeavers.xml b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/FodyWeavers.xsd b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application.Contracts/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp.WeChatManagement.Common.Application.csproj b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp.WeChatManagement.Common.Application.csproj new file mode 100644 index 00000000..8af5d9d3 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp.WeChatManagement.Common.Application.csproj @@ -0,0 +1,17 @@ + + + + + + netstandard2.0 + + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/CommonAppService.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/CommonAppService.cs new file mode 100644 index 00000000..a1814e70 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/CommonAppService.cs @@ -0,0 +1,14 @@ +using EasyAbp.WeChatManagement.Common.Localization; +using Volo.Abp.Application.Services; + +namespace EasyAbp.WeChatManagement.Common +{ + public abstract class CommonAppService : ApplicationService + { + protected CommonAppService() + { + LocalizationResource = typeof(CommonResource); + ObjectMapperContext = typeof(WeChatManagementCommonApplicationModule); + } + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/CommonApplicationAutoMapperProfile.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/CommonApplicationAutoMapperProfile.cs new file mode 100644 index 00000000..17c17aa3 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/CommonApplicationAutoMapperProfile.cs @@ -0,0 +1,22 @@ +using AutoMapper; +using EasyAbp.WeChatManagement.Common.WeChatApps; +using EasyAbp.WeChatManagement.Common.WeChatApps.Dtos; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers.Dtos; + +namespace EasyAbp.WeChatManagement.Common +{ + public class CommonApplicationAutoMapperProfile : Profile + { + public CommonApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + + CreateMap(); + CreateMap(MemberList.Source); + CreateMap(); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserAppService.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserAppService.cs new file mode 100644 index 00000000..cf4c3936 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserAppService.cs @@ -0,0 +1,22 @@ +using System; +using EasyAbp.WeChatManagement.Common.Permissions; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers +{ + public class WeChatAppUserAppService : ReadOnlyAppService, + IWeChatAppUserAppService + { + protected override string GetPolicyName { get; set; } = CommonPermissions.WeChatAppUser.Default; + protected override string GetListPolicyName { get; set; } = CommonPermissions.WeChatAppUser.Default; + + private readonly IWeChatAppUserRepository _repository; + + public WeChatAppUserAppService(IWeChatAppUserRepository repository) : base(repository) + { + _repository = repository; + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppAppService.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppAppService.cs new file mode 100644 index 00000000..a625a742 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppAppService.cs @@ -0,0 +1,24 @@ +using System; +using EasyAbp.WeChatManagement.Common.Permissions; +using EasyAbp.WeChatManagement.Common.WeChatApps.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.WeChatManagement.Common.WeChatApps +{ + public class WeChatAppAppService : CrudAppService, + IWeChatAppAppService + { + protected override string GetPolicyName { get; set; } = CommonPermissions.WeChatApp.Default; + protected override string GetListPolicyName { get; set; } = CommonPermissions.WeChatApp.Default; + protected override string CreatePolicyName { get; set; } = CommonPermissions.WeChatApp.Create; + protected override string UpdatePolicyName { get; set; } = CommonPermissions.WeChatApp.Update; + protected override string DeletePolicyName { get; set; } = CommonPermissions.WeChatApp.Delete; + private readonly IWeChatAppRepository _repository; + + public WeChatAppAppService(IWeChatAppRepository repository) : base(repository) + { + _repository = repository; + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/WeChatManagementCommonApplicationModule.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/WeChatManagementCommonApplicationModule.cs new file mode 100644 index 00000000..ee609158 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/EasyAbp/WeChatManagement/Common/WeChatManagementCommonApplicationModule.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.Application; + +namespace EasyAbp.WeChatManagement.Common +{ + [DependsOn( + typeof(WeChatManagementCommonDomainModule), + typeof(WeChatManagementCommonApplicationContractsModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule) + )] + public class WeChatManagementCommonApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + } + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/FodyWeavers.xml b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/FodyWeavers.xsd b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Application/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/cs.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/cs.json deleted file mode 100644 index 7e0fbb38..00000000 --- a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/cs.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "cs", - "texts": { - "ManageYourProfile": "Spravovat profil" - } -} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/en.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/en.json index 46823538..395beda6 100644 --- a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/en.json +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/en.json @@ -1,6 +1,41 @@ { "culture": "en", "texts": { - "ManageYourProfile": "Manage your profile" + "Menu:EasyAbpWeChatManagement": "WeChat", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:WeChatApp": "WeChat app", + "Menu:WeChatApp": "WeChatApp", + "WeChatApp": "WeChatApp", + "WeChatAppType": "WeChatAppType", + "WeChatAppType.MiniProgram": "MiniProgram", + "WeChatAppType.Official": "Official", + "WeChatAppType.Work": "Work", + "WeChatAppType.OpenPlatform": "OpenPlatform", + "WeChatAppWeChatComponentId": "WeChatAppWeChatComponentId", + "WeChatAppWeChatComponentIdPlaceHolder": "WeChatAppWeChatComponentIdPlaceHolder", + "WeChatAppName": "WeChatAppName", + "WeChatAppDisplayName": "WeChatAppDisplayName", + "WeChatAppOpenAppIdOrName": "WeChatAppOpenAppIdOrName", + "WeChatAppAppId": "WeChatAppAppId", + "WeChatAppAppSecret": "WeChatAppAppSecret", + "WeChatAppAppSecretPlaceHolder": "WeChatAppAppSecretPlaceHolder", + "WeChatAppToken": "WeChatAppToken", + "WeChatAppEncodingAesKey": "WeChatAppEncodingAesKey", + "WeChatAppIsStatic": "WeChatAppIsStatic", + "CreateWeChatApp": "CreateWeChatApp", + "EditWeChatApp": "EditWeChatApp", + "WeChatAppDeletionConfirmationMessage": "Are you sure to delete the WeChatApp {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "Permission:WeChatAppUser": "WeChatAppUser", + "Menu:WeChatAppUser": "MenuWeChatAppUser", + "WeChatAppUser": "WeChatAppUser", + "WeChatAppUserWeChatAppId": "WeChatAppUserWeChatAppId", + "WeChatAppUserUserId": "WeChatAppUserUserId", + "WeChatAppUserUnionId": "WeChatAppUserUnionId", + "WeChatAppUserOpenId": "WeChatAppUserOpenId", + "WeChatAppUserSessionKey": "WeChatAppUserSessionKey", + "WeChatAppUserSessionKeyChangedTime": "WeChatAppUserSessionKeyChangedTime" } } \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/pl-PL.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/pl-PL.json deleted file mode 100644 index 3ea7b190..00000000 --- a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/pl-PL.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "pl-PL", - "texts": { - - } -} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/pt-BR.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/pt-BR.json deleted file mode 100644 index 6d746df0..00000000 --- a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/pt-BR.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "pt-BR", - "texts": { - - } -} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/sl.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/sl.json deleted file mode 100644 index 687d4257..00000000 --- a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/sl.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "sl", - "texts": { - "ManageYourProfile": "Upravljajte svojim profilom" - } -} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/tr.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/tr.json deleted file mode 100644 index 2b481933..00000000 --- a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/tr.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "tr", - "texts": { - "ManageYourProfile": "Profil ynetimi" - } -} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/vi.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/vi.json deleted file mode 100644 index d8eb5f3c..00000000 --- a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/vi.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "culture": "vi", - "texts": { - - } -} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/zh-Hans.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/zh-Hans.json index 99586f01..be8647ad 100644 --- a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/zh-Hans.json +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/zh-Hans.json @@ -1,6 +1,41 @@ { "culture": "zh-Hans", "texts": { - "ManageYourProfile": "管理个人资料" + "Menu:EasyAbpWeChatManagement": "微信管理", + "Permission:Create": "新建", + "Permission:Update": "编辑", + "Permission:Delete": "删除", + "Menu:WeChatApp": "微信应用", + "Permission:WeChatApp": "微信应用", + "WeChatApp": "微信应用", + "WeChatAppType": "应用类型", + "WeChatAppType.MiniProgram": "小程序", + "WeChatAppType.Official": "公众号", + "WeChatAppType.Work": "企业微信", + "WeChatAppType.OpenPlatform": "开放平台", + "WeChatAppWeChatComponentId": "微信第三方平台 ID", + "WeChatAppWeChatComponentIdPlaceHolder": "通过微信第三方平台管理则必填", + "WeChatAppName": "内置名称", + "WeChatAppDisplayName": "展示名称", + "WeChatAppOpenAppIdOrName": "开放平台 AppId (或名称)", + "WeChatAppAppId": "AppId", + "WeChatAppAppSecret": "AppSecret", + "WeChatAppAppSecretPlaceHolder": "留空则通过第三方平台管理", + "WeChatAppToken": "Token", + "WeChatAppEncodingAesKey": "EncodingAesKey", + "WeChatAppIsStatic": "是否静态", + "CreateWeChatApp": "新建", + "EditWeChatApp": "编辑", + "WeChatAppDeletionConfirmationMessage": "确认删除微信应用 {0}?", + "SuccessfullyDeleted": "删除成功", + "Permission:WeChatAppUser": "用户机密", + "Menu:WeChatAppUser": "用户机密", + "WeChatAppUser": "用户机密", + "WeChatAppUserWeChatAppId": "微信应用 ID", + "WeChatAppUserUserId": "用户 ID", + "WeChatAppUserUnionId": "UnionId", + "WeChatAppUserOpenId": "OpenId", + "WeChatAppUserSessionKey": "SessionKey", + "WeChatAppUserSessionKeyChangedTime": "SessionKey 更新时间" } } \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/zh-Hant.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/zh-Hant.json index ceea0555..d9b33085 100644 --- a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/zh-Hant.json +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/Localization/zh-Hant.json @@ -1,6 +1,41 @@ { "culture": "zh-Hant", "texts": { - "ManageYourProfile": "管理個人資料" + "Menu:EasyAbpWeChatManagement": "微信管理", + "Permission:Create": "新建", + "Permission:Update": "編輯", + "Permission:Delete": "刪除", + "Permission:WeChatApp": "微信應用", + "Menu:WeChatApp": "微信應用", + "WeChatApp": "微信應用", + "WeChatAppType": "應用類型", + "WeChatAppType.MiniProgram": "小程序", + "WeChatAppType.Official": "公眾號", + "WeChatAppType.Work": "企業微信", + "WeChatAppType.OpenPlatform": "開放平台", + "WeChatAppWeChatComponentId": "微信第三方平台 ID", + "WeChatAppWeChatComponentIdPlaceHolder": "通過微信第三方平台管理則必填", + "WeChatAppName": "內置名稱", + "WeChatAppDisplayName": "展示名稱", + "WeChatAppOpenAppIdOrName": "開放平台 AppId (或名稱)", + "WeChatAppAppId": "AppId", + "WeChatAppAppSecret": "AppSecret", + "WeChatAppAppSecretPlaceHolder": "留空則通過第三方平台管理", + "WeChatAppToken": "Token", + "WeChatAppEncodingAesKey": "EncodingAesKey", + "WeChatAppIsStatic": "是否靜態", + "CreateWeChatApp": "新建", + "EditWeChatApp": "編輯", + "WeChatAppDeletionConfirmationMessage": "確認刪除微信應用 {0}?", + "SuccessfullyDeleted": "刪除成功", + "Permission:WeChatAppUser": "用戶機密", + "Menu:WeChatAppUser": "用戶機密", + "WeChatAppUser": "用戶機密", + "WeChatAppUserWeChatAppId": "微信應用 ID", + "WeChatAppUserUserId": "用戶 ID", + "WeChatAppUserUnionId": "UnionId", + "WeChatAppUserOpenId": "OpenId", + "WeChatAppUserSessionKey": "SessionKey", + "WeChatAppUserSessionKeyChangedTime": "SessionKey 更新時間" } } \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppType.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppType.cs new file mode 100644 index 00000000..0b70010c --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain.Shared/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppType.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.WeChatManagement.Common.WeChatApps +{ + public enum WeChatAppType + { + MiniProgram = 0, + Official = 1, + Work = 2, + OpenPlatform = 3 + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp.WeChatManagement.Common.Domain.csproj b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp.WeChatManagement.Common.Domain.csproj new file mode 100644 index 00000000..f18d2997 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp.WeChatManagement.Common.Domain.csproj @@ -0,0 +1,15 @@ + + + + + + netstandard2.0 + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/CommonDbProperties.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/CommonDbProperties.cs new file mode 100644 index 00000000..80f31b49 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/CommonDbProperties.cs @@ -0,0 +1,11 @@ +namespace EasyAbp.WeChatManagement.Common +{ + public static class CommonDbProperties + { + public static string DbTablePrefix { get; set; } = "EasyAbpWeChatManagementCommon"; + + public static string DbSchema { get; set; } = null; + + public const string ConnectionStringName = "EasyAbpWeChatManagementCommon"; + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/Settings/CommonSettingDefinitionProvider.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/Settings/CommonSettingDefinitionProvider.cs new file mode 100644 index 00000000..31accf32 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/Settings/CommonSettingDefinitionProvider.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Settings; + +namespace EasyAbp.WeChatManagement.Common.Settings +{ + public class CommonSettingDefinitionProvider : SettingDefinitionProvider + { + public override void Define(ISettingDefinitionContext context) + { + /* Define module settings here. + * Use names from CommonSettings class. + */ + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/Settings/CommonSettings.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/Settings/CommonSettings.cs new file mode 100644 index 00000000..e4bf7d03 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/Settings/CommonSettings.cs @@ -0,0 +1,11 @@ +namespace EasyAbp.WeChatManagement.Common.Settings +{ + public static class CommonSettings + { + public const string GroupName = "EasyAbp.WeChatManagement.Common"; + + /* Add constants for setting names. Example: + * public const string MySettingName = GroupName + ".MySettingName"; + */ + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/IWeChatAppUserRepository.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/IWeChatAppUserRepository.cs new file mode 100644 index 00000000..292e39f8 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/IWeChatAppUserRepository.cs @@ -0,0 +1,19 @@ +using System; +using System.Linq.Expressions; +using System.Threading; +using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.WeChatApps; +using JetBrains.Annotations; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers +{ + public interface IWeChatAppUserRepository : IRepository + { + Task FindUnionIdByOpenIdAsync(Guid weChatAppId, string openId, CancellationToken cancellationToken = default); + + Task FindRecentlyTenantIdAsync(string appId, string openId, bool exceptHost, CancellationToken cancellationToken = default); + + Task AnyInWeChatAppTypeAsync(WeChatAppType type, [NotNull] Expression> predicate); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/IWeChatAppUserStore.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/IWeChatAppUserStore.cs new file mode 100644 index 00000000..3d9eda4e --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/IWeChatAppUserStore.cs @@ -0,0 +1,7 @@ +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers +{ + public interface IWeChatAppUserStore + { + + } +} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser.cs similarity index 79% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser.cs rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser.cs index 28146277..ce7984e5 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser.cs +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser.cs @@ -4,13 +4,13 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.Timing; -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers { - public class MiniProgramUser : FullAuditedAggregateRoot, IMultiTenant + public class WeChatAppUser : FullAuditedAggregateRoot, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual Guid MiniProgramId { get; protected set; } + public virtual Guid WeChatAppId { get; protected set; } public virtual Guid UserId { get; protected set; } @@ -25,19 +25,19 @@ public class MiniProgramUser : FullAuditedAggregateRoot, IMultiTenant public virtual DateTime? SessionKeyChangedTime { get; protected set; } - protected MiniProgramUser() + protected WeChatAppUser() { } - public MiniProgramUser(Guid id, + public WeChatAppUser(Guid id, Guid? tenantId, - Guid miniProgramId, + Guid weChatAppId, Guid userId, [CanBeNull] string unionId, [NotNull] string openId) : base(id) { TenantId = tenantId; - MiniProgramId = miniProgramId; + WeChatAppId = weChatAppId; UserId = userId; UnionId = unionId; OpenId = openId; diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserCacheItemInvalidator.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserCacheItemInvalidator.cs similarity index 69% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserCacheItemInvalidator.cs rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserCacheItemInvalidator.cs index d14d6e65..445a9ddb 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserCacheItemInvalidator.cs +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserCacheItemInvalidator.cs @@ -3,11 +3,11 @@ using Volo.Abp.Domain.Entities.Events; using Volo.Abp.EventBus; -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers { - public class MiniProgramUserCacheItemInvalidator : ILocalEventHandler>, ITransientDependency + public class WeChatAppUserCacheItemInvalidator : ILocalEventHandler>, ITransientDependency { - public virtual Task HandleEventAsync(EntityChangedEventData eventData) + public virtual Task HandleEventAsync(EntityChangedEventData eventData) { // Todo: remove cache, refer to: https://github.com/abpframework/abp/blob/1a622bc50fbd9b554f61078d5eeafa9def3216e3/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionGrantCacheItemInvalidator.cs return Task.CompletedTask; diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatApps/IWeChatAppRepository.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatApps/IWeChatAppRepository.cs new file mode 100644 index 00000000..c9f49db9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatApps/IWeChatAppRepository.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.WeChatManagement.Common.WeChatApps +{ + public interface IWeChatAppRepository : IRepository + { + } +} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatApp.cs similarity index 85% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram.cs rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatApp.cs index 81a148c1..912749e2 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram.cs +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatApp.cs @@ -3,12 +3,14 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms +namespace EasyAbp.WeChatManagement.Common.WeChatApps { - public class MiniProgram : FullAuditedAggregateRoot, IMultiTenant + public class WeChatApp : FullAuditedAggregateRoot, IMultiTenant { public virtual Guid? TenantId { get; protected set; } + public virtual WeChatAppType Type { get; protected set; } + public virtual Guid? WeChatComponentId { get; protected set; } [NotNull] @@ -37,13 +39,14 @@ public class MiniProgram : FullAuditedAggregateRoot, IMultiTenant public virtual bool IsStatic { get; protected set; } - protected MiniProgram() + protected WeChatApp() { } - public MiniProgram( + public WeChatApp( Guid id, Guid? tenantId, + WeChatAppType type, Guid? weChatComponentId, [NotNull] string name, [NotNull] string displayName, @@ -55,6 +58,7 @@ protected MiniProgram() bool isStatic) : base(id) { TenantId = tenantId; + Type = type; WeChatComponentId = weChatComponentId; Name = name; DisplayName = displayName; diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatManagementCommonDomainModule.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatManagementCommonDomainModule.cs new file mode 100644 index 00000000..12a1076f --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/EasyAbp/WeChatManagement/Common/WeChatManagementCommonDomainModule.cs @@ -0,0 +1,22 @@ +using EasyAbp.WeChatManagement.Common.WeChatApps; +using Volo.Abp.Domain; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.Modularity; + +namespace EasyAbp.WeChatManagement.Common +{ + [DependsOn( + typeof(AbpDddDomainModule), + typeof(WeChatManagementCommonDomainSharedModule) + )] + public class WeChatManagementCommonDomainModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AutoEventSelectors.Add(); + }); + } + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/FodyWeavers.xml b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/FodyWeavers.xsd b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Domain/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.csproj b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.csproj new file mode 100644 index 00000000..2e2f21c0 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.csproj @@ -0,0 +1,19 @@ + + + + + + netstandard2.1 + + + + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/CommonDbContext.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/CommonDbContext.cs new file mode 100644 index 00000000..fd6aa092 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/CommonDbContext.cs @@ -0,0 +1,32 @@ +using EasyAbp.WeChatManagement.Common.WeChatApps; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.WeChatManagement.Common.EntityFrameworkCore +{ + [ConnectionStringName(CommonDbProperties.ConnectionStringName)] + public class CommonDbContext : AbpDbContext, ICommonDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * public DbSet Questions { get; set; } + */ + + public DbSet WeChatApps { get; set; } + public DbSet WeChatAppUsers { get; set; } + + public CommonDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureWeChatManagementCommon(); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/CommonDbContextModelCreatingExtensions.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/CommonDbContextModelCreatingExtensions.cs new file mode 100644 index 00000000..3e9eb166 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/CommonDbContextModelCreatingExtensions.cs @@ -0,0 +1,63 @@ +using System; +using EasyAbp.WeChatManagement.Common.WeChatApps; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace EasyAbp.WeChatManagement.Common.EntityFrameworkCore +{ + public static class CommonDbContextModelCreatingExtensions + { + public static void ConfigureWeChatManagementCommon( + this ModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new CommonModelBuilderConfigurationOptions( + CommonDbProperties.DbTablePrefix, + CommonDbProperties.DbSchema + ); + + optionsAction?.Invoke(options); + + /* Configure all entities here. Example: + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "Questions", options.Schema); + + b.ConfigureByConvention(); + + //Properties + b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); + + //Relations + b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); + + //Indexes + b.HasIndex(q => q.CreationTime); + }); + */ + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "WeChatApps", options.Schema); + b.ConfigureByConvention(); + + /* Configure more properties here */ + }); + + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "WeChatAppUsers", options.Schema); + b.ConfigureByConvention(); + + /* Configure more properties here */ + }); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/CommonModelBuilderConfigurationOptions.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/CommonModelBuilderConfigurationOptions.cs new file mode 100644 index 00000000..ea6e38b1 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/CommonModelBuilderConfigurationOptions.cs @@ -0,0 +1,18 @@ +using JetBrains.Annotations; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace EasyAbp.WeChatManagement.Common.EntityFrameworkCore +{ + public class CommonModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + { + public CommonModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = "", + [CanBeNull] string schema = null) + : base( + tablePrefix, + schema) + { + + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/ICommonDbContext.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/ICommonDbContext.cs new file mode 100644 index 00000000..1239204b --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/ICommonDbContext.cs @@ -0,0 +1,18 @@ +using EasyAbp.WeChatManagement.Common.WeChatApps; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.WeChatManagement.Common.EntityFrameworkCore +{ + [ConnectionStringName(CommonDbProperties.ConnectionStringName)] + public interface ICommonDbContext : IEfCoreDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * DbSet Questions { get; } + */ + DbSet WeChatApps { get; set; } + DbSet WeChatAppUsers { get; set; } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/WeChatManagementCommonEntityFrameworkCoreModule.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/WeChatManagementCommonEntityFrameworkCoreModule.cs new file mode 100644 index 00000000..27187a5b --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/EntityFrameworkCore/WeChatManagementCommonEntityFrameworkCoreModule.cs @@ -0,0 +1,27 @@ +using EasyAbp.WeChatManagement.Common.WeChatApps; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.WeChatManagement.Common.EntityFrameworkCore +{ + [DependsOn( + typeof(WeChatManagementCommonDomainModule), + typeof(AbpEntityFrameworkCoreModule) + )] + public class WeChatManagementCommonEntityFrameworkCoreModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + options.AddRepository(); + options.AddRepository(); + }); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserRepository.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserRepository.cs new file mode 100644 index 00000000..14498844 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserRepository.cs @@ -0,0 +1,50 @@ +using System; +using System.Linq; +using System.Linq.Expressions; +using System.Threading; +using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.EntityFrameworkCore; +using EasyAbp.WeChatManagement.Common.WeChatApps; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers +{ + public class WeChatAppUserRepository : EfCoreRepository, IWeChatAppUserRepository + { + public WeChatAppUserRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public virtual async Task FindUnionIdByOpenIdAsync(Guid weChatAppId, string openId, CancellationToken cancellationToken = default) + { + return await (await GetQueryableAsync()).Where(x => x.OpenId == openId && x.WeChatAppId == weChatAppId) + .Select(x => x.UnionId).FirstOrDefaultAsync(cancellationToken: cancellationToken); + } + + public virtual async Task FindRecentlyTenantIdAsync(string appId, string openId, bool exceptHost, CancellationToken cancellationToken = default) + { + return await (await GetQueryableAsync()) + .Join((await GetDbContextAsync()).WeChatApps, mpUser => mpUser.WeChatAppId, weChatApp => weChatApp.Id, + (mpUser, weChatApp) => new {MpUser = mpUser, WeChatApp = weChatApp}) + .Where(x => x.MpUser.OpenId == openId) + .Where(x => x.WeChatApp.AppId == appId) + .WhereIf(exceptHost, x => x.WeChatApp.TenantId.HasValue) + .OrderBy(x => x.MpUser.LastModificationTime == null) + .ThenByDescending(x => x.MpUser.LastModificationTime) + .Select(x => x.MpUser.TenantId) + .FirstOrDefaultAsync(cancellationToken); + } + + public virtual async Task AnyInWeChatAppTypeAsync(WeChatAppType type, Expression> predicate) + { + return await (await GetQueryableAsync()) + .Where(predicate) + .Join((await GetDbContextAsync()).WeChatApps, mpUser => mpUser.WeChatAppId, weChatApp => weChatApp.Id, + (mpUser, weChatApp) => new {MpUser = mpUser, WeChatApp = weChatApp}) + .Where(x => x.WeChatApp.Type == type) + .AnyAsync(); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/WeChatApps/DuplicateWeChatAppException.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/WeChatApps/DuplicateWeChatAppException.cs new file mode 100644 index 00000000..a2c4da04 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/WeChatApps/DuplicateWeChatAppException.cs @@ -0,0 +1,12 @@ +using Volo.Abp; + +namespace EasyAbp.WeChatManagement.Common.WeChatApps +{ + public class DuplicateWeChatAppException : BusinessException + { + public DuplicateWeChatAppException() : base("DuplicateWeChatApp", "重复的微信应用") + { + + } + } +} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgramRepository.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppRepository.cs similarity index 59% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgramRepository.cs rename to modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppRepository.cs index 86881d93..b7466ddf 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgramRepository.cs +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppRepository.cs @@ -3,20 +3,20 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore; +using EasyAbp.WeChatManagement.Common.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms +namespace EasyAbp.WeChatManagement.Common.WeChatApps { - public class MiniProgramRepository : EfCoreRepository, IMiniProgramRepository + public class WeChatAppRepository : EfCoreRepository, IWeChatAppRepository { - public MiniProgramRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + public WeChatAppRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } - public override async Task InsertAsync(MiniProgram entity, bool autoSave = false, + public override async Task InsertAsync(WeChatApp entity, bool autoSave = false, CancellationToken cancellationToken = new CancellationToken()) { await CheckDuplicateAsync(entity, cancellationToken); @@ -24,7 +24,7 @@ public MiniProgramRepository(IDbContextProvider dbContex return await base.InsertAsync(entity, autoSave, cancellationToken); } - public override async Task UpdateAsync(MiniProgram entity, bool autoSave = false, + public override async Task UpdateAsync(WeChatApp entity, bool autoSave = false, CancellationToken cancellationToken = new CancellationToken()) { await CheckDuplicateAsync(entity, cancellationToken); @@ -32,46 +32,46 @@ public MiniProgramRepository(IDbContextProvider dbContex return await base.UpdateAsync(entity, autoSave, cancellationToken); } - public override async Task InsertManyAsync(IEnumerable entities, bool autoSave = false, + public override async Task InsertManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = new CancellationToken()) { - var miniPrograms = entities.ToArray(); + var weChatApps = entities.ToArray(); - await CheckDuplicateAsync(miniPrograms, cancellationToken); + await CheckDuplicateAsync(weChatApps, cancellationToken); - await base.InsertManyAsync(miniPrograms, autoSave, cancellationToken); + await base.InsertManyAsync(weChatApps, autoSave, cancellationToken); } - public override async Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, + public override async Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = new CancellationToken()) { - var miniPrograms = entities.ToArray(); + var weChatApps = entities.ToArray(); - await CheckDuplicateAsync(miniPrograms, cancellationToken); + await CheckDuplicateAsync(weChatApps, cancellationToken); - await base.UpdateManyAsync(miniPrograms, autoSave, cancellationToken); + await base.UpdateManyAsync(weChatApps, autoSave, cancellationToken); } - protected virtual async Task CheckDuplicateAsync(MiniProgram entity, CancellationToken cancellationToken) + protected virtual async Task CheckDuplicateAsync(WeChatApp entity, CancellationToken cancellationToken) { if (await (await GetDbSetAsync()).AnyAsync( x => (x.AppId == entity.AppId || x.Name == entity.Name) && x.Id != entity.Id, cancellationToken: cancellationToken)) { - throw new DuplicateMiniProgramException(); + throw new DuplicateWeChatAppException(); } } - protected virtual async Task CheckDuplicateAsync(MiniProgram[] entities, CancellationToken cancellationToken) + protected virtual async Task CheckDuplicateAsync(WeChatApp[] entities, CancellationToken cancellationToken) { if (entities.Select(x => x.AppId).Distinct().Count() != entities.Length) { - throw new DuplicateMiniProgramException(); + throw new DuplicateWeChatAppException(); } if (entities.Select(x => x.Name).Distinct().Count() != entities.Length) { - throw new DuplicateMiniProgramException(); + throw new DuplicateWeChatAppException(); } foreach (var entity in entities) @@ -84,7 +84,7 @@ protected virtual async Task CheckDuplicateAsync(MiniProgram[] entities, Cancell if (foundEntity == null || foundEntity.AppId == entity.AppId) { - throw new DuplicateMiniProgramException(); + throw new DuplicateWeChatAppException(); } } @@ -98,7 +98,7 @@ protected virtual async Task CheckDuplicateAsync(MiniProgram[] entities, Cancell if (foundEntity == null || foundEntity.Name == entity.Name) { - throw new DuplicateMiniProgramException(); + throw new DuplicateWeChatAppException(); } } } diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/FodyWeavers.xml b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/FodyWeavers.xsd b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.EntityFrameworkCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/EasyAbp.WeChatManagement.Common.HttpApi.Client.csproj b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/EasyAbp.WeChatManagement.Common.HttpApi.Client.csproj new file mode 100644 index 00000000..37f934a2 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/EasyAbp.WeChatManagement.Common.HttpApi.Client.csproj @@ -0,0 +1,15 @@ + + + + + + netstandard2.0 + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/EasyAbp/WeChatManagement/Common/WeChatManagementCommonHttpApiClientModule.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/EasyAbp/WeChatManagement/Common/WeChatManagementCommonHttpApiClientModule.cs new file mode 100644 index 00000000..c8b311c8 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/EasyAbp/WeChatManagement/Common/WeChatManagementCommonHttpApiClientModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Modularity; + +namespace EasyAbp.WeChatManagement.Common +{ + [DependsOn( + typeof(WeChatManagementCommonApplicationContractsModule), + typeof(AbpHttpClientModule))] + public class WeChatManagementCommonHttpApiClientModule : AbpModule + { + public const string RemoteServiceName = "EasyAbpWeChatManagementCommon"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(WeChatManagementCommonApplicationContractsModule).Assembly, + RemoteServiceName + ); + } + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/FodyWeavers.xml b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/FodyWeavers.xsd b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi.Client/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp.WeChatManagement.Common.HttpApi.csproj b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp.WeChatManagement.Common.HttpApi.csproj new file mode 100644 index 00000000..f854f5ad --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp.WeChatManagement.Common.HttpApi.csproj @@ -0,0 +1,15 @@ + + + + + + net5.0 + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/CommonController.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/CommonController.cs new file mode 100644 index 00000000..d346dd49 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/CommonController.cs @@ -0,0 +1,13 @@ +using EasyAbp.WeChatManagement.Common.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace EasyAbp.WeChatManagement.Common +{ + public abstract class CommonController : AbpController + { + protected CommonController() + { + LocalizationResource = typeof(CommonResource); + } + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserController.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserController.cs new file mode 100644 index 00000000..063b580a --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/WeChatAppUsers/WeChatAppUserController.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers.Dtos; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers +{ + [RemoteService(Name = "EasyAbpWeChatManagementCommon")] + [Route("/api/wechat-management/common/wechat-app-user")] + public class WeChatAppUserController : CommonController, IWeChatAppUserAppService + { + private readonly IWeChatAppUserAppService _service; + + public WeChatAppUserController(IWeChatAppUserAppService service) + { + _service = service; + } + + [HttpGet] + [Route("{id}")] + public Task GetAsync(Guid id) + { + return _service.GetAsync(id); + } + + [HttpGet] + public Task> GetListAsync(PagedAndSortedResultRequestDto input) + { + return _service.GetListAsync(input); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppController.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppController.cs new file mode 100644 index 00000000..2719cb56 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppController.cs @@ -0,0 +1,54 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.WeChatApps.Dtos; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.WeChatManagement.Common.WeChatApps +{ + [RemoteService(Name = "EasyAbpWeChatManagementCommon")] + [Route("/api/wechat-management/common/wechat-app")] + public class WeChatAppController : CommonController, IWeChatAppAppService + { + private readonly IWeChatAppAppService _appService; + + public WeChatAppController(IWeChatAppAppService appService) + { + _appService = appService; + } + + [HttpGet] + [Route("{id}")] + public Task GetAsync(Guid id) + { + return _appService.GetAsync(id); + } + + [HttpGet] + public Task> GetListAsync(PagedAndSortedResultRequestDto input) + { + return _appService.GetListAsync(input); + } + + [HttpPost] + public Task CreateAsync(CreateUpdateWeChatAppDto input) + { + return _appService.CreateAsync(input); + } + + [HttpPut] + [Route("{id}")] + public Task UpdateAsync(Guid id, CreateUpdateWeChatAppDto input) + { + return _appService.UpdateAsync(id, input); + } + + [HttpDelete] + [Route("{id}")] + public Task DeleteAsync(Guid id) + { + return _appService.DeleteAsync(id); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/WeChatManagementCommonHttpApiModule.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/WeChatManagementCommonHttpApiModule.cs new file mode 100644 index 00000000..3566737f --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/EasyAbp/WeChatManagement/Common/WeChatManagementCommonHttpApiModule.cs @@ -0,0 +1,33 @@ +using Localization.Resources.AbpUi; +using EasyAbp.WeChatManagement.Common.Localization; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Microsoft.Extensions.DependencyInjection; + +namespace EasyAbp.WeChatManagement.Common +{ + [DependsOn( + typeof(WeChatManagementCommonApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] + public class WeChatManagementCommonHttpApiModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(WeChatManagementCommonHttpApiModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + } + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/FodyWeavers.xml b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/FodyWeavers.xsd b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.HttpApi/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp.WeChatManagement.Common.MongoDB.csproj b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp.WeChatManagement.Common.MongoDB.csproj new file mode 100644 index 00000000..b55a6768 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp.WeChatManagement.Common.MongoDB.csproj @@ -0,0 +1,19 @@ + + + + + + netstandard2.0 + + + + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/CommonMongoDbContext.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/CommonMongoDbContext.cs new file mode 100644 index 00000000..f91b61e4 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/CommonMongoDbContext.cs @@ -0,0 +1,20 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.WeChatManagement.Common.MongoDB +{ + [ConnectionStringName(CommonDbProperties.ConnectionStringName)] + public class CommonMongoDbContext : AbpMongoDbContext, ICommonMongoDbContext + { + /* Add mongo collections here. Example: + * public IMongoCollection Questions => Collection(); + */ + + protected override void CreateModel(IMongoModelBuilder modelBuilder) + { + base.CreateModel(modelBuilder); + + modelBuilder.ConfigureCommon(); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/CommonMongoDbContextExtensions.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/CommonMongoDbContextExtensions.cs new file mode 100644 index 00000000..7d8b82fd --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/CommonMongoDbContextExtensions.cs @@ -0,0 +1,22 @@ +using System; +using Volo.Abp; +using Volo.Abp.MongoDB; + +namespace EasyAbp.WeChatManagement.Common.MongoDB +{ + public static class CommonMongoDbContextExtensions + { + public static void ConfigureCommon( + this IMongoModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new CommonMongoModelBuilderConfigurationOptions( + CommonDbProperties.DbTablePrefix + ); + + optionsAction?.Invoke(options); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/CommonMongoModelBuilderConfigurationOptions.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/CommonMongoModelBuilderConfigurationOptions.cs new file mode 100644 index 00000000..16be69f8 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/CommonMongoModelBuilderConfigurationOptions.cs @@ -0,0 +1,14 @@ +using JetBrains.Annotations; +using Volo.Abp.MongoDB; + +namespace EasyAbp.WeChatManagement.Common.MongoDB +{ + public class CommonMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions + { + public CommonMongoModelBuilderConfigurationOptions( + [NotNull] string collectionPrefix = "") + : base(collectionPrefix) + { + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/ICommonMongoDbContext.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/ICommonMongoDbContext.cs new file mode 100644 index 00000000..fec47ace --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/ICommonMongoDbContext.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.WeChatManagement.Common.MongoDB +{ + [ConnectionStringName(CommonDbProperties.ConnectionStringName)] + public interface ICommonMongoDbContext : IAbpMongoDbContext + { + /* Define mongo collections here. Example: + * IMongoCollection Questions { get; } + */ + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/WeChatManagementCommonMongoDbModule.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/WeChatManagementCommonMongoDbModule.cs new file mode 100644 index 00000000..d3db0eca --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/EasyAbp/WeChatManagement/Common/MongoDB/WeChatManagementCommonMongoDbModule.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.MongoDB; + +namespace EasyAbp.WeChatManagement.Common.MongoDB +{ + [DependsOn( + typeof(WeChatManagementCommonDomainModule), + typeof(AbpMongoDbModule) + )] + public class WeChatManagementCommonMongoDbModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddMongoDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/FodyWeavers.xml b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/FodyWeavers.xsd b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.MongoDB/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/CommonWebAutoMapperProfile.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/CommonWebAutoMapperProfile.cs new file mode 100644 index 00000000..e0617ef5 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/CommonWebAutoMapperProfile.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp.ViewModels; +using EasyAbp.WeChatManagement.Common.WeChatApps.Dtos; + +namespace EasyAbp.WeChatManagement.Common.Web +{ + public class CommonWebAutoMapperProfile : Profile + { + public CommonWebAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + CreateMap(); + CreateMap(); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/EasyAbp.WeChatManagement.Common.Web.csproj b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/EasyAbp.WeChatManagement.Common.Web.csproj new file mode 100644 index 00000000..ee6aed19 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/EasyAbp.WeChatManagement.Common.Web.csproj @@ -0,0 +1,46 @@ + + + + + + net5.0 + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + Library + EasyAbp.WeChatManagement.Common.Web + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/FodyWeavers.xml b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/FodyWeavers.xsd b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Menus/CommonMenuContributor.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Menus/CommonMenuContributor.cs new file mode 100644 index 00000000..76998a9d --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Menus/CommonMenuContributor.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.Localization; +using EasyAbp.WeChatManagement.Common.Permissions; +using Volo.Abp.UI.Navigation; + +namespace EasyAbp.WeChatManagement.Common.Web.Menus +{ + public class CommonMenuContributor : IMenuContributor + { + public async Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name == StandardMenus.Main) + { + await ConfigureMainMenuAsync(context); + } + } + + private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) + { + var l = context.GetLocalizer(); //Add main menu items. + + var weChatManagementMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == CommonMenus.Prefix, + () => new ApplicationMenuItem(CommonMenus.Prefix, l["Menu:EasyAbpWeChatManagement"])); + + if (await context.IsGrantedAsync(CommonPermissions.WeChatApp.Default)) + { + weChatManagementMenuItem.AddItem( + new ApplicationMenuItem(CommonMenus.WeChatApp, l["Menu:WeChatApp"], "/WeChatManagement/Common/WeChatApps/WeChatApp") + ); + } + if (await context.IsGrantedAsync(CommonPermissions.WeChatAppUser.Default)) + { + weChatManagementMenuItem.AddItem( + new ApplicationMenuItem(CommonMenus.WeChatAppUser, l["Menu:WeChatAppUser"], "/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser") + ); + } + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Menus/CommonMenus.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Menus/CommonMenus.cs new file mode 100644 index 00000000..6635c39d --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Menus/CommonMenus.cs @@ -0,0 +1,14 @@ +namespace EasyAbp.WeChatManagement.Common.Web.Menus +{ + public class CommonMenus + { + public const string Prefix = "EasyAbp.WeChatManagement"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + public const string WeChatApp = Prefix + ".WeChatApp"; + + public const string WeChatAppUser = Prefix + ".WeChatAppUser"; + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/CommonPageModel.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/CommonPageModel.cs new file mode 100644 index 00000000..236d5616 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/CommonPageModel.cs @@ -0,0 +1,16 @@ +using EasyAbp.WeChatManagement.Common.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace EasyAbp.WeChatManagement.Common.Web.Pages +{ + /* Inherit your PageModel classes from this class. + */ + public abstract class CommonPageModel : AbpPageModel + { + protected CommonPageModel() + { + LocalizationResourceType = typeof(CommonResource); + ObjectMapperContext = typeof(WeChatManagementCommonWebModule); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/Index.cshtml b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/Index.cshtml new file mode 100644 index 00000000..69a6554a --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/Index.cshtml @@ -0,0 +1,51 @@ +@page +@using EasyAbp.WeChatManagement.Common.Permissions +@using EasyAbp.WeChatManagement.Common.Localization +@using EasyAbp.WeChatManagement.Common.Web.Menus +@using EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatAppUsers.WeChatAppUser +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model IndexModel +@inject IPageLayout PageLayout +@inject IHtmlLocalizer L +@inject IAuthorizationService Authorization +@{ + PageLayout.Content.Title = L["WeChatAppUser"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:WeChatAppUser"].Value); + PageLayout.Content.MenuItemName = CommonMenus.WeChatAppUser; +} + +@section scripts +{ + +} +@section styles +{ + +} + + + + + + @L["WeChatAppUser"] + + + + + + + + @L["Actions"] + @L["WeChatAppUserWeChatAppId"] + @L["WeChatAppUserUserId"] + @L["WeChatAppUserUnionId"] + @L["WeChatAppUserOpenId"] + @L["WeChatAppUserSessionKey"] + @L["WeChatAppUserSessionKeyChangedTime"] + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/Index.cshtml.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/Index.cshtml.cs new file mode 100644 index 00000000..e76142d8 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/Index.cshtml.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; + +namespace EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatAppUsers.WeChatAppUser +{ + public class IndexModel : CommonPageModel + { + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } + } +} diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/index.css b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/index.css similarity index 100% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/index.css rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/index.css diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/index.js b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/index.js similarity index 78% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/index.js rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/index.js index 2bbb9ede..933992d7 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/index.js +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatAppUsers/WeChatAppUser/index.js @@ -1,10 +1,10 @@ $(function () { - var l = abp.localization.getResource('EasyAbpWeChatManagementMiniPrograms'); + var l = abp.localization.getResource('EasyAbpWeChatManagementCommon'); - var service = easyAbp.weChatManagement.miniPrograms.miniProgramUsers.miniProgramUser; + var service = easyAbp.weChatManagement.common.weChatAppUsers.weChatAppUser; - var dataTable = $('#MiniProgramUserTable').DataTable(abp.libs.datatables.normalizeConfiguration({ + var dataTable = $('#WeChatAppUserTable').DataTable(abp.libs.datatables.normalizeConfiguration({ processing: true, serverSide: true, paging: true, @@ -26,7 +26,7 @@ $(function () { ] } }, - { data: "miniProgramId" }, + { data: "weChatAppId" }, { data: "userId" }, { data: "unionId" }, { data: "openId" }, diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/CreateModal.cshtml b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/CreateModal.cshtml similarity index 56% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/CreateModal.cshtml rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/CreateModal.cshtml index 8823cf65..1c944863 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/CreateModal.cshtml +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/CreateModal.cshtml @@ -1,15 +1,15 @@ @page -@using EasyAbp.WeChatManagement.MiniPrograms.Localization +@using EasyAbp.WeChatManagement.Common.Localization @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal -@inject IHtmlLocalizer L -@model EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram.CreateModalModel +@inject IHtmlLocalizer L +@model EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp.CreateModalModel @{ Layout = null; } - + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/CreateModal.cshtml.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/CreateModal.cshtml.cs new file mode 100644 index 00000000..08a3275e --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/CreateModal.cshtml.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp.ViewModels; +using EasyAbp.WeChatManagement.Common.WeChatApps; +using EasyAbp.WeChatManagement.Common.WeChatApps.Dtos; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp +{ + public class CreateModalModel : CommonPageModel + { + [BindProperty] + public CreateEditWeChatAppViewModel ViewModel { get; set; } = new CreateEditWeChatAppViewModel(); + + private readonly IWeChatAppAppService _appService; + + public CreateModalModel(IWeChatAppAppService appService) + { + _appService = appService; + } + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _appService.CreateAsync(dto); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/EditModal.cshtml b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/EditModal.cshtml similarity index 58% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/EditModal.cshtml rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/EditModal.cshtml index 1bfd57d0..f9978bf7 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/EditModal.cshtml +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/EditModal.cshtml @@ -1,15 +1,15 @@ @page -@using EasyAbp.WeChatManagement.MiniPrograms.Localization +@using EasyAbp.WeChatManagement.Common.Localization @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal -@inject IHtmlLocalizer L -@model EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram.EditModalModel +@inject IHtmlLocalizer L +@model EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp.EditModalModel @{ Layout = null; } - + diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/EditModal.cshtml.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/EditModal.cshtml.cs new file mode 100644 index 00000000..7138dfd3 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/EditModal.cshtml.cs @@ -0,0 +1,39 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp.ViewModels; +using EasyAbp.WeChatManagement.Common.WeChatApps; +using EasyAbp.WeChatManagement.Common.WeChatApps.Dtos; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp +{ + public class EditModalModel : CommonPageModel + { + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public CreateEditWeChatAppViewModel ViewModel { get; set; } + + private readonly IWeChatAppAppService _appService; + + public EditModalModel(IWeChatAppAppService appService) + { + _appService = appService; + } + + public virtual async Task OnGetAsync() + { + var dto = await _appService.GetAsync(Id); + ViewModel = ObjectMapper.Map(dto); + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _appService.UpdateAsync(Id, dto); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/Index.cshtml b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/Index.cshtml new file mode 100644 index 00000000..2f2cb5da --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/Index.cshtml @@ -0,0 +1,64 @@ +@page +@using EasyAbp.WeChatManagement.Common.Permissions +@using EasyAbp.WeChatManagement.Common.Localization +@using EasyAbp.WeChatManagement.Common.Web.Menus +@using EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model IndexModel +@inject IPageLayout PageLayout +@inject IHtmlLocalizer L +@inject IAuthorizationService Authorization +@{ + PageLayout.Content.Title = L["WeChatApp"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:WeChatApp"].Value); + PageLayout.Content.MenuItemName = CommonMenus.WeChatApp; +} + +@section scripts +{ + +} +@section styles +{ + +} + + + + + + @L["WeChatApp"] + + + @if (await Authorization.IsGrantedAsync(CommonPermissions.WeChatApp.Create)) + { + + } + + + + + + + + @L["Actions"] + @L["WeChatAppType"] + @L["WeChatAppWeChatComponentId"] + @L["WeChatAppName"] + @L["WeChatAppDisplayName"] + @L["WeChatAppOpenAppIdOrName"] + @L["WeChatAppAppId"] + @L["WeChatAppAppSecret"] + @L["WeChatAppToken"] + @L["WeChatAppEncodingAesKey"] + @L["WeChatAppIsStatic"] + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/Index.cshtml.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/Index.cshtml.cs new file mode 100644 index 00000000..6d1afb7e --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/Index.cshtml.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; + +namespace EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp +{ + public class IndexModel : CommonPageModel + { + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } + } +} diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/ViewModels/CreateEditMiniProgramViewModel.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/ViewModels/CreateEditMiniProgramViewModel.cs new file mode 100644 index 00000000..0dd51a32 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/ViewModels/CreateEditMiniProgramViewModel.cs @@ -0,0 +1,43 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.WeChatManagement.Common.WeChatApps; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; + +namespace EasyAbp.WeChatManagement.Common.Web.Pages.WeChatManagement.Common.WeChatApps.WeChatApp.ViewModels +{ + public class CreateEditWeChatAppViewModel + { + [Display(Name = "WeChatAppType")] + public WeChatAppType Type { get; set; } + + [Placeholder("WeChatAppWeChatComponentIdPlaceHolder")] + [Display(Name = "WeChatAppWeChatComponentId")] + public Guid? WeChatComponentId { get; set; } + + [Required] + [Display(Name = "WeChatAppName")] + public string Name { get; set; } + + [Required] + [Display(Name = "WeChatAppDisplayName")] + public string DisplayName { get; set; } + + [Required] + [Display(Name = "WeChatAppOpenAppIdOrName")] + public string OpenAppIdOrName { get; set; } = "Default"; + + [Required] + [Display(Name = "WeChatAppAppId")] + public string AppId { get; set; } + + [Placeholder("WeChatAppAppSecretPlaceHolder")] + [Display(Name = "WeChatAppAppSecret")] + public string AppSecret { get; set; } + + [Display(Name = "WeChatAppToken")] + public string Token { get; set; } + + [Display(Name = "WeChatAppEncodingAesKey")] + public string EncodingAesKey { get; set; } + } +} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/index.css b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/index.css similarity index 100% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/index.css rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/index.css diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/index.js b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/index.js similarity index 65% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/index.js rename to modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/index.js index b07f8bae..c044d8a2 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/index.js +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/WeChatManagement/Common/WeChatApps/WeChatApp/index.js @@ -1,12 +1,12 @@ $(function () { - var l = abp.localization.getResource('EasyAbpWeChatManagementMiniPrograms'); + var l = abp.localization.getResource('EasyAbpWeChatManagementCommon'); - var service = easyAbp.weChatManagement.miniPrograms.miniPrograms.miniProgram; - var createModal = new abp.ModalManager(abp.appPath + 'WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/CreateModal'); - var editModal = new abp.ModalManager(abp.appPath + 'WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/EditModal'); + var service = easyAbp.weChatManagement.common.weChatApps.weChatApp; + var createModal = new abp.ModalManager(abp.appPath + 'WeChatManagement/Common/WeChatApps/WeChatApp/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'WeChatManagement/Common/WeChatApps/WeChatApp/EditModal'); - var dataTable = $('#MiniProgramTable').DataTable(abp.libs.datatables.normalizeConfiguration({ + var dataTable = $('#WeChatAppTable').DataTable(abp.libs.datatables.normalizeConfiguration({ processing: true, serverSide: true, paging: true, @@ -22,16 +22,16 @@ $(function () { [ { text: l('Edit'), - visible: abp.auth.isGranted('EasyAbp.WeChatManagement.MiniPrograms.MiniProgram.Update'), + visible: abp.auth.isGranted('EasyAbp.WeChatManagement.Common.WeChatApp.Update'), action: function (data) { editModal.open({ id: data.record.id }); } }, { text: l('Delete'), - visible: abp.auth.isGranted('EasyAbp.WeChatManagement.MiniPrograms.MiniProgram.Delete'), + visible: abp.auth.isGranted('EasyAbp.WeChatManagement.Common.WeChatApp.Delete'), confirmMessage: function (data) { - return l('MiniProgramDeletionConfirmationMessage', data.record.id); + return l('WeChatAppDeletionConfirmationMessage', data.record.id); }, action: function (data) { service.delete(data.record.id) @@ -44,6 +44,23 @@ $(function () { ] } }, + { + data: "type", + render: function (data) { + switch (data) { + case 0: + return l("WeChatAppType.MiniProgram"); + case 1: + return l("WeChatAppType.Official"); + case 2: + return l("WeChatAppType.Work"); + case 3: + return l("WeChatAppType.OpenPlatform"); + default: + return null; + } + } + }, { data: "weChatComponentId" }, { data: "name" }, { data: "displayName" }, @@ -64,7 +81,7 @@ $(function () { dataTable.ajax.reload(); }); - $('#NewMiniProgramButton').click(function (e) { + $('#NewWeChatAppButton').click(function (e) { e.preventDefault(); createModal.open(); }); diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/_ViewImports.cshtml b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/_ViewImports.cshtml new file mode 100644 index 00000000..c1da1f5f --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Pages/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Properties/launchSettings.json b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Properties/launchSettings.json new file mode 100644 index 00000000..125bfcba --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:64779/", + "sslPort": 44326 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "EasyAbp.WeChatManagement.Common.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/WeChatManagementCommonWebModule.cs b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/WeChatManagementCommonWebModule.cs new file mode 100644 index 00000000..ea04e283 --- /dev/null +++ b/modules/Common/src/EasyAbp.WeChatManagement.Common.Web/WeChatManagementCommonWebModule.cs @@ -0,0 +1,59 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.DependencyInjection; +using EasyAbp.WeChatManagement.Common.Localization; +using EasyAbp.WeChatManagement.Common.Web.Menus; +using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; +using Volo.Abp.VirtualFileSystem; +using EasyAbp.WeChatManagement.Common.Permissions; + +namespace EasyAbp.WeChatManagement.Common.Web +{ + [DependsOn( + typeof(WeChatManagementCommonHttpApiModule), + typeof(AbpAspNetCoreMvcUiThemeSharedModule), + typeof(AbpAutoMapperModule) + )] + public class WeChatManagementCommonWebModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.PreConfigure(options => + { + options.AddAssemblyResource(typeof(CommonResource), typeof(WeChatManagementCommonWebModule).Assembly); + }); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(WeChatManagementCommonWebModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.MenuContributors.Add(new CommonMenuContributor()); + }); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + + Configure(options => + { + //Configure authorization. + }); + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/CommonApplicationTestBase.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/CommonApplicationTestBase.cs new file mode 100644 index 00000000..6f805280 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/CommonApplicationTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.WeChatManagement.Common +{ + /* Inherit from this class for your application layer tests. + * See SampleAppService_Tests for example. + */ + public abstract class CommonApplicationTestBase : CommonTestBase + { + + } +} \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/CommonApplicationTestModule.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/CommonApplicationTestModule.cs new file mode 100644 index 00000000..1afe539f --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/CommonApplicationTestModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Modularity; + +namespace EasyAbp.WeChatManagement.Common +{ + [DependsOn( + typeof(WeChatManagementCommonApplicationModule), + typeof(CommonDomainTestModule) + )] + public class CommonApplicationTestModule : AbpModule + { + + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/EasyAbp.WeChatManagement.Common.Application.Tests.csproj b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/EasyAbp.WeChatManagement.Common.Application.Tests.csproj new file mode 100644 index 00000000..578d6231 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/EasyAbp.WeChatManagement.Common.Application.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + net5.0 + EasyAbp.WeChatManagement.Common + + + + + + + + + diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/FodyWeavers.xml b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/FodyWeavers.xsd b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/WeChatAppUsers/WeChatAppUserAppServiceTests.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/WeChatAppUsers/WeChatAppUserAppServiceTests.cs new file mode 100644 index 00000000..a5b50b58 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/WeChatAppUsers/WeChatAppUserAppServiceTests.cs @@ -0,0 +1,25 @@ +using System.Threading.Tasks; +using Xunit; + +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers +{ + public class WeChatAppUserAppServiceTests : CommonApplicationTestBase + { + private readonly IWeChatAppUserAppService _weChatAppUserAppService; + + public WeChatAppUserAppServiceTests() + { + _weChatAppUserAppService = GetRequiredService(); + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Act + + // Assert + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/WeChatApps/WeChatAppAppServiceTests.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/WeChatApps/WeChatAppAppServiceTests.cs new file mode 100644 index 00000000..cb8ebb73 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Application.Tests/WeChatApps/WeChatAppAppServiceTests.cs @@ -0,0 +1,25 @@ +using System.Threading.Tasks; +using Xunit; + +namespace EasyAbp.WeChatManagement.Common.WeChatApps +{ + public class WeChatAppAppServiceTests : CommonApplicationTestBase + { + private readonly IWeChatAppAppService _weChatAppAppService; + + public WeChatAppAppServiceTests() + { + _weChatAppAppService = GetRequiredService(); + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Act + + // Assert + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/CommonDomainTestBase.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/CommonDomainTestBase.cs new file mode 100644 index 00000000..54723689 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/CommonDomainTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.WeChatManagement.Common +{ + /* Inherit from this class for your domain layer tests. + * See SampleManager_Tests for example. + */ + public abstract class CommonDomainTestBase : CommonTestBase + { + + } +} \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/CommonDomainTestModule.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/CommonDomainTestModule.cs new file mode 100644 index 00000000..17ddef3f --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/CommonDomainTestModule.cs @@ -0,0 +1,17 @@ +using EasyAbp.WeChatManagement.Common.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.WeChatManagement.Common +{ + /* Domain tests are configured to use the EF Core provider. + * You can switch to MongoDB, however your domain tests should be + * database independent anyway. + */ + [DependsOn( + typeof(CommonEntityFrameworkCoreTestModule) + )] + public class CommonDomainTestModule : AbpModule + { + + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/EasyAbp.WeChatManagement.Common.Domain.Tests.csproj b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/EasyAbp.WeChatManagement.Common.Domain.Tests.csproj new file mode 100644 index 00000000..4f999177 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/EasyAbp.WeChatManagement.Common.Domain.Tests.csproj @@ -0,0 +1,15 @@ + + + + + + net5.0 + EasyAbp.WeChatManagement.Common + + + + + + + + diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/FodyWeavers.xml b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/FodyWeavers.xsd b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/MiniPrograms/MiniProgramDomainTests.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/WeChatAppUsers/WeChatAppUserDomainTests.cs similarity index 54% rename from modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/MiniPrograms/MiniProgramDomainTests.cs rename to modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/WeChatAppUsers/WeChatAppUserDomainTests.cs index 34a38ccf..1d379b1c 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/MiniPrograms/MiniProgramDomainTests.cs +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/WeChatAppUsers/WeChatAppUserDomainTests.cs @@ -1,12 +1,11 @@ using System.Threading.Tasks; -using Shouldly; using Xunit; -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms +namespace EasyAbp.WeChatManagement.Common.WeChatAppUsers { - public class MiniProgramDomainTests : MiniProgramsDomainTestBase + public class WeChatAppUserDomainTests : CommonDomainTestBase { - public MiniProgramDomainTests() + public WeChatAppUserDomainTests() { } diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/MiniProgramUsers/MiniProgramUserDomainTests.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/WeChatApps/WeChatAppDomainTests.cs similarity index 52% rename from modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/MiniProgramUsers/MiniProgramUserDomainTests.cs rename to modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/WeChatApps/WeChatAppDomainTests.cs index ab06e794..19e5911e 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/MiniProgramUsers/MiniProgramUserDomainTests.cs +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.Domain.Tests/WeChatApps/WeChatAppDomainTests.cs @@ -1,12 +1,11 @@ using System.Threading.Tasks; -using Shouldly; using Xunit; -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers +namespace EasyAbp.WeChatManagement.Common.WeChatApps { - public class MiniProgramUserDomainTests : MiniProgramsDomainTestBase + public class WeChatAppDomainTests : CommonDomainTestBase { - public MiniProgramUserDomainTests() + public WeChatAppDomainTests() { } diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests.csproj b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests.csproj new file mode 100644 index 00000000..650e47cc --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,18 @@ + + + + + + net5.0 + EasyAbp.WeChatManagement.Common + + + + + + + + + + + diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/CommonEntityFrameworkCoreTestBase.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/CommonEntityFrameworkCoreTestBase.cs new file mode 100644 index 00000000..be0a29bf --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/CommonEntityFrameworkCoreTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.WeChatManagement.Common.EntityFrameworkCore +{ + /* This class can be used as a base class for EF Core integration tests, + * while SampleRepository_Tests uses a different approach. + */ + public abstract class CommonEntityFrameworkCoreTestBase : CommonTestBase + { + + } +} \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/CommonEntityFrameworkCoreTestModule.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/CommonEntityFrameworkCoreTestModule.cs new file mode 100644 index 00000000..198e3190 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/CommonEntityFrameworkCoreTestModule.cs @@ -0,0 +1,43 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.Modularity; + +namespace EasyAbp.WeChatManagement.Common.EntityFrameworkCore +{ + [DependsOn( + typeof(CommonTestBaseModule), + typeof(WeChatManagementCommonEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] + public class CommonEntityFrameworkCoreTestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var sqliteConnection = CreateDatabaseAndGetConnection(); + + Configure(options => + { + options.Configure(abpDbContextConfigurationContext => + { + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); + }); + }); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new SqliteConnection("Data Source=:memory:"); + connection.Open(); + + new CommonDbContext( + new DbContextOptionsBuilder().UseSqlite(connection).Options + ).GetService().CreateTables(); + + return connection; + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/WeChatAppUsers/WeChatAppUserRepositoryTests.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/WeChatAppUsers/WeChatAppUserRepositoryTests.cs new file mode 100644 index 00000000..b5e4f10f --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/WeChatAppUsers/WeChatAppUserRepositoryTests.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers; +using Xunit; + +namespace EasyAbp.WeChatManagement.Common.EntityFrameworkCore.WeChatAppUsers +{ + public class WeChatAppUserRepositoryTests : CommonEntityFrameworkCoreTestBase + { + private readonly IWeChatAppUserRepository _weChatAppUserRepository; + + public WeChatAppUserRepositoryTests() + { + _weChatAppUserRepository = GetRequiredService(); + } + + [Fact] + public async Task Test1() + { + await WithUnitOfWorkAsync(async () => + { + // Arrange + + // Act + + //Assert + }); + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/WeChatApps/WeChatAppRepositoryTests.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/WeChatApps/WeChatAppRepositoryTests.cs new file mode 100644 index 00000000..f0d67336 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/EntityFrameworkCore/WeChatApps/WeChatAppRepositoryTests.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.WeChatApps; +using Xunit; + +namespace EasyAbp.WeChatManagement.Common.EntityFrameworkCore.WeChatApps +{ + public class WeChatAppRepositoryTests : CommonEntityFrameworkCoreTestBase + { + private readonly IWeChatAppRepository _weChatAppRepository; + + public WeChatAppRepositoryTests() + { + _weChatAppRepository = GetRequiredService(); + } + + [Fact] + public async Task Test1() + { + await WithUnitOfWorkAsync(async () => + { + // Arrange + + // Act + + //Assert + }); + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/FodyWeavers.xml b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/FodyWeavers.xsd b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.EntityFrameworkCore.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 00000000..9ea4730d --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,146 @@ +using System; +using System.Net.Http; +using System.Threading.Tasks; +using IdentityModel.Client; +using Microsoft.Extensions.Configuration; +using Volo.Abp.DependencyInjection; +using Volo.Abp.IdentityModel; + +namespace EasyAbp.WeChatManagement.Common +{ + public class ClientDemoService : ITransientDependency + { + private readonly IIdentityModelAuthenticationService _authenticationService; + private readonly IConfiguration _configuration; + + public ClientDemoService( + IIdentityModelAuthenticationService authenticationService, + IConfiguration configuration) + { + _authenticationService = authenticationService; + _configuration = configuration; + } + + public async Task RunAsync() + { + await TestWithDynamicProxiesAsync(); + await TestWithHttpClientAndIdentityModelAuthenticationServiceAsync(); + await TestAllManuallyAsync(); + } + + /* Shows how to perform an HTTP request to the API using ABP's dynamic c# proxy + * feature. It is just simple as calling a local service method. + * Authorization and HTTP request details are handled by the ABP framework. + */ + private async Task TestWithDynamicProxiesAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestWithDynamicProxiesAsync)} *****"); + } + + /* Shows how to use HttpClient to perform a request to the HTTP API. + * It uses ABP's IIdentityModelAuthenticationService to simplify obtaining access tokens. + */ + private async Task TestWithHttpClientAndIdentityModelAuthenticationServiceAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestWithHttpClientAndIdentityModelAuthenticationServiceAsync)} *****"); + + //Get access token using ABP's IIdentityModelAuthenticationService + + var accessToken = await _authenticationService.GetAccessTokenAsync( + new IdentityClientConfiguration( + _configuration["IdentityClients:Default:Authority"], + _configuration["IdentityClients:Default:Scope"], + _configuration["IdentityClients:Default:ClientId"], + _configuration["IdentityClients:Default:ClientSecret"], + _configuration["IdentityClients:Default:GrantType"], + _configuration["IdentityClients:Default:UserName"], + _configuration["IdentityClients:Default:UserPassword"] + ) + ); + + //Perform the actual HTTP request + + using (var httpClient = new HttpClient()) + { + httpClient.SetBearerToken(accessToken); + + var url = _configuration["RemoteServices:Common:BaseUrl"] + + "api/Common/sample/authorized"; + + var responseMessage = await httpClient.GetAsync(url); + if (responseMessage.IsSuccessStatusCode) + { + var responseString = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine("Result: " + responseString); + } + else + { + throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); + } + } + } + + /* Shows how to use HttpClient to perform a request to the HTTP API. + * It obtains access token using IdentityServer's API. See its documentation: + * https://identityserver4.readthedocs.io/en/latest/quickstarts/2_resource_owner_passwords.html + */ + private async Task TestAllManuallyAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestAllManuallyAsync)} *****"); + + //Obtain access token from the IDS4 server + + // discover endpoints from metadata + var client = new HttpClient(); + var disco = await client.GetDiscoveryDocumentAsync(_configuration["IdentityClients:Default:Authority"]); + if (disco.IsError) + { + Console.WriteLine(disco.Error); + return; + } + + // request token + var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest + { + Address = disco.TokenEndpoint, + ClientId = _configuration["IdentityClients:Default:ClientId"], + ClientSecret = _configuration["IdentityClients:Default:ClientSecret"], + UserName = _configuration["IdentityClients:Default:UserName"], + Password = _configuration["IdentityClients:Default:UserPassword"], + Scope = _configuration["IdentityClients:Default:Scope"] + }); + + if (tokenResponse.IsError) + { + Console.WriteLine(tokenResponse.Error); + return; + } + + Console.WriteLine(tokenResponse.Json); + + //Perform the actual HTTP request + + using (var httpClient = new HttpClient()) + { + httpClient.SetBearerToken(tokenResponse.AccessToken); + + var url = _configuration["RemoteServices:Common:BaseUrl"] + + "api/Common/sample/authorized"; + + var responseMessage = await httpClient.GetAsync(url); + if (responseMessage.IsSuccessStatusCode) + { + var responseString = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine("Result: " + responseString); + } + else + { + throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); + } + } + } + } +} \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/CommonConsoleApiClientModule.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/CommonConsoleApiClientModule.cs new file mode 100644 index 00000000..96203bdf --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/CommonConsoleApiClientModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace EasyAbp.WeChatManagement.Common +{ + [DependsOn( + typeof(WeChatManagementCommonHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] + public class CommonConsoleApiClientModule : AbpModule + { + + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 00000000..68c9c4ed --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,37 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp +{ + public class ConsoleTestAppHostedService : IHostedService + { + private readonly IConfiguration _configuration; + + public ConsoleTestAppHostedService(IConfiguration configuration) + { + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = AbpApplicationFactory.Create(options=> + { + options.Services.ReplaceConfiguration(_configuration); + })) + { + application.Initialize(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + application.Shutdown(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp.csproj b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 00000000..e2717358 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,27 @@ + + + + Exe + net5.0 + EasyAbp.WeChatManagement.Common + + + + + + + + + + + PreserveNewest + Always + + + + + + + + + diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/Program.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 00000000..1c551b1d --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,26 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp +{ + class Program + { + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureAppConfiguration(build => + { + build.AddJsonFile("appsettings.secrets.json", optional: true); + }) + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/appsettings.json b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 00000000..cd5bd679 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,21 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44378/" + }, + "Common": { + "BaseUrl": "https://localhost:44391/" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "Common_App", + "ClientSecret": "1q2w3e*", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44378/", + "Scope": "Common" + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/EasyAbp.WeChatManagement.Common.MongoDB.Tests.csproj b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/EasyAbp.WeChatManagement.Common.MongoDB.Tests.csproj new file mode 100644 index 00000000..a866b542 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/EasyAbp.WeChatManagement.Common.MongoDB.Tests.csproj @@ -0,0 +1,17 @@ + + + + + + net5.0 + EasyAbp.WeChatManagement.Common + + + + + + + + + + diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/FodyWeavers.xml b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/FodyWeavers.xsd b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/CommonMongoDbTestBase.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/CommonMongoDbTestBase.cs new file mode 100644 index 00000000..d9814fe9 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/CommonMongoDbTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.WeChatManagement.Common.MongoDB +{ + /* This class can be used as a base class for MongoDB integration tests, + * while SampleRepository_Tests uses a different approach. + */ + public abstract class CommonMongoDbTestBase : CommonTestBase + { + + } +} \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/CommonMongoDbTestModule.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/CommonMongoDbTestModule.cs new file mode 100644 index 00000000..1639d286 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/CommonMongoDbTestModule.cs @@ -0,0 +1,27 @@ +using System; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; + +namespace EasyAbp.WeChatManagement.Common.MongoDB +{ + [DependsOn( + typeof(CommonTestBaseModule), + typeof(WeChatManagementCommonMongoDbModule) + )] + public class CommonMongoDbTestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; + + Configure(options => + { + options.ConnectionStrings.Default = connectionString; + }); + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/MongoDbFixture.cs new file mode 100644 index 00000000..fab2cf6a --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/MongoDbFixture.cs @@ -0,0 +1,22 @@ +using System; +using Mongo2Go; + +namespace EasyAbp.WeChatManagement.Common.MongoDB +{ + public class MongoDbFixture : IDisposable + { + private static readonly MongoDbRunner MongoDbRunner; + public static readonly string ConnectionString; + + static MongoDbFixture() + { + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); + ConnectionString = MongoDbRunner.ConnectionString; + } + + public void Dispose() + { + MongoDbRunner?.Dispose(); + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/MongoTestCollection.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/MongoTestCollection.cs new file mode 100644 index 00000000..1217006f --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/MongoTestCollection.cs @@ -0,0 +1,10 @@ +using Xunit; + +namespace EasyAbp.WeChatManagement.Common.MongoDB +{ + [CollectionDefinition(Name)] + public class MongoTestCollection : ICollectionFixture + { + public const string Name = "MongoDB Collection"; + } +} \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs new file mode 100644 index 00000000..abd751c0 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs @@ -0,0 +1,14 @@ +using EasyAbp.WeChatManagement.Common.Samples; +using Xunit; + +namespace EasyAbp.WeChatManagement.Common.MongoDB.Samples +{ + [Collection(MongoTestCollection.Name)] + public class SampleRepository_Tests : SampleRepository_Tests + { + /* Don't write custom repository tests here, instead write to + * the base class. + * One exception can be some specific tests related to MongoDB. + */ + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/CommonDataSeedContributor.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/CommonDataSeedContributor.cs new file mode 100644 index 00000000..4e862b01 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/CommonDataSeedContributor.cs @@ -0,0 +1,33 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.WeChatManagement.Common +{ + public class CommonDataSeedContributor : IDataSeedContributor, ITransientDependency + { + private readonly IGuidGenerator _guidGenerator; + private readonly ICurrentTenant _currentTenant; + + public CommonDataSeedContributor( + IGuidGenerator guidGenerator, ICurrentTenant currentTenant) + { + _guidGenerator = guidGenerator; + _currentTenant = currentTenant; + } + + public Task SeedAsync(DataSeedContext context) + { + /* Instead of returning the Task.CompletedTask, you can insert your test data + * at this point! + */ + + using (_currentTenant.Change(context?.TenantId)) + { + return Task.CompletedTask; + } + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/CommonTestBase.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/CommonTestBase.cs new file mode 100644 index 00000000..cf590f37 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/CommonTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace EasyAbp.WeChatManagement.Common +{ + /* All test classes are derived from this class, directly or indirectly. */ + public abstract class CommonTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule + { + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/CommonTestBaseModule.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/CommonTestBaseModule.cs new file mode 100644 index 00000000..76756772 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/CommonTestBaseModule.cs @@ -0,0 +1,42 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace EasyAbp.WeChatManagement.Common +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(WeChatManagementCommonDomainModule) + )] + public class CommonTestBaseModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/EasyAbp.WeChatManagement.Common.TestBase.csproj b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/EasyAbp.WeChatManagement.Common.TestBase.csproj new file mode 100644 index 00000000..0bb10861 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/EasyAbp.WeChatManagement.Common.TestBase.csproj @@ -0,0 +1,23 @@ + + + + + + net5.0 + EasyAbp.WeChatManagement.Common + + + + + + + + + + + + + + + + diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/FodyWeavers.xml b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/FodyWeavers.xsd b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/Samples/SampleRepository_Tests.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/Samples/SampleRepository_Tests.cs new file mode 100644 index 00000000..3eb59f99 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/Samples/SampleRepository_Tests.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Volo.Abp.Modularity; +using Xunit; + +namespace EasyAbp.WeChatManagement.Common.Samples +{ + /* Write your custom repository tests like that, in this project, as abstract classes. + * Then inherit these abstract classes from EF Core & MongoDB test projects. + * In this way, both database providers are tests with the same set tests. + */ + public abstract class SampleRepository_Tests : CommonTestBase + where TStartupModule : IAbpModule + { + //private readonly ISampleRepository _sampleRepository; + + protected SampleRepository_Tests() + { + //_sampleRepository = GetRequiredService(); + } + + [Fact] + public async Task Method1Async() + { + + } + } +} diff --git a/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 00000000..48ad2580 --- /dev/null +++ b/modules/Common/test/EasyAbp.WeChatManagement.Common.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace EasyAbp.WeChatManagement.Common.Security +{ + [Dependency(ReplaceServices = true)] + public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor + { + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal _principal; + + private ClaimsPrincipal GetPrincipal() + { + if (_principal == null) + { + lock (this) + { + if (_principal == null) + { + _principal = new ClaimsPrincipal( + new ClaimsIdentity( + new List + { + new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName,"admin"), + new Claim(AbpClaimTypes.Email,"admin@abp.io") + } + ) + ); + } + } + } + + return _principal; + } + } +} diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts.csproj b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts.csproj index 2562cb8d..6026e0fc 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts.csproj +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts.csproj @@ -11,6 +11,7 @@ + diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/IMiniProgramUserAppService.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/IMiniProgramUserAppService.cs deleted file mode 100644 index 15c4af0b..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/IMiniProgramUserAppService.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers.Dtos; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers -{ - public interface IMiniProgramUserAppService : - IReadOnlyAppService< - MiniProgramUserDto, - Guid, - PagedAndSortedResultRequestDto> - { - - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/IMiniProgramAppService.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/IMiniProgramAppService.cs deleted file mode 100644 index ad02e143..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/IMiniProgramAppService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.Dtos; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms -{ - public interface IMiniProgramAppService : - ICrudAppService< - MiniProgramDto, - Guid, - PagedAndSortedResultRequestDto, - CreateUpdateMiniProgramDto, - CreateUpdateMiniProgramDto> - { - - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/Permissions/MiniProgramsPermissionDefinitionProvider.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/Permissions/MiniProgramsPermissionDefinitionProvider.cs index d964a67e..466e89ba 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/Permissions/MiniProgramsPermissionDefinitionProvider.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/Permissions/MiniProgramsPermissionDefinitionProvider.cs @@ -9,14 +9,7 @@ public class MiniProgramsPermissionDefinitionProvider : PermissionDefinitionProv public override void Define(IPermissionDefinitionContext context) { var myGroup = context.AddGroup(MiniProgramsPermissions.GroupName, L("Permission:MiniPrograms")); - - var miniProgramPermission = myGroup.AddPermission(MiniProgramsPermissions.MiniProgram.Default, L("Permission:MiniProgram")); - miniProgramPermission.AddChild(MiniProgramsPermissions.MiniProgram.Create, L("Permission:Create")); - miniProgramPermission.AddChild(MiniProgramsPermissions.MiniProgram.Update, L("Permission:Update")); - miniProgramPermission.AddChild(MiniProgramsPermissions.MiniProgram.Delete, L("Permission:Delete")); - - var miniProgramUserPermission = myGroup.AddPermission(MiniProgramsPermissions.MiniProgramUser.Default, L("Permission:MiniProgramUser")); - + var userInfoPermission = myGroup.AddPermission(MiniProgramsPermissions.UserInfo.Default, L("Permission:UserInfo")); } diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/Permissions/MiniProgramsPermissions.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/Permissions/MiniProgramsPermissions.cs index c1316234..069babea 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/Permissions/MiniProgramsPermissions.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/Permissions/MiniProgramsPermissions.cs @@ -11,19 +11,6 @@ public static string[] GetAll() return ReflectionHelper.GetPublicConstantsRecursively(typeof(MiniProgramsPermissions)); } - public class MiniProgram - { - public const string Default = GroupName + ".MiniProgram"; - public const string Update = Default + ".Update"; - public const string Create = Default + ".Create"; - public const string Delete = Default + ".Delete"; - } - - public class MiniProgramUser - { - public const string Default = GroupName + ".MiniProgramUser"; - } - public class UserInfo { public const string Default = GroupName + ".UserInfo"; diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsApplicationContractsModule.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsApplicationContractsModule.cs index 959c41c8..1e0b5e8f 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsApplicationContractsModule.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsApplicationContractsModule.cs @@ -1,4 +1,5 @@ -using Volo.Abp.Application; +using EasyAbp.WeChatManagement.Common; +using Volo.Abp.Application; using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; using Volo.Abp.Authorization; @@ -8,7 +9,8 @@ namespace EasyAbp.WeChatManagement.MiniPrograms [DependsOn( typeof(WeChatManagementMiniProgramsDomainSharedModule), typeof(AbpDddApplicationContractsModule), - typeof(AbpAuthorizationModule) + typeof(AbpAuthorizationModule), + typeof(WeChatManagementCommonApplicationContractsModule) )] public class WeChatManagementMiniProgramsApplicationContractsModule : AbpModule { diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp.WeChatManagement.MiniPrograms.Application.csproj b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp.WeChatManagement.MiniPrograms.Application.csproj index 7923c14a..5d7b0138 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp.WeChatManagement.MiniPrograms.Application.csproj +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp.WeChatManagement.MiniPrograms.Application.csproj @@ -11,6 +11,7 @@ + diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/Abp/WeChat/ClaimsWeChatMiniProgramOptionsResolveContributor.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/Abp/WeChat/ClaimsWeChatMiniProgramOptionsResolveContributor.cs index ce65a5a4..e39929d9 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/Abp/WeChat/ClaimsWeChatMiniProgramOptionsResolveContributor.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/Abp/WeChat/ClaimsWeChatMiniProgramOptionsResolveContributor.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using EasyAbp.Abp.WeChat.MiniProgram; using EasyAbp.Abp.WeChat.MiniProgram.Infrastructure.OptionsResolve; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; +using EasyAbp.WeChatManagement.Common.WeChatApps; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Users; @@ -24,9 +24,9 @@ public async Task ResolveAsync(WeChatMiniProgramOptionsResolveContext context) } // Todo: should use IMiniProgramStore - var miniProgramRepository = context.ServiceProvider.GetRequiredService(); + var weChatAppRepository = context.ServiceProvider.GetRequiredService(); - var miniProgram = await miniProgramRepository.GetAsync(x => x.AppId == appid.Value); + var miniProgram = await weChatAppRepository.GetMiniProgramAppByAppIdAsync(appid.Value); context.Options = new AbpWeChatMiniProgramOptions { diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Identity/ProfileAppService.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Identity/ProfileAppService.cs index 07e782fb..5834df58 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Identity/ProfileAppService.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Identity/ProfileAppService.cs @@ -2,8 +2,8 @@ using System.Threading.Tasks; using EasyAbp.Abp.WeChat.MiniProgram.Infrastructure; using EasyAbp.Abp.WeChat.MiniProgram.Services.Login; +using EasyAbp.WeChatManagement.Common.WeChatApps; using EasyAbp.WeChatManagement.MiniPrograms.Identity.Dtos; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Options; @@ -21,20 +21,20 @@ public class ProfileAppService : MiniProgramsAppService, IProfileAppService private readonly IOptions _identityOptions; private readonly IdentityUserManager _identityUserManager; private readonly IJsonSerializer _jsonSerializer; - private readonly IMiniProgramRepository _miniProgramRepository; + private readonly IWeChatAppRepository _weChatAppRepository; public ProfileAppService( LoginService loginService, IOptions identityOptions, IdentityUserManager identityUserManager, IJsonSerializer jsonSerializer, - IMiniProgramRepository miniProgramRepository) + IWeChatAppRepository weChatAppRepository) { _loginService = loginService; _identityOptions = identityOptions; _identityUserManager = identityUserManager; _jsonSerializer = jsonSerializer; - _miniProgramRepository = miniProgramRepository; + _weChatAppRepository = weChatAppRepository; } /// @@ -49,8 +49,8 @@ public async Task BindPhoneNumberAsync(BindPhoneNumberInput input) await _identityOptions.SetAsync(); var user = await _identityUserManager.GetByIdAsync(CurrentUser.GetId()); - - var miniProgram = await _miniProgramRepository.GetAsync(x => x.AppId == input.AppId); + + var miniProgram = await _weChatAppRepository.GetMiniProgramAppByAppIdAsync(input.AppId); var response = await _loginService.Code2SessionAsync(miniProgram.AppId, miniProgram.AppSecret, input.Code); diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/LoginAppService.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/LoginAppService.cs index 08ee2fb6..ff9ff30a 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/LoginAppService.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/LoginAppService.cs @@ -1,12 +1,9 @@ using EasyAbp.Abp.WeChat; using EasyAbp.Abp.WeChat.MiniProgram; -using EasyAbp.Abp.WeChat.MiniProgram.Infrastructure; using EasyAbp.Abp.WeChat.MiniProgram.Services.ACode; using EasyAbp.Abp.WeChat.MiniProgram.Services.Login; using EasyAbp.WeChatManagement.Common; using EasyAbp.WeChatManagement.MiniPrograms.Login.Dtos; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers; using EasyAbp.WeChatManagement.MiniPrograms.Settings; using EasyAbp.WeChatManagement.MiniPrograms.UserInfos; using IdentityModel.Client; @@ -16,15 +13,14 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Options; using System; -using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.UserInfos.Dtos; +using EasyAbp.WeChatManagement.Common.WeChatApps; +using EasyAbp.WeChatManagement.Common.WeChatAppUsers; using Volo.Abp.Caching; using Volo.Abp.Data; using Volo.Abp.Domain.Repositories; using Volo.Abp.Identity; -using Volo.Abp.Json; using Volo.Abp.MultiTenancy; using Volo.Abp.Uow; using Volo.Abp.Users; @@ -45,14 +41,14 @@ public class LoginAppService : MiniProgramsAppService, ILoginAppService private readonly IHttpClientFactory _httpClientFactory; private readonly IUserInfoRepository _userInfoRepository; private readonly IWeChatMiniProgramAsyncLocal _weChatMiniProgramAsyncLocal; - private readonly IMiniProgramUserRepository _miniProgramUserRepository; + private readonly IWeChatAppRepository _weChatAppRepository; + private readonly IWeChatAppUserRepository _weChatAppUserRepository; private readonly IMiniProgramLoginNewUserCreator _miniProgramLoginNewUserCreator; private readonly IMiniProgramLoginProviderProvider _miniProgramLoginProviderProvider; private readonly IDistributedCache _pcLoginAuthorizationCache; private readonly IDistributedCache _pcLoginUserLimitCache; private readonly IOptions _identityOptions; private readonly IdentityUserManager _identityUserManager; - private readonly IMiniProgramRepository _miniProgramRepository; public LoginAppService( LoginService loginService, @@ -63,14 +59,14 @@ public class LoginAppService : MiniProgramsAppService, ILoginAppService IHttpClientFactory httpClientFactory, IUserInfoRepository userInfoRepository, IWeChatMiniProgramAsyncLocal weChatMiniProgramAsyncLocal, - IMiniProgramUserRepository miniProgramUserRepository, + IWeChatAppRepository weChatAppRepository, + IWeChatAppUserRepository weChatAppUserRepository, IMiniProgramLoginNewUserCreator miniProgramLoginNewUserCreator, IMiniProgramLoginProviderProvider miniProgramLoginProviderProvider, IDistributedCache pcLoginAuthorizationCache, IDistributedCache pcLoginUserLimitCache, IOptions identityOptions, - IdentityUserManager identityUserManager, - IMiniProgramRepository miniProgramRepository) + IdentityUserManager identityUserManager) { _loginService = loginService; _aCodeService = aCodeService; @@ -80,14 +76,14 @@ public class LoginAppService : MiniProgramsAppService, ILoginAppService _httpClientFactory = httpClientFactory; _userInfoRepository = userInfoRepository; _weChatMiniProgramAsyncLocal = weChatMiniProgramAsyncLocal; - _miniProgramUserRepository = miniProgramUserRepository; + _weChatAppRepository = weChatAppRepository; + _weChatAppUserRepository = weChatAppUserRepository; _miniProgramLoginNewUserCreator = miniProgramLoginNewUserCreator; _miniProgramLoginProviderProvider = miniProgramLoginProviderProvider; _pcLoginAuthorizationCache = pcLoginAuthorizationCache; _pcLoginUserLimitCache = pcLoginUserLimitCache; _identityOptions = identityOptions; _identityUserManager = identityUserManager; - _miniProgramRepository = miniProgramRepository; } [Authorize] @@ -103,7 +99,7 @@ public virtual async Task BindAsync(LoginInput input) if (await _identityUserManager.FindByLoginAsync(loginResult.LoginProvider, loginResult.ProviderKey) != null) { - throw new WechatAccountHasBeenBoundException(); + throw new WeChatAccountHasBeenBoundException(); } var identityUser = await _identityUserManager.GetByIdAsync(CurrentUser.GetId()); @@ -112,7 +108,7 @@ public virtual async Task BindAsync(LoginInput input) new UserLoginInfo(loginResult.LoginProvider, loginResult.ProviderKey, WeChatManagementCommonConsts.WeChatUserLoginInfoDisplayName))).CheckErrors(); - await UpdateMiniProgramUserAsync(identityUser, loginResult.MiniProgram, loginResult.UnionId, + await UpdateWeChatAppUserAsync(identityUser, loginResult.MiniProgram, loginResult.UnionId, loginResult.Code2SessionResponse.OpenId, loginResult.Code2SessionResponse.SessionKey); await TryCreateUserInfoAsync(identityUser, await GenerateFakeUserInfoAsync()); @@ -131,18 +127,19 @@ public virtual async Task UnbindAsync(LoginInput input) if (await _identityUserManager.FindByLoginAsync(loginResult.LoginProvider, loginResult.ProviderKey) == null) { - throw new WechatAccountHasNotBeenBoundException(); + throw new WeChatAccountHasNotBeenBoundException(); } var identityUser = await _identityUserManager.GetByIdAsync(CurrentUser.GetId()); (await _identityUserManager.RemoveLoginAsync(identityUser, loginResult.LoginProvider, loginResult.ProviderKey)).CheckErrors(); - await RemoveMiniProgramUserAsync(identityUser, loginResult.MiniProgram); - - if (!await _miniProgramUserRepository.AnyAsync(x => x.UserId == identityUser.Id)) + await RemoveWeChatAppUserAsync(identityUser, loginResult.MiniProgram); + + if (!await _weChatAppUserRepository.AnyInWeChatAppTypeAsync(WeChatAppType.MiniProgram, + x => x.UserId == identityUser.Id)) { - await RemoveUserInfoAsync(identityUser); + await TryRemoveUserInfoAsync(identityUser); } } @@ -161,7 +158,7 @@ public virtual async Task LoginAsync(LoginInput input) await _miniProgramLoginNewUserCreator.CreateAsync(loginResult.LoginProvider, loginResult.ProviderKey); - await UpdateMiniProgramUserAsync(identityUser, loginResult.MiniProgram, loginResult.UnionId, + await UpdateWeChatAppUserAsync(identityUser, loginResult.MiniProgram, loginResult.UnionId, loginResult.Code2SessionResponse.OpenId, loginResult.Code2SessionResponse.SessionKey); await TryCreateUserInfoAsync(identityUser, await GenerateFakeUserInfoAsync()); @@ -206,18 +203,19 @@ protected virtual async Task GetLoginResultAsync(LoginInpu var tenantId = CurrentTenant.Id; var tenantChanged = false; - MiniProgram miniProgram; + WeChatApp miniProgram; if (input.LookupUseRecentlyTenant) { using (_dataFilter.Disable()) { - miniProgram = await _miniProgramRepository.FirstOrDefaultAsync(x => x.AppId == input.AppId); + miniProgram = await _weChatAppRepository.FirstOrDefaultAsync(x => + x.AppId == input.AppId && x.Type == WeChatAppType.MiniProgram); } } else { - miniProgram = await _miniProgramRepository.GetAsync(x => x.AppId == input.AppId); + miniProgram = await _weChatAppRepository.GetMiniProgramAppByAppIdAsync(input.AppId); } var code2SessionResponse = @@ -230,7 +228,7 @@ protected virtual async Task GetLoginResultAsync(LoginInpu { using (_dataFilter.Disable()) { - tenantId = await _miniProgramUserRepository.FindRecentlyTenantIdAsync(input.AppId, openId, true); + tenantId = await _weChatAppUserRepository.FindRecentlyTenantIdAsync(input.AppId, openId, true); } if (tenantId != CurrentTenant.Id) @@ -243,7 +241,7 @@ protected virtual async Task GetLoginResultAsync(LoginInpu if (tenantChanged) { - miniProgram = await _miniProgramRepository.GetAsync(x => x.AppId == input.AppId); + miniProgram = await _weChatAppRepository.GetMiniProgramAppByAppIdAsync(input.AppId); } string loginProvider; @@ -274,17 +272,17 @@ public virtual async Task RefreshAsync(RefreshInput input) return (await RequestIds4RefreshAsync(input.RefreshToken))?.Raw; } - protected virtual async Task UpdateMiniProgramUserAsync(IdentityUser identityUser, MiniProgram miniProgram, string unionId, string openId, string sessionKey) + protected virtual async Task UpdateWeChatAppUserAsync(IdentityUser identityUser, WeChatApp miniProgram, string unionId, string openId, string sessionKey) { - var mpUserMapping = await _miniProgramUserRepository.FindAsync(x => - x.MiniProgramId == miniProgram.Id && x.UserId == identityUser.Id); + var mpUserMapping = await _weChatAppUserRepository.FindAsync(x => + x.WeChatAppId == miniProgram.Id && x.UserId == identityUser.Id); if (mpUserMapping == null) { - mpUserMapping = new MiniProgramUser(GuidGenerator.Create(), CurrentTenant.Id, miniProgram.Id, + mpUserMapping = new WeChatAppUser(GuidGenerator.Create(), CurrentTenant.Id, miniProgram.Id, identityUser.Id, unionId, openId); - await _miniProgramUserRepository.InsertAsync(mpUserMapping, true); + await _weChatAppUserRepository.InsertAsync(mpUserMapping, true); } else { @@ -293,16 +291,16 @@ protected virtual async Task UpdateMiniProgramUserAsync(IdentityUser identityUse mpUserMapping.UpdateSessionKey(sessionKey, Clock); - await _miniProgramUserRepository.UpdateAsync(mpUserMapping, true); + await _weChatAppUserRepository.UpdateAsync(mpUserMapping, true); } } - protected virtual async Task RemoveMiniProgramUserAsync(IdentityUser identityUser, MiniProgram miniProgram) + protected virtual async Task RemoveWeChatAppUserAsync(IdentityUser identityUser, WeChatApp miniProgram) { - var mpUserMapping = await _miniProgramUserRepository.GetAsync(x => - x.MiniProgramId == miniProgram.Id && x.UserId == identityUser.Id); + var mpUserMapping = await _weChatAppUserRepository.GetAsync(x => + x.WeChatAppId == miniProgram.Id && x.UserId == identityUser.Id); - await _miniProgramUserRepository.DeleteAsync(mpUserMapping, true); + await _weChatAppUserRepository.DeleteAsync(mpUserMapping, true); } protected virtual async Task TryCreateUserInfoAsync(IdentityUser identityUser, UserInfoModel userInfoModel) @@ -323,7 +321,7 @@ protected virtual async Task TryCreateUserInfoAsync(IdentityUser identityUser, U } } - protected virtual async Task RemoveUserInfoAsync(IdentityUser identityUser) + protected virtual async Task TryRemoveUserInfoAsync(IdentityUser identityUser) { var userInfo = await _userInfoRepository.FindAsync(x => x.UserId == identityUser.Id); @@ -384,7 +382,7 @@ protected virtual string GetTenantHeaderName() public virtual async Task GetPcLoginACodeAsync(string miniProgramName) { - var miniProgram = await _miniProgramRepository.GetAsync(x => x.Name == miniProgramName); + var miniProgram = await _weChatAppRepository.GetMiniProgramAppByNameAsync(miniProgramName); var options = new AbpWeChatMiniProgramOptions { @@ -424,17 +422,17 @@ public virtual async Task AuthorizePcAsync(AuthorizePcInput input) throw new PcLoginAuthorizeTooFrequentlyException(); } - var miniProgram = await _miniProgramRepository.GetAsync(x => x.AppId == input.AppId); + var miniProgram = await _weChatAppRepository.GetMiniProgramAppByAppIdAsync(input.AppId); - var miniProgramUser = await _miniProgramUserRepository.GetAsync(x => - x.MiniProgramId == miniProgram.Id && x.UserId == CurrentUser.GetId()); + var weChatAppUser = await _weChatAppUserRepository.GetAsync(x => + x.WeChatAppId == miniProgram.Id && x.UserId == CurrentUser.GetId()); await _pcLoginAuthorizationCache.SetAsync(input.Token, new MiniProgramPcLoginAuthorizationCacheItem { AppId = input.AppId, - UnionId = miniProgramUser.UnionId, - OpenId = miniProgramUser.OpenId, + UnionId = weChatAppUser.UnionId, + OpenId = weChatAppUser.OpenId, UserId = CurrentUser.GetId() }, new DistributedCacheEntryOptions diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/LoginResultInfoModel.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/LoginResultInfoModel.cs index bd6d8a6a..683a285c 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/LoginResultInfoModel.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/LoginResultInfoModel.cs @@ -1,12 +1,12 @@ using System; using EasyAbp.Abp.WeChat.MiniProgram.Services.Login; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; +using EasyAbp.WeChatManagement.Common.WeChatApps; namespace EasyAbp.WeChatManagement.MiniPrograms.Login { public record LoginResultInfoModel { - public MiniProgram MiniProgram { get; init; } + public WeChatApp MiniProgram { get; init; } public string LoginProvider { get; init; } diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WechatAccountHasBeenBoundException.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WeChatAccountHasBeenBoundException.cs similarity index 70% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WechatAccountHasBeenBoundException.cs rename to modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WeChatAccountHasBeenBoundException.cs index 78ba6196..9b0fa52b 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WechatAccountHasBeenBoundException.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WeChatAccountHasBeenBoundException.cs @@ -4,11 +4,11 @@ namespace EasyAbp.WeChatManagement.MiniPrograms.Login { - public class WechatAccountHasBeenBoundException : BusinessException + public class WeChatAccountHasBeenBoundException : BusinessException { - public WechatAccountHasBeenBoundException( + public WeChatAccountHasBeenBoundException( string message = null, - string code = "WechatAccountHasBeenBound", + string code = "WeChatAccountHasBeenBound", string details = null, Exception innerException = null, LogLevel logLevel = LogLevel.Warning) diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WechatAccountHasNotBeenBoundException.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WeChatAccountHasNotBeenBoundException.cs similarity index 69% rename from modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WechatAccountHasNotBeenBoundException.cs rename to modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WeChatAccountHasNotBeenBoundException.cs index 3e478aaf..91c580e9 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WechatAccountHasNotBeenBoundException.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/Login/WeChatAccountHasNotBeenBoundException.cs @@ -4,11 +4,11 @@ namespace EasyAbp.WeChatManagement.MiniPrograms.Login { - public class WechatAccountHasNotBeenBoundException : BusinessException + public class WeChatAccountHasNotBeenBoundException : BusinessException { - public WechatAccountHasNotBeenBoundException( + public WeChatAccountHasNotBeenBoundException( string message = null, - string code = "WechatAccountHasNotBeenBound", + string code = "WeChatAccountHasNotBeenBound", string details = null, Exception innerException = null, LogLevel logLevel = LogLevel.Warning) diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserAppService.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserAppService.cs deleted file mode 100644 index e8d4ccb6..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserAppService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.Permissions; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers.Dtos; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers -{ - public class MiniProgramUserAppService : ReadOnlyAppService, - IMiniProgramUserAppService - { - protected override string GetPolicyName { get; set; } = MiniProgramsPermissions.MiniProgramUser.Default; - protected override string GetListPolicyName { get; set; } = MiniProgramsPermissions.MiniProgramUser.Default; - - private readonly IMiniProgramUserRepository _repository; - - public MiniProgramUserAppService(IMiniProgramUserRepository repository) : base(repository) - { - _repository = repository; - } - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgramAppService.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgramAppService.cs deleted file mode 100644 index 90220559..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgramAppService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using EasyAbp.WeChatManagement.MiniPrograms.Permissions; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.Dtos; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms -{ - public class MiniProgramAppService : CrudAppService, - IMiniProgramAppService - { - protected override string GetPolicyName { get; set; } = MiniProgramsPermissions.MiniProgram.Default; - protected override string GetListPolicyName { get; set; } = MiniProgramsPermissions.MiniProgram.Default; - protected override string CreatePolicyName { get; set; } = MiniProgramsPermissions.MiniProgram.Create; - protected override string UpdatePolicyName { get; set; } = MiniProgramsPermissions.MiniProgram.Update; - protected override string DeletePolicyName { get; set; } = MiniProgramsPermissions.MiniProgram.Delete; - private readonly IMiniProgramRepository _repository; - - public MiniProgramAppService(IMiniProgramRepository repository) : base(repository) - { - _repository = repository; - } - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramsApplicationAutoMapperProfile.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramsApplicationAutoMapperProfile.cs index ff5a8d68..6982fbe4 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramsApplicationAutoMapperProfile.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramsApplicationAutoMapperProfile.cs @@ -1,11 +1,6 @@ -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.Dtos; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers.Dtos; -using EasyAbp.WeChatManagement.MiniPrograms.UserInfos; +using EasyAbp.WeChatManagement.MiniPrograms.UserInfos; using EasyAbp.WeChatManagement.MiniPrograms.UserInfos.Dtos; using AutoMapper; -using Volo.Abp.AutoMapper; namespace EasyAbp.WeChatManagement.MiniPrograms { @@ -16,10 +11,6 @@ public MiniProgramsApplicationAutoMapperProfile() /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap(); - CreateMap(MemberList.Source) - .Ignore(x => x.IsStatic); - CreateMap(); CreateMap(); } } diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsApplicationModule.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsApplicationModule.cs index b55509ad..da913cfe 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsApplicationModule.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Application/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsApplicationModule.cs @@ -2,6 +2,7 @@ using EasyAbp.Abp.WeChat; using EasyAbp.Abp.WeChat.MiniProgram; using EasyAbp.Abp.WeChat.MiniProgram.Infrastructure.OptionsResolve; +using EasyAbp.WeChatManagement.Common; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; @@ -14,7 +15,8 @@ namespace EasyAbp.WeChatManagement.MiniPrograms typeof(WeChatManagementMiniProgramsApplicationContractsModule), typeof(AbpDddApplicationModule), typeof(AbpAutoMapperModule), - typeof(AbpWeChatMiniProgramModule) + typeof(AbpWeChatMiniProgramModule), + typeof(WeChatManagementCommonApplicationModule) )] public class WeChatManagementMiniProgramsApplicationModule : AbpModule { diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/cs.json b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/cs.json deleted file mode 100644 index 34dd214e..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/cs.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "culture": "cs", - "texts": { - "ManageYourProfile": "Spravovat profil", - "Permission:MiniPrograms": "MiniProgramManagement", - "Permission:MiniProgram": "MiniProgram", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:EasyAbpWeChatManagement": "EasyAbpWeChatManagement", - "Menu:MiniProgramManagement": "MiniProgramManagement", - "Menu:MiniProgram": "MenuMiniProgram", - "ACodeGenerationFailed": "ACodeGenerationFailed", - "MiniProgram": "MiniProgram", - "MiniProgramWeChatComponentId": "MiniProgramWeChatComponentId", - "MiniProgramWeChatComponentIdPlaceHolder": "MiniProgramWeChatComponentIdPlaceHolder", - "MiniProgramName": "MiniProgramName", - "MiniProgramDisplayName": "MiniProgramDisplayName", - "MiniProgramOpenAppIdOrName": "MiniProgramOpenAppIdOrName", - "MiniProgramAppId": "MiniProgramAppId", - "MiniProgramAppSecret": "MiniProgramAppSecret", - "MiniProgramAppSecretPlaceHolder": "MiniProgramAppSecretPlaceHolder", - "MiniProgramToken": "MiniProgramToken", - "MiniProgramEncodingAesKey": "MiniProgramEncodingAesKey", - "MiniProgramIsStatic": "MiniProgramIsStatic", - "CreateMiniProgram": "CreateMiniProgram", - "EditMiniProgram": "EditMiniProgram", - "MiniProgramDeletionConfirmationMessage": "Are you sure to delete the miniProgram {0}?", - "SuccessfullyDeleted": "Successfully deleted", - "Permission:MiniProgramUser": "MiniProgramUser", - "Menu:MiniProgramUser": "MenuMiniProgramUser", - "MiniProgramUser": "MiniProgramUser", - "MiniProgramUserMiniProgramId": "MiniProgramUserMiniProgramId", - "MiniProgramUserUserId": "MiniProgramUserUserId", - "MiniProgramUserUnionId": "MiniProgramUserUnionId", - "MiniProgramUserOpenId": "MiniProgramUserOpenId", - "MiniProgramUserSessionKey": "MiniProgramUserSessionKey", - "MiniProgramUserSessionKeyChangedTime": "MiniProgramUserSessionKeyChangedTime", - "Permission:UserInfo": "UserInfo", - "Menu:UserInfo": "MenuUserInfo", - "UserInfo": "UserInfo", - "UserInfoUserId": "UserInfoUserId", - "UserInfoNickName": "UserInfoNickName", - "UserInfoGender": "UserInfoGender", - "UserInfoLanguage": "UserInfoLanguage", - "UserInfoCity": "UserInfoCity", - "UserInfoProvince": "UserInfoProvince", - "UserInfoCountry": "UserInfoCountry", - "UserInfoAvatarUrl": "UserInfoAvatarUrl", - "Setting:DefaultPcLoginMiniProgramName": "Setting:DefaultPcLoginMiniProgramName", - "WechatAccountHasBeenBound": "WechatAccountHasBeenBound" - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/en.json b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/en.json index cd5adff9..e9010251 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/en.json +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/en.json @@ -1,41 +1,9 @@ { "culture": "en", "texts": { - "ManageYourProfile": "Manage your profile", "Permission:MiniPrograms": "MiniProgramManagement", - "Permission:MiniProgram": "MiniProgram", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:EasyAbpWeChatManagement": "EasyAbpWeChatManagement", "Menu:MiniProgramManagement": "MiniProgramManagement", - "Menu:MiniProgram": "MenuMiniProgram", "ACodeGenerationFailed": "ACodeGenerationFailed", - "MiniProgram": "MiniProgram", - "MiniProgramWeChatComponentId": "MiniProgramWeChatComponentId", - "MiniProgramWeChatComponentIdPlaceHolder": "MiniProgramWeChatComponentIdPlaceHolder", - "MiniProgramName": "MiniProgramName", - "MiniProgramDisplayName": "MiniProgramDisplayName", - "MiniProgramOpenAppIdOrName": "MiniProgramOpenAppIdOrName", - "MiniProgramAppId": "MiniProgramAppId", - "MiniProgramAppSecret": "MiniProgramAppSecret", - "MiniProgramAppSecretPlaceHolder": "MiniProgramAppSecretPlaceHolder", - "MiniProgramToken": "MiniProgramToken", - "MiniProgramEncodingAesKey": "MiniProgramEncodingAesKey", - "MiniProgramIsStatic": "MiniProgramIsStatic", - "CreateMiniProgram": "CreateMiniProgram", - "EditMiniProgram": "EditMiniProgram", - "MiniProgramDeletionConfirmationMessage": "Are you sure to delete the miniProgram {0}?", - "SuccessfullyDeleted": "Successfully deleted", - "Permission:MiniProgramUser": "MiniProgramUser", - "Menu:MiniProgramUser": "MenuMiniProgramUser", - "MiniProgramUser": "MiniProgramUser", - "MiniProgramUserMiniProgramId": "MiniProgramUserMiniProgramId", - "MiniProgramUserUserId": "MiniProgramUserUserId", - "MiniProgramUserUnionId": "MiniProgramUserUnionId", - "MiniProgramUserOpenId": "MiniProgramUserOpenId", - "MiniProgramUserSessionKey": "MiniProgramUserSessionKey", - "MiniProgramUserSessionKeyChangedTime": "MiniProgramUserSessionKeyChangedTime", "Permission:UserInfo": "UserInfo", "Menu:UserInfo": "MenuUserInfo", "UserInfo": "UserInfo", @@ -47,7 +15,9 @@ "UserInfoProvince": "UserInfoProvince", "UserInfoCountry": "UserInfoCountry", "UserInfoAvatarUrl": "UserInfoAvatarUrl", - "Setting:DefaultPcLoginMiniProgramName": "Setting:DefaultPcLoginMiniProgramName", - "WechatAccountHasBeenBound": "WechatAccountHasBeenBound" + "Setting:PcLoginHandlePage": "Setting:PcLoginHandlePage", + "Setting:DefaultPcLoginWeChatAppName": "Setting:DefaultPcLoginWeChatAppName", + "WeChatAccountHasBeenBound": "WeChatAccountHasBeenBound", + "WeChatAccountHasNotBeenBound": "WeChatAccountHasNotBeenBound" } } \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/pl-PL.json b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/pl-PL.json deleted file mode 100644 index ac9bccfa..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/pl-PL.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "culture": "pl-PL", - "texts": { - "Permission:MiniPrograms": "MiniProgramManagement", - "Permission:MiniProgram": "MiniProgram", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:EasyAbpWeChatManagement": "EasyAbpWeChatManagement", - "Menu:MiniProgramManagement": "MiniProgramManagement", - "Menu:MiniProgram": "MenuMiniProgram", - "ACodeGenerationFailed": "ACodeGenerationFailed", - "MiniProgram": "MiniProgram", - "MiniProgramWeChatComponentId": "MiniProgramWeChatComponentId", - "MiniProgramWeChatComponentIdPlaceHolder": "MiniProgramWeChatComponentIdPlaceHolder", - "MiniProgramName": "MiniProgramName", - "MiniProgramDisplayName": "MiniProgramDisplayName", - "MiniProgramOpenAppIdOrName": "MiniProgramOpenAppIdOrName", - "MiniProgramAppId": "MiniProgramAppId", - "MiniProgramAppSecret": "MiniProgramAppSecret", - "MiniProgramAppSecretPlaceHolder": "MiniProgramAppSecretPlaceHolder", - "MiniProgramToken": "MiniProgramToken", - "MiniProgramEncodingAesKey": "MiniProgramEncodingAesKey", - "MiniProgramIsStatic": "MiniProgramIsStatic", - "CreateMiniProgram": "CreateMiniProgram", - "EditMiniProgram": "EditMiniProgram", - "MiniProgramDeletionConfirmationMessage": "Are you sure to delete the miniProgram {0}?", - "SuccessfullyDeleted": "Successfully deleted", - "Permission:MiniProgramUser": "MiniProgramUser", - "Menu:MiniProgramUser": "MenuMiniProgramUser", - "MiniProgramUser": "MiniProgramUser", - "MiniProgramUserMiniProgramId": "MiniProgramUserMiniProgramId", - "MiniProgramUserUserId": "MiniProgramUserUserId", - "MiniProgramUserUnionId": "MiniProgramUserUnionId", - "MiniProgramUserOpenId": "MiniProgramUserOpenId", - "MiniProgramUserSessionKey": "MiniProgramUserSessionKey", - "MiniProgramUserSessionKeyChangedTime": "MiniProgramUserSessionKeyChangedTime", - "Permission:UserInfo": "UserInfo", - "Menu:UserInfo": "MenuUserInfo", - "UserInfo": "UserInfo", - "UserInfoUserId": "UserInfoUserId", - "UserInfoNickName": "UserInfoNickName", - "UserInfoGender": "UserInfoGender", - "UserInfoLanguage": "UserInfoLanguage", - "UserInfoCity": "UserInfoCity", - "UserInfoProvince": "UserInfoProvince", - "UserInfoCountry": "UserInfoCountry", - "UserInfoAvatarUrl": "UserInfoAvatarUrl", - "Setting:DefaultPcLoginMiniProgramName": "Setting:DefaultPcLoginMiniProgramName", - "WechatAccountHasBeenBound": "WechatAccountHasBeenBound" - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/pt-BR.json b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/pt-BR.json deleted file mode 100644 index 9e11e942..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/pt-BR.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "culture": "pt-BR", - "texts": { - "Permission:MiniPrograms": "MiniProgramManagement", - "Permission:MiniProgram": "MiniProgram", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:EasyAbpWeChatManagement": "EasyAbpWeChatManagement", - "Menu:MiniProgramManagement": "MiniProgramManagement", - "Menu:MiniProgram": "MenuMiniProgram", - "ACodeGenerationFailed": "ACodeGenerationFailed", - "MiniProgram": "MiniProgram", - "MiniProgramWeChatComponentId": "MiniProgramWeChatComponentId", - "MiniProgramWeChatComponentIdPlaceHolder": "MiniProgramWeChatComponentIdPlaceHolder", - "MiniProgramName": "MiniProgramName", - "MiniProgramDisplayName": "MiniProgramDisplayName", - "MiniProgramOpenAppIdOrName": "MiniProgramOpenAppIdOrName", - "MiniProgramAppId": "MiniProgramAppId", - "MiniProgramAppSecret": "MiniProgramAppSecret", - "MiniProgramAppSecretPlaceHolder": "MiniProgramAppSecretPlaceHolder", - "MiniProgramToken": "MiniProgramToken", - "MiniProgramEncodingAesKey": "MiniProgramEncodingAesKey", - "MiniProgramIsStatic": "MiniProgramIsStatic", - "CreateMiniProgram": "CreateMiniProgram", - "EditMiniProgram": "EditMiniProgram", - "MiniProgramDeletionConfirmationMessage": "Are you sure to delete the miniProgram {0}?", - "SuccessfullyDeleted": "Successfully deleted", - "Permission:MiniProgramUser": "MiniProgramUser", - "Menu:MiniProgramUser": "MenuMiniProgramUser", - "MiniProgramUser": "MiniProgramUser", - "MiniProgramUserMiniProgramId": "MiniProgramUserMiniProgramId", - "MiniProgramUserUserId": "MiniProgramUserUserId", - "MiniProgramUserUnionId": "MiniProgramUserUnionId", - "MiniProgramUserOpenId": "MiniProgramUserOpenId", - "MiniProgramUserSessionKey": "MiniProgramUserSessionKey", - "MiniProgramUserSessionKeyChangedTime": "MiniProgramUserSessionKeyChangedTime", - "Permission:UserInfo": "UserInfo", - "Menu:UserInfo": "MenuUserInfo", - "UserInfo": "UserInfo", - "UserInfoUserId": "UserInfoUserId", - "UserInfoNickName": "UserInfoNickName", - "UserInfoGender": "UserInfoGender", - "UserInfoLanguage": "UserInfoLanguage", - "UserInfoCity": "UserInfoCity", - "UserInfoProvince": "UserInfoProvince", - "UserInfoCountry": "UserInfoCountry", - "UserInfoAvatarUrl": "UserInfoAvatarUrl", - "Setting:DefaultPcLoginMiniProgramName": "Setting:DefaultPcLoginMiniProgramName", - "WechatAccountHasBeenBound": "WechatAccountHasBeenBound" - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/sl.json b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/sl.json deleted file mode 100644 index ae92ab34..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/sl.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "culture": "sl", - "texts": { - "ManageYourProfile": "Upravljajte svojim profilom", - "Permission:MiniPrograms": "MiniProgramManagement", - "Permission:MiniProgram": "MiniProgram", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:EasyAbpWeChatManagement": "EasyAbpWeChatManagement", - "Menu:MiniProgramManagement": "MiniProgramManagement", - "Menu:MiniProgram": "MenuMiniProgram", - "ACodeGenerationFailed": "ACodeGenerationFailed", - "MiniProgram": "MiniProgram", - "MiniProgramWeChatComponentId": "MiniProgramWeChatComponentId", - "MiniProgramWeChatComponentIdPlaceHolder": "MiniProgramWeChatComponentIdPlaceHolder", - "MiniProgramName": "MiniProgramName", - "MiniProgramDisplayName": "MiniProgramDisplayName", - "MiniProgramOpenAppIdOrName": "MiniProgramOpenAppIdOrName", - "MiniProgramAppId": "MiniProgramAppId", - "MiniProgramAppSecret": "MiniProgramAppSecret", - "MiniProgramAppSecretPlaceHolder": "MiniProgramAppSecretPlaceHolder", - "MiniProgramToken": "MiniProgramToken", - "MiniProgramEncodingAesKey": "MiniProgramEncodingAesKey", - "MiniProgramIsStatic": "MiniProgramIsStatic", - "CreateMiniProgram": "CreateMiniProgram", - "EditMiniProgram": "EditMiniProgram", - "MiniProgramDeletionConfirmationMessage": "Are you sure to delete the miniProgram {0}?", - "SuccessfullyDeleted": "Successfully deleted", - "Permission:MiniProgramUser": "MiniProgramUser", - "Menu:MiniProgramUser": "MenuMiniProgramUser", - "MiniProgramUser": "MiniProgramUser", - "MiniProgramUserMiniProgramId": "MiniProgramUserMiniProgramId", - "MiniProgramUserUserId": "MiniProgramUserUserId", - "MiniProgramUserUnionId": "MiniProgramUserUnionId", - "MiniProgramUserOpenId": "MiniProgramUserOpenId", - "MiniProgramUserSessionKey": "MiniProgramUserSessionKey", - "MiniProgramUserSessionKeyChangedTime": "MiniProgramUserSessionKeyChangedTime", - "Permission:UserInfo": "UserInfo", - "Menu:UserInfo": "MenuUserInfo", - "UserInfo": "UserInfo", - "UserInfoUserId": "UserInfoUserId", - "UserInfoNickName": "UserInfoNickName", - "UserInfoGender": "UserInfoGender", - "UserInfoLanguage": "UserInfoLanguage", - "UserInfoCity": "UserInfoCity", - "UserInfoProvince": "UserInfoProvince", - "UserInfoCountry": "UserInfoCountry", - "UserInfoAvatarUrl": "UserInfoAvatarUrl", - "Setting:DefaultPcLoginMiniProgramName": "Setting:DefaultPcLoginMiniProgramName", - "WechatAccountHasBeenBound": "WechatAccountHasBeenBound" - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/tr.json b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/tr.json deleted file mode 100644 index 6b050c46..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/tr.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "culture": "tr", - "texts": { - "ManageYourProfile": "Profil y�netimi", - "Permission:MiniPrograms": "MiniProgramManagement", - "Permission:MiniProgram": "MiniProgram", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:EasyAbpWeChatManagement": "EasyAbpWeChatManagement", - "Menu:MiniProgramManagement": "MiniProgramManagement", - "Menu:MiniProgram": "MenuMiniProgram", - "ACodeGenerationFailed": "ACodeGenerationFailed", - "MiniProgram": "MiniProgram", - "MiniProgramWeChatComponentId": "MiniProgramWeChatComponentId", - "MiniProgramWeChatComponentIdPlaceHolder": "MiniProgramWeChatComponentIdPlaceHolder", - "MiniProgramName": "MiniProgramName", - "MiniProgramDisplayName": "MiniProgramDisplayName", - "MiniProgramOpenAppIdOrName": "MiniProgramOpenAppIdOrName", - "MiniProgramAppId": "MiniProgramAppId", - "MiniProgramAppSecret": "MiniProgramAppSecret", - "MiniProgramAppSecretPlaceHolder": "MiniProgramAppSecretPlaceHolder", - "MiniProgramToken": "MiniProgramToken", - "MiniProgramEncodingAesKey": "MiniProgramEncodingAesKey", - "MiniProgramIsStatic": "MiniProgramIsStatic", - "CreateMiniProgram": "CreateMiniProgram", - "EditMiniProgram": "EditMiniProgram", - "MiniProgramDeletionConfirmationMessage": "Are you sure to delete the miniProgram {0}?", - "SuccessfullyDeleted": "Successfully deleted", - "Permission:MiniProgramUser": "MiniProgramUser", - "Menu:MiniProgramUser": "MenuMiniProgramUser", - "MiniProgramUser": "MiniProgramUser", - "MiniProgramUserMiniProgramId": "MiniProgramUserMiniProgramId", - "MiniProgramUserUserId": "MiniProgramUserUserId", - "MiniProgramUserUnionId": "MiniProgramUserUnionId", - "MiniProgramUserOpenId": "MiniProgramUserOpenId", - "MiniProgramUserSessionKey": "MiniProgramUserSessionKey", - "MiniProgramUserSessionKeyChangedTime": "MiniProgramUserSessionKeyChangedTime", - "Permission:UserInfo": "UserInfo", - "Menu:UserInfo": "MenuUserInfo", - "UserInfo": "UserInfo", - "UserInfoUserId": "UserInfoUserId", - "UserInfoNickName": "UserInfoNickName", - "UserInfoGender": "UserInfoGender", - "UserInfoLanguage": "UserInfoLanguage", - "UserInfoCity": "UserInfoCity", - "UserInfoProvince": "UserInfoProvince", - "UserInfoCountry": "UserInfoCountry", - "UserInfoAvatarUrl": "UserInfoAvatarUrl", - "Setting:DefaultPcLoginMiniProgramName": "Setting:DefaultPcLoginMiniProgramName", - "WechatAccountHasBeenBound": "WechatAccountHasBeenBound" - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/vi.json b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/vi.json deleted file mode 100644 index 7e3450ce..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/vi.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "culture": "vi", - "texts": { - "Permission:MiniPrograms": "MiniProgramManagement", - "Permission:MiniProgram": "MiniProgram", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:EasyAbpWeChatManagement": "EasyAbpWeChatManagement", - "Menu:MiniProgramManagement": "MiniProgramManagement", - "Menu:MiniProgram": "MenuMiniProgram", - "ACodeGenerationFailed": "ACodeGenerationFailed", - "MiniProgram": "MiniProgram", - "MiniProgramWeChatComponentId": "MiniProgramWeChatComponentId", - "MiniProgramWeChatComponentIdPlaceHolder": "MiniProgramWeChatComponentIdPlaceHolder", - "MiniProgramName": "MiniProgramName", - "MiniProgramDisplayName": "MiniProgramDisplayName", - "MiniProgramOpenAppIdOrName": "MiniProgramOpenAppIdOrName", - "MiniProgramAppId": "MiniProgramAppId", - "MiniProgramAppSecret": "MiniProgramAppSecret", - "MiniProgramAppSecretPlaceHolder": "MiniProgramAppSecretPlaceHolder", - "MiniProgramToken": "MiniProgramToken", - "MiniProgramEncodingAesKey": "MiniProgramEncodingAesKey", - "MiniProgramIsStatic": "MiniProgramIsStatic", - "CreateMiniProgram": "CreateMiniProgram", - "EditMiniProgram": "EditMiniProgram", - "MiniProgramDeletionConfirmationMessage": "Are you sure to delete the miniProgram {0}?", - "SuccessfullyDeleted": "Successfully deleted", - "Permission:MiniProgramUser": "MiniProgramUser", - "Menu:MiniProgramUser": "MenuMiniProgramUser", - "MiniProgramUser": "MiniProgramUser", - "MiniProgramUserMiniProgramId": "MiniProgramUserMiniProgramId", - "MiniProgramUserUserId": "MiniProgramUserUserId", - "MiniProgramUserUnionId": "MiniProgramUserUnionId", - "MiniProgramUserOpenId": "MiniProgramUserOpenId", - "MiniProgramUserSessionKey": "MiniProgramUserSessionKey", - "MiniProgramUserSessionKeyChangedTime": "MiniProgramUserSessionKeyChangedTime", - "Permission:UserInfo": "UserInfo", - "Menu:UserInfo": "MenuUserInfo", - "UserInfo": "UserInfo", - "UserInfoUserId": "UserInfoUserId", - "UserInfoNickName": "UserInfoNickName", - "UserInfoGender": "UserInfoGender", - "UserInfoLanguage": "UserInfoLanguage", - "UserInfoCity": "UserInfoCity", - "UserInfoProvince": "UserInfoProvince", - "UserInfoCountry": "UserInfoCountry", - "UserInfoAvatarUrl": "UserInfoAvatarUrl", - "Setting:DefaultPcLoginMiniProgramName": "Setting:DefaultPcLoginMiniProgramName", - "WechatAccountHasBeenBound": "WechatAccountHasBeenBound" - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/zh-Hans.json b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/zh-Hans.json index 96f14366..51872706 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/zh-Hans.json +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/zh-Hans.json @@ -1,41 +1,9 @@ { "culture": "zh-Hans", "texts": { - "ManageYourProfile": "管理个人资料", "Permission:MiniPrograms": "小程序管理", - "Permission:MiniProgram": "小程序", - "Permission:Create": "新建", - "Permission:Update": "编辑", - "Permission:Delete": "删除", - "Menu:EasyAbpWeChatManagement": "微信管理", "Menu:MiniProgramManagement": "小程序管理", - "Menu:MiniProgram": "小程序", "ACodeGenerationFailed": "小程序码生成失败", - "MiniProgram": "小程序", - "MiniProgramWeChatComponentId": "微信第三方平台 ID", - "MiniProgramWeChatComponentIdPlaceHolder": "通过微信第三方平台管理则必填", - "MiniProgramName": "内置名称", - "MiniProgramDisplayName": "展示名称", - "MiniProgramOpenAppIdOrName": "开放平台 AppId (或名称)", - "MiniProgramAppId": "AppId", - "MiniProgramAppSecret": "AppSecret", - "MiniProgramAppSecretPlaceHolder": "留空则通过第三方平台管理", - "MiniProgramToken": "Token", - "MiniProgramEncodingAesKey": "EncodingAesKey", - "MiniProgramIsStatic": "是否静态", - "CreateMiniProgram": "新建", - "EditMiniProgram": "编辑", - "MiniProgramDeletionConfirmationMessage": "确认删除小程序 {0}?", - "SuccessfullyDeleted": "删除成功", - "Permission:MiniProgramUser": "用户机密", - "Menu:MiniProgramUser": "用户机密", - "MiniProgramUser": "用户机密", - "MiniProgramUserMiniProgramId": "小程序 ID", - "MiniProgramUserUserId": "用户 ID", - "MiniProgramUserUnionId": "UnionId", - "MiniProgramUserOpenId": "OpenId", - "MiniProgramUserSessionKey": "SessionKey", - "MiniProgramUserSessionKeyChangedTime": "SessionKey 更新时间", "Permission:UserInfo": "用户个人信息", "Menu:UserInfo": "用户个人信息", "UserInfo": "用户个人信息", @@ -47,7 +15,9 @@ "UserInfoProvince": "省份", "UserInfoCountry": "国家", "UserInfoAvatarUrl": "头像图片", - "WechatAccountHasBeenBound": "您的微信已被其他用户绑定", - "WechatAccountHasNotBeenBound": "您的微信尚未绑定" + "Setting:PcLoginHandlePage": "PC 登录处理页面", + "Setting:DefaultPcLoginWeChatAppName": "PC 登录默认微信应用名", + "WeChatAccountHasBeenBound": "您的微信已被其他用户绑定", + "WeChatAccountHasNotBeenBound": "您的微信尚未绑定" } } \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/zh-Hant.json b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/zh-Hant.json index 92c029be..1ec1947e 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/zh-Hant.json +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared/EasyAbp/WeChatManagement/MiniPrograms/Localization/zh-Hant.json @@ -1,41 +1,9 @@ { "culture": "zh-Hant", "texts": { - "ManageYourProfile": "管理個人資料", "Permission:MiniPrograms": "小程序管理", - "Permission:MiniProgram": "小程序", - "Permission:Create": "新建", - "Permission:Update": "編輯", - "Permission:Delete": "刪除", - "Menu:EasyAbpWeChatManagement": "微信管理", "Menu:MiniProgramManagement": "小程序管理", - "Menu:MiniProgram": "小程序", "ACodeGenerationFailed": "小程式碼生成失敗", - "MiniProgram": "小程序", - "MiniProgramWeChatComponentId": "微信第三方平台 ID", - "MiniProgramWeChatComponentIdPlaceHolder": "通過微信第三方平台管理則必填", - "MiniProgramName": "內置名稱", - "MiniProgramDisplayName": "展示名稱", - "MiniProgramOpenAppIdOrName": "開放平台 AppId (或名稱)", - "MiniProgramAppId": "AppId", - "MiniProgramAppSecret": "AppSecret", - "MiniProgramAppSecretPlaceHolder": "留空則通過第三方平台管理", - "MiniProgramToken": "Token", - "MiniProgramEncodingAesKey": "EncodingAesKey", - "MiniProgramIsStatic": "是否靜態", - "CreateMiniProgram": "新建", - "EditMiniProgram": "編輯", - "MiniProgramDeletionConfirmationMessage": "確認刪除小程序 {0}?", - "SuccessfullyDeleted": "刪除成功", - "Permission:MiniProgramUser": "用戶機密", - "Menu:MiniProgramUser": "用戶機密", - "MiniProgramUser": "用戶機密", - "MiniProgramUserMiniProgramId": "小程序 ID", - "MiniProgramUserUserId": "用戶 ID", - "MiniProgramUserUnionId": "UnionId", - "MiniProgramUserOpenId": "OpenId", - "MiniProgramUserSessionKey": "SessionKey", - "MiniProgramUserSessionKeyChangedTime": "SessionKey 更新時間", "Permission:UserInfo": "用戶個人信息", "Menu:UserInfo": "用戶個人信息", "UserInfo": "用戶個人信息", @@ -47,6 +15,9 @@ "UserInfoProvince": "省份", "UserInfoCountry": "國家", "UserInfoAvatarUrl": "頭像圖片", - "WechatAccountHasBeenBound": "您的微信已被其他用戶綁定" + "Setting:PcLoginHandlePage": "PC 登錄處理頁面", + "Setting:DefaultPcLoginWeChatAppName": "PC 登錄默認微信應用名", + "WeChatAccountHasBeenBound": "您的微信已被其他用戶綁定", + "WeChatAccountHasNotBeenBound": "您的微信尚未綁定" } } \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp.WeChatManagement.MiniPrograms.Domain.csproj b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp.WeChatManagement.MiniPrograms.Domain.csproj index 0d69aa9d..285386bd 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp.WeChatManagement.MiniPrograms.Domain.csproj +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp.WeChatManagement.MiniPrograms.Domain.csproj @@ -10,6 +10,7 @@ + diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppRepositoryExtensions.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppRepositoryExtensions.cs new file mode 100644 index 00000000..adf3d037 --- /dev/null +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/Common/WeChatApps/WeChatAppRepositoryExtensions.cs @@ -0,0 +1,43 @@ +using System; +using System.Threading.Tasks; +using JetBrains.Annotations; + +namespace EasyAbp.WeChatManagement.Common.WeChatApps +{ + public static class WeChatAppRepositoryExtensions + { + public static Task GetMiniProgramAppAsync(this IWeChatAppRepository weChatAppRepository, Guid id) + { + return weChatAppRepository.GetAsync(x => x.Id == id && x.Type == WeChatAppType.MiniProgram); + } + + public static Task GetMiniProgramAppByAppIdAsync(this IWeChatAppRepository weChatAppRepository, + [NotNull] string appId) + { + return weChatAppRepository.GetAsync(x => x.AppId == appId && x.Type == WeChatAppType.MiniProgram); + } + + public static Task GetMiniProgramAppByNameAsync(this IWeChatAppRepository weChatAppRepository, + [NotNull] string name) + { + return weChatAppRepository.GetAsync(x => x.Name == name && x.Type == WeChatAppType.MiniProgram); + } + + public static Task FindMiniProgramAppAsync(this IWeChatAppRepository weChatAppRepository, Guid id) + { + return weChatAppRepository.FindAsync(x => x.Id == id && x.Type == WeChatAppType.MiniProgram); + } + + public static Task FindMiniProgramAppByAppIdAsync(this IWeChatAppRepository weChatAppRepository, + [NotNull] string appId) + { + return weChatAppRepository.FindAsync(x => x.AppId == appId && x.Type == WeChatAppType.MiniProgram); + } + + public static Task FindMiniProgramAppByNameAsync(this IWeChatAppRepository weChatAppRepository, + [NotNull] string name) + { + return weChatAppRepository.FindAsync(x => x.Name == name && x.Type == WeChatAppType.MiniProgram); + } + } +} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/IMiniProgramLoginProviderProvider.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/IMiniProgramLoginProviderProvider.cs index 79830af2..64d91ff8 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/IMiniProgramLoginProviderProvider.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/IMiniProgramLoginProviderProvider.cs @@ -1,5 +1,5 @@ using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; +using EasyAbp.WeChatManagement.Common.WeChatApps; namespace EasyAbp.WeChatManagement.MiniPrograms { @@ -8,8 +8,8 @@ public interface IMiniProgramLoginProviderProvider string WeChatAppLoginProviderPrefix { get; } string WeChatOpenLoginProviderPrefix { get; } - Task GetAppLoginProviderAsync(MiniProgram miniProgram); + Task GetAppLoginProviderAsync(WeChatApp miniProgram); - Task GetOpenLoginProviderAsync(MiniProgram miniProgram); + Task GetOpenLoginProviderAsync(WeChatApp miniProgram); } } \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramLoginProviderProvider.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramLoginProviderProvider.cs index 3be7e138..3010cd14 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramLoginProviderProvider.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramLoginProviderProvider.cs @@ -1,5 +1,5 @@ using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; +using EasyAbp.WeChatManagement.Common.WeChatApps; using Volo.Abp; using Volo.Abp.DependencyInjection; @@ -10,14 +10,14 @@ public class MiniProgramLoginProviderProvider : IMiniProgramLoginProviderProvide public virtual string WeChatAppLoginProviderPrefix { get; } = "WeChatApp:"; public virtual string WeChatOpenLoginProviderPrefix { get; } = "WeChatOpen:"; - public virtual Task GetAppLoginProviderAsync(MiniProgram miniProgram) + public virtual Task GetAppLoginProviderAsync(WeChatApp miniProgram) { Check.NotNullOrWhiteSpace(miniProgram.AppId, nameof(miniProgram.AppId)); return Task.FromResult(WeChatAppLoginProviderPrefix + miniProgram.AppId); } - public virtual Task GetOpenLoginProviderAsync(MiniProgram miniProgram) + public virtual Task GetOpenLoginProviderAsync(WeChatApp miniProgram) { Check.NotNullOrWhiteSpace(miniProgram.OpenAppIdOrName, nameof(miniProgram.OpenAppIdOrName)); diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/IMiniProgramUserRepository.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/IMiniProgramUserRepository.cs deleted file mode 100644 index 1e0f27f1..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/IMiniProgramUserRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers -{ - public interface IMiniProgramUserRepository : IRepository - { - Task FindUnionIdByOpenIdAsync(Guid miniProgramId, string openId, CancellationToken cancellationToken = default); - - Task FindRecentlyTenantIdAsync(string appId, string openId, bool exceptHost, CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/IMiniProgramUserStore.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/IMiniProgramUserStore.cs deleted file mode 100644 index 409d8454..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/IMiniProgramUserStore.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers -{ - public interface IMiniProgramUserStore - { - - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/IMiniProgramRepository.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/IMiniProgramRepository.cs deleted file mode 100644 index 80ed0807..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/IMiniProgramRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using Volo.Abp.Domain.Repositories; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms -{ - public interface IMiniProgramRepository : IRepository - { - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/Settings/MiniProgramsSettingDefinitionProvider.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/Settings/MiniProgramsSettingDefinitionProvider.cs index f62dbf10..b963719d 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/Settings/MiniProgramsSettingDefinitionProvider.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/Settings/MiniProgramsSettingDefinitionProvider.cs @@ -15,14 +15,14 @@ public override void Define(ISettingDefinitionContext context) context.Add(new SettingDefinition( MiniProgramsSettings.PcLogin.DefaultProgramName, "Default", - L("Setting:DefaultPcLoginMiniProgramName"), + L("Setting:DefaultPcLoginWeChatAppName"), isVisibleToClients: true )); context.Add(new SettingDefinition( MiniProgramsSettings.PcLogin.HandlePage, null, - L("Setting:HandlePage"), + L("Setting:PcLoginHandlePage"), isVisibleToClients: true )); } diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsDomainModule.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsDomainModule.cs index 29aa0721..cd31a5d5 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsDomainModule.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsDomainModule.cs @@ -1,6 +1,5 @@ -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; +using EasyAbp.WeChatManagement.Common; using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.IdentityServer; using Volo.Abp.Modularity; @@ -8,17 +7,13 @@ namespace EasyAbp.WeChatManagement.MiniPrograms { [DependsOn( typeof(AbpIdentityServerDomainModule), - typeof(WeChatManagementMiniProgramsDomainSharedModule) - )] + typeof(WeChatManagementMiniProgramsDomainSharedModule), + typeof(WeChatManagementCommonDomainModule) + )] public class WeChatManagementMiniProgramsDomainModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { - Configure(options => - { - options.AutoEventSelectors.Add(); - }); - context.Services.PreConfigure(builder => { builder.AddExtensionGrantValidator(); diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/WeChatMiniProgramGrantValidator.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/WeChatMiniProgramGrantValidator.cs index f4ed1d30..5219dd93 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/WeChatMiniProgramGrantValidator.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Domain/EasyAbp/WeChatManagement/MiniPrograms/WeChatMiniProgramGrantValidator.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; +using EasyAbp.WeChatManagement.Common.WeChatApps; using IdentityServer4.Models; using IdentityServer4.Validation; using Microsoft.AspNetCore.Identity; @@ -19,18 +19,18 @@ public class WeChatMiniProgramGrantValidator : IExtensionGrantValidator, ITransi public string GrantType => WeChatMiniProgramConsts.GrantType; private readonly IMiniProgramLoginProviderProvider _miniProgramLoginProviderProvider; - private readonly IMiniProgramRepository _miniProgramRepository; + private readonly IWeChatAppRepository _weChatAppRepository; private readonly IOptions _identityOptions; private readonly IdentityUserManager _identityUserManager; public WeChatMiniProgramGrantValidator( IMiniProgramLoginProviderProvider miniProgramLoginProviderProvider, - IMiniProgramRepository miniProgramRepository, + IWeChatAppRepository weChatAppRepository, IOptions identityOptions, IdentityUserManager identityUserManager) { _miniProgramLoginProviderProvider = miniProgramLoginProviderProvider; - _miniProgramRepository = miniProgramRepository; + _weChatAppRepository = weChatAppRepository; _identityOptions = identityOptions; _identityUserManager = identityUserManager; } @@ -63,7 +63,7 @@ public virtual async Task ValidateAsync(ExtensionGrantValidationContext context) return; } - var miniProgram = await _miniProgramRepository.GetAsync(x => x.AppId == appId); + var miniProgram = await _weChatAppRepository.GetMiniProgramAppByAppIdAsync(appId); string loginProvider; string providerKey; diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.csproj b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.csproj index 674a0eea..beec324e 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.csproj +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.csproj @@ -10,6 +10,7 @@ + diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/IMiniProgramsDbContext.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/IMiniProgramsDbContext.cs index 373157f9..5abcb043 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/IMiniProgramsDbContext.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/IMiniProgramsDbContext.cs @@ -1,8 +1,6 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers; using EasyAbp.WeChatManagement.MiniPrograms.UserInfos; namespace EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore @@ -13,8 +11,6 @@ public interface IMiniProgramsDbContext : IEfCoreDbContext /* Add DbSet for each Aggregate Root here. Example: * DbSet Questions { get; } */ - DbSet MiniPrograms { get; set; } - DbSet MiniProgramUsers { get; set; } DbSet UserInfos { get; set; } } } diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/MiniProgramsDbContext.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/MiniProgramsDbContext.cs index 1870311a..2d146d14 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/MiniProgramsDbContext.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/MiniProgramsDbContext.cs @@ -1,8 +1,6 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers; using EasyAbp.WeChatManagement.MiniPrograms.UserInfos; namespace EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore @@ -13,8 +11,7 @@ public class MiniProgramsDbContext : AbpDbContext, IMiniP /* Add DbSet for each Aggregate Root here. Example: * public DbSet Questions { get; set; } */ - public DbSet MiniPrograms { get; set; } - public DbSet MiniProgramUsers { get; set; } + public DbSet UserInfos { get; set; } public MiniProgramsDbContext(DbContextOptions options) diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/MiniProgramsDbContextModelCreatingExtensions.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/MiniProgramsDbContextModelCreatingExtensions.cs index b1e8cc19..ffb145ea 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/MiniProgramsDbContextModelCreatingExtensions.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/MiniProgramsDbContextModelCreatingExtensions.cs @@ -1,6 +1,4 @@ using EasyAbp.WeChatManagement.MiniPrograms.UserInfos; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; using System; using Microsoft.EntityFrameworkCore; using Volo.Abp; @@ -43,25 +41,6 @@ public static class MiniProgramsDbContextModelCreatingExtensions }); */ - - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "MiniPrograms", options.Schema); - b.ConfigureByConvention(); - - /* Configure more properties here */ - }); - - - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "MiniProgramUsers", options.Schema); - b.ConfigureByConvention(); - - /* Configure more properties here */ - }); - - builder.Entity(b => { b.ToTable(options.TablePrefix + "UserInfos", options.Schema); diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/WeChatManagementMiniProgramsEntityFrameworkCoreModule.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/WeChatManagementMiniProgramsEntityFrameworkCoreModule.cs index 17236128..a688ce2c 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/WeChatManagementMiniProgramsEntityFrameworkCoreModule.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/EntityFrameworkCore/WeChatManagementMiniProgramsEntityFrameworkCoreModule.cs @@ -1,6 +1,5 @@ +using EasyAbp.WeChatManagement.Common.EntityFrameworkCore; using EasyAbp.WeChatManagement.MiniPrograms.UserInfos; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Identity.EntityFrameworkCore; @@ -11,7 +10,8 @@ namespace EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore [DependsOn( typeof(WeChatManagementMiniProgramsDomainModule), typeof(AbpEntityFrameworkCoreModule), - typeof(AbpIdentityEntityFrameworkCoreModule) + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(WeChatManagementCommonEntityFrameworkCoreModule) )] public class WeChatManagementMiniProgramsEntityFrameworkCoreModule : AbpModule { @@ -22,8 +22,6 @@ public override void ConfigureServices(ServiceConfigurationContext context) /* Add custom repositories here. Example: * options.AddRepository(); */ - options.AddRepository(); - options.AddRepository(); options.AddRepository(); }); } diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserRepository.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserRepository.cs deleted file mode 100644 index 428e0457..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserRepository.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers -{ - public class MiniProgramUserRepository : EfCoreRepository, IMiniProgramUserRepository - { - public MiniProgramUserRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } - - public virtual async Task FindUnionIdByOpenIdAsync(Guid miniProgramId, string openId, CancellationToken cancellationToken = default) - { - return await (await GetQueryableAsync()).Where(x => x.OpenId == openId && x.MiniProgramId == miniProgramId) - .Select(x => x.UnionId).FirstOrDefaultAsync(cancellationToken: cancellationToken); - } - - public async Task FindRecentlyTenantIdAsync(string appId, string openId, bool exceptHost, CancellationToken cancellationToken = default) - { - return await (await GetQueryableAsync()) - .Join((await GetDbContextAsync()).MiniPrograms, mpUser => mpUser.MiniProgramId, miniProgram => miniProgram.Id, - (mpUser, miniProgram) => new {MpUser = mpUser, MiniProgram = miniProgram}) - .Where(x => x.MpUser.OpenId == openId) - .Where(x => x.MiniProgram.AppId == appId) - .WhereIf(exceptHost, x => x.MiniProgram.TenantId.HasValue) - .OrderBy(x => x.MpUser.LastModificationTime == null) - .ThenByDescending(x => x.MpUser.LastModificationTime) - .Select(x => x.MpUser.TenantId) - .FirstOrDefaultAsync(cancellationToken); - } - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/DuplicateMiniProgramException.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/DuplicateMiniProgramException.cs deleted file mode 100644 index 256e1e67..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/DuplicateMiniProgramException.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Volo.Abp; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms -{ - public class DuplicateMiniProgramException : BusinessException - { - public DuplicateMiniProgramException() : base("DuplicateMiniProgram", "重复的小程序") - { - - } - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.csproj b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.csproj index de618342..b0297b9c 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.csproj +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.csproj @@ -9,6 +9,7 @@ + diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsHttpApiClientModule.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsHttpApiClientModule.cs index 814426af..2daf6f1d 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsHttpApiClientModule.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsHttpApiClientModule.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using EasyAbp.WeChatManagement.Common; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Http.Client; using Volo.Abp.Modularity; @@ -6,7 +7,9 @@ namespace EasyAbp.WeChatManagement.MiniPrograms { [DependsOn( typeof(WeChatManagementMiniProgramsApplicationContractsModule), - typeof(AbpHttpClientModule))] + typeof(AbpHttpClientModule), + typeof(WeChatManagementCommonHttpApiClientModule) + )] public class WeChatManagementMiniProgramsHttpApiClientModule : AbpModule { public const string RemoteServiceName = "EasyAbpWeChatManagementMiniPrograms"; diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.csproj b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.csproj index f5118c47..317064e3 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.csproj +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.csproj @@ -9,6 +9,7 @@ + diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserController.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserController.cs deleted file mode 100644 index ad26412c..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUserController.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers.Dtos; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers -{ - [RemoteService(Name = "EasyAbpWeChatManagementMiniPrograms")] - [Route("/api/wechat-management/mini-programs/mini-program-user")] - public class MiniProgramUserController : MiniProgramsController, IMiniProgramUserAppService - { - private readonly IMiniProgramUserAppService _service; - - public MiniProgramUserController(IMiniProgramUserAppService service) - { - _service = service; - } - - [HttpGet] - [Route("{id}")] - public Task GetAsync(Guid id) - { - return _service.GetAsync(id); - } - - [HttpGet] - public Task> GetListAsync(PagedAndSortedResultRequestDto input) - { - return _service.GetListAsync(input); - } - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgramController.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgramController.cs deleted file mode 100644 index 36e80865..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgramController.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.Dtos; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms -{ - [RemoteService(Name = "EasyAbpWeChatManagementMiniPrograms")] - [Route("/api/wechat-management/mini-programs/mini-program")] - public class MiniProgramController : MiniProgramsController, IMiniProgramAppService - { - private readonly IMiniProgramAppService _service; - - public MiniProgramController(IMiniProgramAppService service) - { - _service = service; - } - - [HttpGet] - [Route("{id}")] - public Task GetAsync(Guid id) - { - return _service.GetAsync(id); - } - - [HttpGet] - public Task> GetListAsync(PagedAndSortedResultRequestDto input) - { - return _service.GetListAsync(input); - } - - [HttpPost] - public Task CreateAsync(CreateUpdateMiniProgramDto input) - { - return _service.CreateAsync(input); - } - - [HttpPut] - [Route("{id}")] - public Task UpdateAsync(Guid id, CreateUpdateMiniProgramDto input) - { - return _service.UpdateAsync(id, input); - } - - [HttpDelete] - [Route("{id}")] - public Task DeleteAsync(Guid id) - { - return _service.DeleteAsync(id); - } - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsHttpApiModule.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsHttpApiModule.cs index 1026e2d6..77a74d05 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsHttpApiModule.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.HttpApi/EasyAbp/WeChatManagement/MiniPrograms/WeChatManagementMiniProgramsHttpApiModule.cs @@ -1,4 +1,5 @@ -using Localization.Resources.AbpUi; +using EasyAbp.WeChatManagement.Common; +using Localization.Resources.AbpUi; using EasyAbp.WeChatManagement.MiniPrograms.Localization; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Localization; @@ -9,7 +10,9 @@ namespace EasyAbp.WeChatManagement.MiniPrograms { [DependsOn( typeof(WeChatManagementMiniProgramsApplicationContractsModule), - typeof(AbpAspNetCoreMvcModule))] + typeof(AbpAspNetCoreMvcModule), + typeof(WeChatManagementCommonHttpApiModule) + )] public class WeChatManagementMiniProgramsHttpApiModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.MongoDB/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.csproj b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.MongoDB/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.csproj index 723e577e..fda1ca3e 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.MongoDB/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.csproj +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.MongoDB/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.csproj @@ -9,6 +9,7 @@ + diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.MongoDB/EasyAbp/WeChatManagement/MiniPrograms/MongoDB/WeChatManagementMiniProgramsMongoDbModule.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.MongoDB/EasyAbp/WeChatManagement/MiniPrograms/MongoDB/WeChatManagementMiniProgramsMongoDbModule.cs index c3183e3a..86433533 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.MongoDB/EasyAbp/WeChatManagement/MiniPrograms/MongoDB/WeChatManagementMiniProgramsMongoDbModule.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.MongoDB/EasyAbp/WeChatManagement/MiniPrograms/MongoDB/WeChatManagementMiniProgramsMongoDbModule.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.DependencyInjection; +using EasyAbp.WeChatManagement.Common; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; using Volo.Abp.MongoDB; @@ -6,8 +7,9 @@ namespace EasyAbp.WeChatManagement.MiniPrograms.MongoDB { [DependsOn( typeof(WeChatManagementMiniProgramsDomainModule), - typeof(AbpMongoDbModule) - )] + typeof(AbpMongoDbModule), + typeof(WeChatManagementCommonDomainModule) + )] public class WeChatManagementMiniProgramsMongoDbModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/EasyAbp.WeChatManagement.MiniPrograms.Web.csproj b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/EasyAbp.WeChatManagement.MiniPrograms.Web.csproj index d07d8530..69215bae 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/EasyAbp.WeChatManagement.MiniPrograms.Web.csproj +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/EasyAbp.WeChatManagement.MiniPrograms.Web.csproj @@ -17,6 +17,7 @@ + diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Menus/MiniProgramsMenuContributor.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Menus/MiniProgramsMenuContributor.cs index b2c9a477..336a6c46 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Menus/MiniProgramsMenuContributor.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Menus/MiniProgramsMenuContributor.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Threading.Tasks; +using EasyAbp.WeChatManagement.Common.Web.Menus; using EasyAbp.WeChatManagement.MiniPrograms.Localization; using EasyAbp.WeChatManagement.MiniPrograms.Permissions; using Volo.Abp.UI.Navigation; @@ -12,28 +13,16 @@ public async Task ConfigureMenuAsync(MenuConfigurationContext context) { if (context.Menu.Name == StandardMenus.Main) { - await ConfigureMainMenu(context); + await ConfigureMainMenuAsync(context); } } - private async Task ConfigureMainMenu(MenuConfigurationContext context) + private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) { var l = context.GetLocalizer(); //Add main menu items. var miniProgramManagementMenuItem = new ApplicationMenuItem(MiniProgramsMenus.Prefix, l["Menu:MiniProgramManagement"]); - - if (await context.IsGrantedAsync(MiniProgramsPermissions.MiniProgram.Default)) - { - miniProgramManagementMenuItem.AddItem( - new ApplicationMenuItem(MiniProgramsMenus.MiniProgram, l["Menu:MiniProgram"], "/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram") - ); - } - if (await context.IsGrantedAsync(MiniProgramsPermissions.MiniProgramUser.Default)) - { - miniProgramManagementMenuItem.AddItem( - new ApplicationMenuItem(MiniProgramsMenus.MiniProgramUser, l["Menu:MiniProgramUser"], "/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser") - ); - } + if (await context.IsGrantedAsync(MiniProgramsPermissions.UserInfo.Default)) { miniProgramManagementMenuItem.AddItem( @@ -43,7 +32,7 @@ private async Task ConfigureMainMenu(MenuConfigurationContext context) if (!miniProgramManagementMenuItem.Items.IsNullOrEmpty()) { - var weChatManagementMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == MiniProgramsMenus.ModuleGroupPrefix, + var weChatManagementMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == CommonMenus.Prefix, () => new ApplicationMenuItem("EasyAbpWeChatManagement", l["Menu:EasyAbpWeChatManagement"])); weChatManagementMenuItem.Items.Add(miniProgramManagementMenuItem); diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Menus/MiniProgramsMenus.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Menus/MiniProgramsMenus.cs index 984bdb0f..01883275 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Menus/MiniProgramsMenus.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Menus/MiniProgramsMenus.cs @@ -1,18 +1,14 @@ -namespace EasyAbp.WeChatManagement.MiniPrograms.Web.Menus +using EasyAbp.WeChatManagement.Common.Web.Menus; + +namespace EasyAbp.WeChatManagement.MiniPrograms.Web.Menus { public class MiniProgramsMenus { - public const string ModuleGroupPrefix = "EasyAbp.WeChatManagement"; - - public const string Prefix = ModuleGroupPrefix + ".MiniPrograms"; + public const string Prefix = CommonMenus.Prefix + ".MiniPrograms"; //Add your menu items here... //public const string Home = Prefix + ".MyNewMenuItem"; - public const string MiniProgram = Prefix + ".MiniProgram"; - - public const string MiniProgramUser = Prefix + ".MiniProgramUser"; - public const string UserInfo = Prefix + ".UserInfo"; } } \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/MiniProgramsWebAutoMapperProfile.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/MiniProgramsWebAutoMapperProfile.cs index 6cfa3657..6f6bf52f 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/MiniProgramsWebAutoMapperProfile.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/MiniProgramsWebAutoMapperProfile.cs @@ -1,6 +1,4 @@ -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.Dtos; -using EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram.ViewModels; -using AutoMapper; +using AutoMapper; namespace EasyAbp.WeChatManagement.MiniPrograms.Web { @@ -11,8 +9,6 @@ public MiniProgramsWebAutoMapperProfile() /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap(); - CreateMap(); } } } diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/Index.cshtml b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/Index.cshtml deleted file mode 100644 index e2aee8fa..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/Index.cshtml +++ /dev/null @@ -1,51 +0,0 @@ -@page -@using EasyAbp.WeChatManagement.MiniPrograms.Permissions -@using EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniProgramUsers.MiniProgramUser -@using EasyAbp.WeChatManagement.MiniPrograms.Localization -@using EasyAbp.WeChatManagement.MiniPrograms.Web.Menus -@using Microsoft.AspNetCore.Authorization -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.AspNetCore.Mvc.UI.Layout -@model IndexModel -@inject IPageLayout PageLayout -@inject IHtmlLocalizer L -@inject IAuthorizationService Authorization -@{ - PageLayout.Content.Title = L["MiniProgramUser"].Value; - PageLayout.Content.BreadCrumb.Add(L["Menu:MiniProgramUser"].Value); - PageLayout.Content.MenuItemName = MiniProgramsMenus.MiniProgramUser; -} - -@section scripts -{ - -} -@section styles -{ - -} - - - - - - @L["MiniProgramUser"] - - - - - - - - @L["Actions"] - @L["MiniProgramUserMiniProgramId"] - @L["MiniProgramUserUserId"] - @L["MiniProgramUserUnionId"] - @L["MiniProgramUserOpenId"] - @L["MiniProgramUserSessionKey"] - @L["MiniProgramUserSessionKeyChangedTime"] - - - - - \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/Index.cshtml.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/Index.cshtml.cs deleted file mode 100644 index 57690b40..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniProgramUsers/MiniProgramUser/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; - -namespace EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniProgramUsers.MiniProgramUser -{ - public class IndexModel : MiniProgramsPageModel - { - public virtual async Task OnGetAsync() - { - await Task.CompletedTask; - } - } -} diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/CreateModal.cshtml.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/CreateModal.cshtml.cs deleted file mode 100644 index 7d3ef4c7..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/CreateModal.cshtml.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.Dtos; -using EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram.ViewModels; - -namespace EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram -{ - public class CreateModalModel : MiniProgramsPageModel - { - [BindProperty] - public CreateEditMiniProgramViewModel ViewModel { get; set; } = new CreateEditMiniProgramViewModel(); - - private readonly IMiniProgramAppService _service; - - public CreateModalModel(IMiniProgramAppService service) - { - _service = service; - } - public virtual async Task OnPostAsync() - { - var dto = ObjectMapper.Map(ViewModel); - await _service.CreateAsync(dto); - return NoContent(); - } - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/EditModal.cshtml.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/EditModal.cshtml.cs deleted file mode 100644 index 7a85cba9..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/EditModal.cshtml.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.Dtos; -using EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram.ViewModels; - -namespace EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram -{ - public class EditModalModel : MiniProgramsPageModel - { - [HiddenInput] - [BindProperty(SupportsGet = true)] - public Guid Id { get; set; } - - [BindProperty] - public CreateEditMiniProgramViewModel ViewModel { get; set; } - - private readonly IMiniProgramAppService _service; - - public EditModalModel(IMiniProgramAppService service) - { - _service = service; - } - - public virtual async Task OnGetAsync() - { - var dto = await _service.GetAsync(Id); - ViewModel = ObjectMapper.Map(dto); - } - - public virtual async Task OnPostAsync() - { - var dto = ObjectMapper.Map(ViewModel); - await _service.UpdateAsync(Id, dto); - return NoContent(); - } - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/Index.cshtml b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/Index.cshtml deleted file mode 100644 index 00d8f5d5..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/Index.cshtml +++ /dev/null @@ -1,63 +0,0 @@ -@page -@using EasyAbp.WeChatManagement.MiniPrograms.Permissions -@using EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram -@using EasyAbp.WeChatManagement.MiniPrograms.Localization -@using EasyAbp.WeChatManagement.MiniPrograms.Web.Menus -@using Microsoft.AspNetCore.Authorization -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.AspNetCore.Mvc.UI.Layout -@model IndexModel -@inject IPageLayout PageLayout -@inject IHtmlLocalizer L -@inject IAuthorizationService Authorization -@{ - PageLayout.Content.Title = L["MiniProgram"].Value; - PageLayout.Content.BreadCrumb.Add(L["Menu:MiniProgram"].Value); - PageLayout.Content.MenuItemName = MiniProgramsMenus.MiniProgram; -} - -@section scripts -{ - -} -@section styles -{ - -} - - - - - - @L["MiniProgram"] - - - @if (await Authorization.IsGrantedAsync(MiniProgramsPermissions.MiniProgram.Create)) - { - - } - - - - - - - - @L["Actions"] - @L["MiniProgramWeChatComponentId"] - @L["MiniProgramName"] - @L["MiniProgramDisplayName"] - @L["MiniProgramOpenAppIdOrName"] - @L["MiniProgramAppId"] - @L["MiniProgramAppSecret"] - @L["MiniProgramToken"] - @L["MiniProgramEncodingAesKey"] - @L["MiniProgramIsStatic"] - - - - - \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/Index.cshtml.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/Index.cshtml.cs deleted file mode 100644 index 6e6488a7..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; - -namespace EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram -{ - public class IndexModel : MiniProgramsPageModel - { - public virtual async Task OnGetAsync() - { - await Task.CompletedTask; - } - } -} diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/ViewModels/CreateEditMiniProgramViewModel.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/ViewModels/CreateEditMiniProgramViewModel.cs deleted file mode 100644 index 0c52d4f4..00000000 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/Pages/WeChatManagement/MiniPrograms/MiniPrograms/MiniProgram/ViewModels/CreateEditMiniProgramViewModel.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; - -namespace EasyAbp.WeChatManagement.MiniPrograms.Web.Pages.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram.ViewModels -{ - public class CreateEditMiniProgramViewModel - { - [Placeholder("MiniProgramWeChatComponentIdPlaceHolder")] - [Display(Name = "MiniProgramWeChatComponentId")] - public Guid? WeChatComponentId { get; set; } - - [Required] - [Display(Name = "MiniProgramName")] - public string Name { get; set; } - - [Required] - [Display(Name = "MiniProgramDisplayName")] - public string DisplayName { get; set; } - - [Required] - [Display(Name = "MiniProgramOpenAppIdOrName")] - public string OpenAppIdOrName { get; set; } = "Default"; - - [Required] - [Display(Name = "MiniProgramAppId")] - public string AppId { get; set; } - - [Placeholder("MiniProgramAppSecretPlaceHolder")] - [Display(Name = "MiniProgramAppSecret")] - public string AppSecret { get; set; } - - [Display(Name = "MiniProgramToken")] - public string Token { get; set; } - - [Display(Name = "MiniProgramEncodingAesKey")] - public string EncodingAesKey { get; set; } - } -} \ No newline at end of file diff --git a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/WeChatManagementMiniProgramsWebModule.cs b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/WeChatManagementMiniProgramsWebModule.cs index a23be0cb..26a94776 100644 --- a/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/WeChatManagementMiniProgramsWebModule.cs +++ b/modules/MiniPrograms/src/EasyAbp.WeChatManagement.MiniPrograms.Web/WeChatManagementMiniProgramsWebModule.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; +using EasyAbp.WeChatManagement.Common.Web; +using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using EasyAbp.WeChatManagement.MiniPrograms.Localization; using EasyAbp.WeChatManagement.MiniPrograms.Web.Menus; @@ -15,8 +16,9 @@ namespace EasyAbp.WeChatManagement.MiniPrograms.Web [DependsOn( typeof(WeChatManagementMiniProgramsHttpApiModule), typeof(AbpAspNetCoreMvcUiThemeSharedModule), - typeof(AbpAutoMapperModule) - )] + typeof(AbpAutoMapperModule), + typeof(WeChatManagementCommonWebModule) + )] public class WeChatManagementMiniProgramsWebModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests.csproj b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests.csproj index 61ef6994..4f416c07 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests.csproj +++ b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests.csproj @@ -4,13 +4,13 @@ net5.0 - + EasyAbp.WeChatManagement.MiniPrograms - + diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/MiniProgramUsers/MiniProgramUserAppServiceTests.cs b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/MiniProgramUsers/MiniProgramUserAppServiceTests.cs deleted file mode 100644 index 0406a50a..00000000 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/MiniProgramUsers/MiniProgramUserAppServiceTests.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Shouldly; -using System.Threading.Tasks; -using Xunit; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers -{ - public class MiniProgramUserAppServiceTests : MiniProgramsApplicationTestBase - { - private readonly IMiniProgramUserAppService _miniProgramUserAppService; - - public MiniProgramUserAppServiceTests() - { - _miniProgramUserAppService = GetRequiredService(); - } - - [Fact] - public async Task Test1() - { - // Arrange - - // Act - - // Assert - } - } -} diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/MiniPrograms/MiniProgramAppServiceTests.cs b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/MiniPrograms/MiniProgramAppServiceTests.cs deleted file mode 100644 index 5292eac8..00000000 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Application.Tests/MiniPrograms/MiniProgramAppServiceTests.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Shouldly; -using System.Threading.Tasks; -using Xunit; - -namespace EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms -{ - public class MiniProgramAppServiceTests : MiniProgramsApplicationTestBase - { - private readonly IMiniProgramAppService _miniProgramAppService; - - public MiniProgramAppServiceTests() - { - _miniProgramAppService = GetRequiredService(); - } - - [Fact] - public async Task Test1() - { - // Arrange - - // Act - - // Assert - } - } -} diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests.csproj b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests.csproj index 7ae214f2..c3aba681 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests.csproj +++ b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests/EasyAbp.WeChatManagement.MiniPrograms.Domain.Tests.csproj @@ -4,11 +4,11 @@ net5.0 - + EasyAbp.WeChatManagement.MiniPrograms - + diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests.csproj b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests.csproj index 0b93e45e..6cafe656 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests.csproj +++ b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests.csproj @@ -4,12 +4,12 @@ net5.0 - + EasyAbp.WeChatManagement.MiniPrograms - - + + diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EntityFrameworkCore/MiniProgramUsers/MiniProgramUserRepositoryTests.cs b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EntityFrameworkCore/MiniProgramUsers/MiniProgramUserRepositoryTests.cs deleted file mode 100644 index cd4aeaf5..00000000 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EntityFrameworkCore/MiniProgramUsers/MiniProgramUserRepositoryTests.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers; -using Volo.Abp.Domain.Repositories; -using Xunit; - -namespace EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.MiniProgramUsers -{ - public class MiniProgramUserRepositoryTests : MiniProgramsEntityFrameworkCoreTestBase - { - private readonly IMiniProgramUserRepository _miniProgramUserRepository; - - public MiniProgramUserRepositoryTests() - { - _miniProgramUserRepository = GetRequiredService(); - } - - [Fact] - public async Task Test1() - { - await WithUnitOfWorkAsync(async () => - { - // Arrange - - // Act - - //Assert - }); - } - } -} diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EntityFrameworkCore/MiniPrograms/MiniProgramRepositoryTests.cs b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EntityFrameworkCore/MiniPrograms/MiniProgramRepositoryTests.cs deleted file mode 100644 index f7a2b87e..00000000 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.Tests/EntityFrameworkCore/MiniPrograms/MiniProgramRepositoryTests.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; -using Volo.Abp.Domain.Repositories; -using Xunit; - -namespace EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore.MiniPrograms -{ - public class MiniProgramRepositoryTests : MiniProgramsEntityFrameworkCoreTestBase - { - private readonly IMiniProgramRepository _miniProgramRepository; - - public MiniProgramRepositoryTests() - { - _miniProgramRepository = GetRequiredService(); - } - - [Fact] - public async Task Test1() - { - await WithUnitOfWorkAsync(async () => - { - // Arrange - - // Act - - //Assert - }); - } - } -} diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.ConsoleTestApp/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.ConsoleTestApp.csproj b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.ConsoleTestApp/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.ConsoleTestApp.csproj index 5ee2a6ec..b12e6874 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.ConsoleTestApp/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.ConsoleTestApp/EasyAbp.WeChatManagement.MiniPrograms.HttpApi.Client.ConsoleTestApp.csproj @@ -3,7 +3,7 @@ Exe net5.0 - + EasyAbp.WeChatManagement.MiniPrograms diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.Tests/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.Tests.csproj b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.Tests/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.Tests.csproj index 96981717..4b547de4 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.Tests/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.Tests.csproj +++ b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.Tests/EasyAbp.WeChatManagement.MiniPrograms.MongoDB.Tests.csproj @@ -4,12 +4,12 @@ net5.0 - + EasyAbp.WeChatManagement.MiniPrograms - - + + diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/EasyAbp.WeChatManagement.MiniPrograms.TestBase.csproj b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/EasyAbp.WeChatManagement.MiniPrograms.TestBase.csproj index b207bf34..9feef021 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/EasyAbp.WeChatManagement.MiniPrograms.TestBase.csproj +++ b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/EasyAbp.WeChatManagement.MiniPrograms.TestBase.csproj @@ -4,13 +4,13 @@ net5.0 - + EasyAbp.WeChatManagement.MiniPrograms - + - + diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/MiniProgramsDataSeedContributor.cs b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/MiniProgramsDataSeedContributor.cs index b31c55ae..7e84dbae 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/MiniProgramsDataSeedContributor.cs +++ b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/MiniProgramsDataSeedContributor.cs @@ -1,5 +1,5 @@ using System.Threading.Tasks; -using EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms; +using EasyAbp.WeChatManagement.Common.WeChatApps; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; @@ -8,14 +8,14 @@ namespace EasyAbp.WeChatManagement.MiniPrograms { public class MiniProgramsDataSeedContributor : IDataSeedContributor, ITransientDependency { - private readonly IMiniProgramRepository _miniProgramRepository; + private readonly IWeChatAppRepository _weChatAppRepository; private readonly IGuidGenerator _guidGenerator; public MiniProgramsDataSeedContributor( - IMiniProgramRepository miniProgramRepository, + IWeChatAppRepository weChatAppRepository, IGuidGenerator guidGenerator) { - _miniProgramRepository = miniProgramRepository; + _weChatAppRepository = weChatAppRepository; _guidGenerator = guidGenerator; } @@ -25,9 +25,10 @@ public async Task SeedAsync(DataSeedContext context) * at this point! */ - await _miniProgramRepository.InsertAsync(new MiniProgram( + await _weChatAppRepository.InsertAsync(new WeChatApp( _guidGenerator.Create(), null, + WeChatAppType.MiniProgram, null, "TestMiniProgram", "TestMiniProgram", diff --git a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/MiniProgramsTestConsts.cs b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/MiniProgramsTestConsts.cs index 993d68ec..e1e51b5d 100644 --- a/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/MiniProgramsTestConsts.cs +++ b/modules/MiniPrograms/test/EasyAbp.WeChatManagement.MiniPrograms.TestBase/MiniProgramsTestConsts.cs @@ -2,7 +2,7 @@ { public static class MiniProgramsTestConsts { - public const string OpenAppIdOrName = null; + public const string OpenAppIdOrName = "Default"; public const string AppId = ""; diff --git a/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/EntityFrameworkCore/WeChatManagementSampleDbContext.cs b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/EntityFrameworkCore/WeChatManagementSampleDbContext.cs index 9ad70121..1c088972 100644 --- a/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/EntityFrameworkCore/WeChatManagementSampleDbContext.cs +++ b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/EntityFrameworkCore/WeChatManagementSampleDbContext.cs @@ -1,4 +1,5 @@ -using EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore; +using EasyAbp.WeChatManagement.Common.EntityFrameworkCore; +using EasyAbp.WeChatManagement.MiniPrograms.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.BackgroundJobs.EntityFrameworkCore; @@ -74,6 +75,7 @@ protected override void OnModelCreating(ModelBuilder builder) builder.ConfigureFeatureManagement(); builder.ConfigureTenantManagement(); + builder.ConfigureWeChatManagementCommon(); builder.ConfigureWeChatManagementMiniPrograms(); /* Configure your own tables/entities inside here */ diff --git a/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/20210827092621_IntroducedWeChatApp.Designer.cs b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/20210827092621_IntroducedWeChatApp.Designer.cs new file mode 100644 index 00000000..6df20047 --- /dev/null +++ b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/20210827092621_IntroducedWeChatApp.Designer.cs @@ -0,0 +1,2535 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using WeChatManagementSample.EntityFrameworkCore; + +namespace WeChatManagementSample.Migrations +{ + [DbContext(typeof(WeChatManagementSampleDbContext))] + [Migration("20210827092621_IntroducedWeChatApp")] + partial class IntroducedWeChatApp + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.9") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("EasyAbp.WeChatManagement.Common.WeChatAppUsers.WeChatAppUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OpenId") + .HasColumnType("nvarchar(max)"); + + b.Property("SessionKey") + .HasColumnType("nvarchar(max)"); + + b.Property("SessionKeyChangedTime") + .HasColumnType("datetime2"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UnionId") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("WeChatAppId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpWeChatManagementCommonWeChatAppUsers"); + }); + + modelBuilder.Entity("EasyAbp.WeChatManagement.Common.WeChatApps.WeChatApp", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("AppSecret") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("EncodingAesKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("OpenAppIdOrName") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Token") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("WeChatComponentId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpWeChatManagementCommonWeChatApps"); + }); + + modelBuilder.Entity("EasyAbp.WeChatManagement.MiniPrograms.UserInfos.UserInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AvatarUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Country") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Gender") + .HasColumnType("tinyint"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("Language") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("NickName") + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpWeChatManagementMiniProgramsUserInfos"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("nvarchar(max)"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime2") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("nvarchar(max)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("RequireRequestObject") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("Value") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/20210827092621_IntroducedWeChatApp.cs b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/20210827092621_IntroducedWeChatApp.cs new file mode 100644 index 00000000..e10f13ea --- /dev/null +++ b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/20210827092621_IntroducedWeChatApp.cs @@ -0,0 +1,86 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace WeChatManagementSample.Migrations +{ + public partial class IntroducedWeChatApp : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_EasyAbpWeChatManagementMiniProgramsMiniPrograms", + table: "EasyAbpWeChatManagementMiniProgramsMiniPrograms"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EasyAbpWeChatManagementMiniProgramsMiniProgramUsers", + table: "EasyAbpWeChatManagementMiniProgramsMiniProgramUsers"); + + migrationBuilder.RenameTable( + name: "EasyAbpWeChatManagementMiniProgramsMiniPrograms", + newName: "EasyAbpWeChatManagementCommonWeChatApps"); + + migrationBuilder.RenameTable( + name: "EasyAbpWeChatManagementMiniProgramsMiniProgramUsers", + newName: "EasyAbpWeChatManagementCommonWeChatAppUsers"); + + migrationBuilder.RenameColumn( + name: "MiniProgramId", + table: "EasyAbpWeChatManagementCommonWeChatAppUsers", + newName: "WeChatAppId"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EasyAbpWeChatManagementCommonWeChatApps", + table: "EasyAbpWeChatManagementCommonWeChatApps", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EasyAbpWeChatManagementCommonWeChatAppUsers", + table: "EasyAbpWeChatManagementCommonWeChatAppUsers", + column: "Id"); + + migrationBuilder.AddColumn( + name: "Type", + table: "EasyAbpWeChatManagementCommonWeChatApps", + nullable: false, + defaultValue: 0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_EasyAbpWeChatManagementCommonWeChatApps", + table: "EasyAbpWeChatManagementCommonWeChatApps"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EasyAbpWeChatManagementCommonWeChatAppUsers", + table: "EasyAbpWeChatManagementCommonWeChatAppUsers"); + + migrationBuilder.RenameTable( + name: "EasyAbpWeChatManagementCommonWeChatApps", + newName: "EasyAbpWeChatManagementMiniProgramsMiniPrograms"); + + migrationBuilder.RenameTable( + name: "EasyAbpWeChatManagementCommonWeChatAppUsers", + newName: "EasyAbpWeChatManagementMiniProgramsMiniProgramUsers"); + + migrationBuilder.RenameColumn( + name: "WeChatAppId", + table: "EasyAbpWeChatManagementMiniProgramsMiniProgramUsers", + newName: "MiniProgramId"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EasyAbpWeChatManagementMiniProgramsMiniPrograms", + table: "EasyAbpWeChatManagementMiniProgramsMiniPrograms", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EasyAbpWeChatManagementMiniProgramsMiniProgramUsers", + table: "EasyAbpWeChatManagementMiniProgramsMiniProgramUsers", + column: "Id"); + + migrationBuilder.DropColumn( + name: "Type", + table: "EasyAbpWeChatManagementMiniProgramsMiniPrograms"); + } + } +} diff --git a/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/WeChatManagementSampleDbContextModelSnapshot.cs b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/WeChatManagementSampleDbContextModelSnapshot.cs index 2ba15f49..933bd5e1 100644 --- a/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/WeChatManagementSampleDbContextModelSnapshot.cs +++ b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.EntityFrameworkCore/Migrations/WeChatManagementSampleDbContextModelSnapshot.cs @@ -21,7 +21,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasAnnotation("ProductVersion", "5.0.9") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("EasyAbp.WeChatManagement.MiniPrograms.MiniProgramUsers.MiniProgramUser", b => + modelBuilder.Entity("EasyAbp.WeChatManagement.Common.WeChatAppUsers.WeChatAppUser", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -67,9 +67,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); - b.Property("MiniProgramId") - .HasColumnType("uniqueidentifier"); - b.Property("OpenId") .HasColumnType("nvarchar(max)"); @@ -89,12 +86,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("UserId") .HasColumnType("uniqueidentifier"); + b.Property("WeChatAppId") + .HasColumnType("uniqueidentifier"); + b.HasKey("Id"); - b.ToTable("EasyAbpWeChatManagementMiniProgramsMiniProgramUsers"); + b.ToTable("EasyAbpWeChatManagementCommonWeChatAppUsers"); }); - modelBuilder.Entity("EasyAbp.WeChatManagement.MiniPrograms.MiniPrograms.MiniProgram", b => + modelBuilder.Entity("EasyAbp.WeChatManagement.Common.WeChatApps.WeChatApp", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -168,12 +168,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Token") .HasColumnType("nvarchar(max)"); + b.Property("Type") + .HasColumnType("int"); + b.Property("WeChatComponentId") .HasColumnType("uniqueidentifier"); b.HasKey("Id"); - b.ToTable("EasyAbpWeChatManagementMiniProgramsMiniPrograms"); + b.ToTable("EasyAbpWeChatManagementCommonWeChatApps"); }); modelBuilder.Entity("EasyAbp.WeChatManagement.MiniPrograms.UserInfos.UserInfo", b => diff --git a/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.Web/WeChatManagementSampleWebModule.cs b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.Web/WeChatManagementSampleWebModule.cs index 1a85c13a..bcc00c3d 100644 --- a/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.Web/WeChatManagementSampleWebModule.cs +++ b/samples/WeChatManagementSample/aspnet-core/src/WeChatManagementSample.Web/WeChatManagementSampleWebModule.cs @@ -1,5 +1,7 @@ using System; using System.IO; +using EasyAbp.WeChatManagement.Common; +using EasyAbp.WeChatManagement.Common.Web; using EasyAbp.WeChatManagement.MiniPrograms; using EasyAbp.WeChatManagement.MiniPrograms.Web; using Localization.Resources.AbpUi; @@ -129,6 +131,12 @@ private void ConfigureVirtualFileSystem(IWebHostEnvironment hostingEnvironment) options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}WeChatManagementSample.Application")); options.FileSets.ReplaceEmbeddedByPhysical(hostingEnvironment.ContentRootPath); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}Common{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.WeChatManagement.Common.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}Common{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.WeChatManagement.Common.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}Common{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.WeChatManagement.Common.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}Common{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.WeChatManagement.Common.Application")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}Common{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.WeChatManagement.Common.Web")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}MiniPrograms{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.WeChatManagement.MiniPrograms.Domain.Shared")); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}MiniPrograms{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.WeChatManagement.MiniPrograms.Domain")); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}modules{Path.DirectorySeparatorChar}MiniPrograms{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.WeChatManagement.MiniPrograms.Application.Contracts")); diff --git a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Application.Tests/WeChatManagementSample.Application.Tests.csproj b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Application.Tests/WeChatManagementSample.Application.Tests.csproj index 618b85e0..c7b2095a 100644 --- a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Application.Tests/WeChatManagementSample.Application.Tests.csproj +++ b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Application.Tests/WeChatManagementSample.Application.Tests.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Domain.Tests/WeChatManagementSample.Domain.Tests.csproj b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Domain.Tests/WeChatManagementSample.Domain.Tests.csproj index 6f1aef59..bffca670 100644 --- a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Domain.Tests/WeChatManagementSample.Domain.Tests.csproj +++ b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Domain.Tests/WeChatManagementSample.Domain.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.EntityFrameworkCore.Tests/WeChatManagementSample.EntityFrameworkCore.Tests.csproj b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.EntityFrameworkCore.Tests/WeChatManagementSample.EntityFrameworkCore.Tests.csproj index 02e21118..79685ef6 100644 --- a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.EntityFrameworkCore.Tests/WeChatManagementSample.EntityFrameworkCore.Tests.csproj +++ b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.EntityFrameworkCore.Tests/WeChatManagementSample.EntityFrameworkCore.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.TestBase/WeChatManagementSample.TestBase.csproj b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.TestBase/WeChatManagementSample.TestBase.csproj index 75a0090f..c2a6a413 100644 --- a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.TestBase/WeChatManagementSample.TestBase.csproj +++ b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.TestBase/WeChatManagementSample.TestBase.csproj @@ -15,9 +15,9 @@ - + - + diff --git a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Web.Tests/WeChatManagementSample.Web.Tests.csproj b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Web.Tests/WeChatManagementSample.Web.Tests.csproj index 584009b9..f35d3ed7 100644 --- a/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Web.Tests/WeChatManagementSample.Web.Tests.csproj +++ b/samples/WeChatManagementSample/aspnet-core/test/WeChatManagementSample.Web.Tests/WeChatManagementSample.Web.Tests.csproj @@ -14,7 +14,7 @@ - +