diff --git a/aspnet-core/Lion.AbpPro.sln b/aspnet-core/Lion.AbpPro.sln index 0d1f4eb8..9fc92c85 100644 --- a/aspnet-core/Lion.AbpPro.sln +++ b/aspnet-core/Lion.AbpPro.sln @@ -135,6 +135,40 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.Extension", "fr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.CAP", "frameworks\CAP\src\Lion.AbpPro.CAP\Lion.AbpPro.CAP.csproj", "{3C3FF821-E43D-4D58-8B3C-1E97F4518EF7}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FileManagement", "FileManagement", "{F604F9BE-CAAB-4D94-8989-22DE4D966C7A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{C188A1F4-9601-42E5-9A0A-B282E13EAC41}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2CC8E555-AA80-4D7A-B606-0821E6754187}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{40BF21CB-4520-45A6-A588-5FFB95BAC87C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.Domain.Shared", "modules\FileManagement\src\Lion.AbpPro.FileManagement.Domain.Shared\Lion.AbpPro.FileManagement.Domain.Shared.csproj", "{866B0894-2B50-484E-BE7E-F221956557F3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.Application", "modules\FileManagement\src\Lion.AbpPro.FileManagement.Application\Lion.AbpPro.FileManagement.Application.csproj", "{E7B2B79A-09D3-4B7D-83A1-F6DE57E8584B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.Application.Contracts", "modules\FileManagement\src\Lion.AbpPro.FileManagement.Application.Contracts\Lion.AbpPro.FileManagement.Application.Contracts.csproj", "{3B5E4384-9E08-46A6-B526-DF198823D7C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.Domain", "modules\FileManagement\src\Lion.AbpPro.FileManagement.Domain\Lion.AbpPro.FileManagement.Domain.csproj", "{23BCC55E-3D30-4E4E-8489-15A5894EE480}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.EntityFrameworkCore", "modules\FileManagement\src\Lion.AbpPro.FileManagement.EntityFrameworkCore\Lion.AbpPro.FileManagement.EntityFrameworkCore.csproj", "{81B29ECF-F004-4DC6-9126-2E45B02C2DFE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.HttpApi", "modules\FileManagement\src\Lion.AbpPro.FileManagement.HttpApi\Lion.AbpPro.FileManagement.HttpApi.csproj", "{65270240-0157-423A-9115-EAE2992E2FE7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.HttpApi.Client", "modules\FileManagement\src\Lion.AbpPro.FileManagement.HttpApi.Client\Lion.AbpPro.FileManagement.HttpApi.Client.csproj", "{72C8D8FA-9B61-415F-8FAF-08BC7BD13E9C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.Application.Tests", "modules\FileManagement\test\Lion.AbpPro.FileManagement.Application.Tests\Lion.AbpPro.FileManagement.Application.Tests.csproj", "{E6D3F0F8-0683-4A00-8459-C9C4C65D825D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.Domain.Tests", "modules\FileManagement\test\Lion.AbpPro.FileManagement.Domain.Tests\Lion.AbpPro.FileManagement.Domain.Tests.csproj", "{C912E1E7-4F8F-4ADB-BB27-D40B1903FED0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests", "modules\FileManagement\test\Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests\Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests.csproj", "{80E12564-E2B3-4307-B40E-20E24BF02916}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp", "modules\FileManagement\test\Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp\Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp.csproj", "{9201AEE4-2E6D-4A48-805F-3F3C6878BC0B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.TestBase", "modules\FileManagement\test\Lion.AbpPro.FileManagement.TestBase\Lion.AbpPro.FileManagement.TestBase.csproj", "{78589964-923E-4803-9B74-183487C3ED0F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.AbpPro.FileManagement.HttpApi.Host", "modules\FileManagement\host\Lion.AbpPro.FileManagement.HttpApi.Host\Lion.AbpPro.FileManagement.HttpApi.Host.csproj", "{831CD22A-AC6E-4515-AB24-8C96B34C717F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -313,6 +347,58 @@ Global {3C3FF821-E43D-4D58-8B3C-1E97F4518EF7}.Debug|Any CPU.Build.0 = Debug|Any CPU {3C3FF821-E43D-4D58-8B3C-1E97F4518EF7}.Release|Any CPU.ActiveCfg = Release|Any CPU {3C3FF821-E43D-4D58-8B3C-1E97F4518EF7}.Release|Any CPU.Build.0 = Release|Any CPU + {866B0894-2B50-484E-BE7E-F221956557F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {866B0894-2B50-484E-BE7E-F221956557F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {866B0894-2B50-484E-BE7E-F221956557F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {866B0894-2B50-484E-BE7E-F221956557F3}.Release|Any CPU.Build.0 = Release|Any CPU + {E7B2B79A-09D3-4B7D-83A1-F6DE57E8584B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7B2B79A-09D3-4B7D-83A1-F6DE57E8584B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7B2B79A-09D3-4B7D-83A1-F6DE57E8584B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E7B2B79A-09D3-4B7D-83A1-F6DE57E8584B}.Release|Any CPU.Build.0 = Release|Any CPU + {3B5E4384-9E08-46A6-B526-DF198823D7C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B5E4384-9E08-46A6-B526-DF198823D7C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B5E4384-9E08-46A6-B526-DF198823D7C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B5E4384-9E08-46A6-B526-DF198823D7C8}.Release|Any CPU.Build.0 = Release|Any CPU + {23BCC55E-3D30-4E4E-8489-15A5894EE480}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23BCC55E-3D30-4E4E-8489-15A5894EE480}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23BCC55E-3D30-4E4E-8489-15A5894EE480}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23BCC55E-3D30-4E4E-8489-15A5894EE480}.Release|Any CPU.Build.0 = Release|Any CPU + {81B29ECF-F004-4DC6-9126-2E45B02C2DFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81B29ECF-F004-4DC6-9126-2E45B02C2DFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81B29ECF-F004-4DC6-9126-2E45B02C2DFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81B29ECF-F004-4DC6-9126-2E45B02C2DFE}.Release|Any CPU.Build.0 = Release|Any CPU + {65270240-0157-423A-9115-EAE2992E2FE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65270240-0157-423A-9115-EAE2992E2FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65270240-0157-423A-9115-EAE2992E2FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65270240-0157-423A-9115-EAE2992E2FE7}.Release|Any CPU.Build.0 = Release|Any CPU + {72C8D8FA-9B61-415F-8FAF-08BC7BD13E9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72C8D8FA-9B61-415F-8FAF-08BC7BD13E9C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72C8D8FA-9B61-415F-8FAF-08BC7BD13E9C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72C8D8FA-9B61-415F-8FAF-08BC7BD13E9C}.Release|Any CPU.Build.0 = Release|Any CPU + {E6D3F0F8-0683-4A00-8459-C9C4C65D825D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6D3F0F8-0683-4A00-8459-C9C4C65D825D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6D3F0F8-0683-4A00-8459-C9C4C65D825D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6D3F0F8-0683-4A00-8459-C9C4C65D825D}.Release|Any CPU.Build.0 = Release|Any CPU + {C912E1E7-4F8F-4ADB-BB27-D40B1903FED0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C912E1E7-4F8F-4ADB-BB27-D40B1903FED0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C912E1E7-4F8F-4ADB-BB27-D40B1903FED0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C912E1E7-4F8F-4ADB-BB27-D40B1903FED0}.Release|Any CPU.Build.0 = Release|Any CPU + {80E12564-E2B3-4307-B40E-20E24BF02916}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80E12564-E2B3-4307-B40E-20E24BF02916}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80E12564-E2B3-4307-B40E-20E24BF02916}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80E12564-E2B3-4307-B40E-20E24BF02916}.Release|Any CPU.Build.0 = Release|Any CPU + {9201AEE4-2E6D-4A48-805F-3F3C6878BC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9201AEE4-2E6D-4A48-805F-3F3C6878BC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9201AEE4-2E6D-4A48-805F-3F3C6878BC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9201AEE4-2E6D-4A48-805F-3F3C6878BC0B}.Release|Any CPU.Build.0 = Release|Any CPU + {78589964-923E-4803-9B74-183487C3ED0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78589964-923E-4803-9B74-183487C3ED0F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78589964-923E-4803-9B74-183487C3ED0F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78589964-923E-4803-9B74-183487C3ED0F}.Release|Any CPU.Build.0 = Release|Any CPU + {831CD22A-AC6E-4515-AB24-8C96B34C717F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {831CD22A-AC6E-4515-AB24-8C96B34C717F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {831CD22A-AC6E-4515-AB24-8C96B34C717F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {831CD22A-AC6E-4515-AB24-8C96B34C717F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -375,6 +461,23 @@ Global {D9108313-8D05-4F5F-9AA0-B443EC3374B6} = {5C304CBC-F30D-413C-A0AF-8B6814A2D4A3} {4C65690E-2C17-46A1-BB35-A51BAB2EA3B7} = {C4AC9352-C9F5-4096-8D73-13638232CFB9} {3C3FF821-E43D-4D58-8B3C-1E97F4518EF7} = {11ED8435-B5AE-4BF3-9D4B-51FA1E4A18A6} + {F604F9BE-CAAB-4D94-8989-22DE4D966C7A} = {F8A8EB2A-2D4B-464F-9A13-F8F7B6A8FAA3} + {C188A1F4-9601-42E5-9A0A-B282E13EAC41} = {F604F9BE-CAAB-4D94-8989-22DE4D966C7A} + {2CC8E555-AA80-4D7A-B606-0821E6754187} = {F604F9BE-CAAB-4D94-8989-22DE4D966C7A} + {40BF21CB-4520-45A6-A588-5FFB95BAC87C} = {F604F9BE-CAAB-4D94-8989-22DE4D966C7A} + {866B0894-2B50-484E-BE7E-F221956557F3} = {2CC8E555-AA80-4D7A-B606-0821E6754187} + {E7B2B79A-09D3-4B7D-83A1-F6DE57E8584B} = {2CC8E555-AA80-4D7A-B606-0821E6754187} + {3B5E4384-9E08-46A6-B526-DF198823D7C8} = {2CC8E555-AA80-4D7A-B606-0821E6754187} + {23BCC55E-3D30-4E4E-8489-15A5894EE480} = {2CC8E555-AA80-4D7A-B606-0821E6754187} + {81B29ECF-F004-4DC6-9126-2E45B02C2DFE} = {2CC8E555-AA80-4D7A-B606-0821E6754187} + {65270240-0157-423A-9115-EAE2992E2FE7} = {2CC8E555-AA80-4D7A-B606-0821E6754187} + {72C8D8FA-9B61-415F-8FAF-08BC7BD13E9C} = {2CC8E555-AA80-4D7A-B606-0821E6754187} + {E6D3F0F8-0683-4A00-8459-C9C4C65D825D} = {40BF21CB-4520-45A6-A588-5FFB95BAC87C} + {C912E1E7-4F8F-4ADB-BB27-D40B1903FED0} = {40BF21CB-4520-45A6-A588-5FFB95BAC87C} + {80E12564-E2B3-4307-B40E-20E24BF02916} = {40BF21CB-4520-45A6-A588-5FFB95BAC87C} + {9201AEE4-2E6D-4A48-805F-3F3C6878BC0B} = {40BF21CB-4520-45A6-A588-5FFB95BAC87C} + {78589964-923E-4803-9B74-183487C3ED0F} = {40BF21CB-4520-45A6-A588-5FFB95BAC87C} + {831CD22A-AC6E-4515-AB24-8C96B34C717F} = {C188A1F4-9601-42E5-9A0A-B282E13EAC41} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} diff --git a/aspnet-core/modules/FileManagement/Lion.AbpPro.FileManagement.sln b/aspnet-core/modules/FileManagement/Lion.AbpPro.FileManagement.sln new file mode 100644 index 00000000..ae80c6fe --- /dev/null +++ b/aspnet-core/modules/FileManagement/Lion.AbpPro.FileManagement.sln @@ -0,0 +1,118 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29001.49 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.Domain.Shared", "src\Lion.AbpPro.FileManagement.Domain.Shared\Lion.AbpPro.FileManagement.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.Domain", "src\Lion.AbpPro.FileManagement.Domain\Lion.AbpPro.FileManagement.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.Application.Contracts", "src\Lion.AbpPro.FileManagement.Application.Contracts\Lion.AbpPro.FileManagement.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.Application", "src\Lion.AbpPro.FileManagement.Application\Lion.AbpPro.FileManagement.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}") = "Lion.AbpPro.FileManagement.EntityFrameworkCore", "src\Lion.AbpPro.FileManagement.EntityFrameworkCore\Lion.AbpPro.FileManagement.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.HttpApi", "src\Lion.AbpPro.FileManagement.HttpApi\Lion.AbpPro.FileManagement.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.HttpApi.Client", "src\Lion.AbpPro.FileManagement.HttpApi.Client\Lion.AbpPro.FileManagement.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.TestBase", "test\Lion.AbpPro.FileManagement.TestBase\Lion.AbpPro.FileManagement.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests", "test\Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests\Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.Domain.Tests", "test\Lion.AbpPro.FileManagement.Domain.Tests\Lion.AbpPro.FileManagement.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.Application.Tests", "test\Lion.AbpPro.FileManagement.Application.Tests\Lion.AbpPro.FileManagement.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lion.AbpPro.FileManagement.HttpApi.Host", "host\Lion.AbpPro.FileManagement.HttpApi.Host\Lion.AbpPro.FileManagement.HttpApi.Host.csproj", "{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0.solutions", "0.solutions", "{FE2B9575-E00E-4409-B3E0-C7204F38A611}" + ProjectSection(SolutionItems) = preProject + ..\..\common.props = ..\..\common.props + ..\..\Directory.Build.props = ..\..\Directory.Build.props + ..\..\global.json = ..\..\global.json + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {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 + {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 + {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 + 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} + {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} + {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} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} + EndGlobalSection +EndGlobal diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Controllers/HomeController.cs b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 00000000..e6d84acf --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace Lion.AbpPro.FileManagement.Controllers; + +public class HomeController : AbpController +{ + public ActionResult Index() + { + return Redirect("~/swagger"); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/EntityFrameworkCore/FileManagementHttpApiHostMigrationsDbContext.cs b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/EntityFrameworkCore/FileManagementHttpApiHostMigrationsDbContext.cs new file mode 100644 index 00000000..04b2a4e5 --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/EntityFrameworkCore/FileManagementHttpApiHostMigrationsDbContext.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Lion.AbpPro.FileManagement.EntityFrameworkCore; + +public class FileManagementHttpApiHostMigrationsDbContext : AbpDbContext +{ + public FileManagementHttpApiHostMigrationsDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureFileManagement(); + } +} diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/EntityFrameworkCore/FileManagementHttpApiHostMigrationsDbContextFactory.cs b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/EntityFrameworkCore/FileManagementHttpApiHostMigrationsDbContextFactory.cs new file mode 100644 index 00000000..a7c518e1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/EntityFrameworkCore/FileManagementHttpApiHostMigrationsDbContextFactory.cs @@ -0,0 +1,27 @@ +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace Lion.AbpPro.FileManagement.EntityFrameworkCore; + +public class FileManagementHttpApiHostMigrationsDbContextFactory : IDesignTimeDbContextFactory +{ + public FileManagementHttpApiHostMigrationsDbContext CreateDbContext(string[] args) + { + var configuration = BuildConfiguration(); + + var builder = new DbContextOptionsBuilder() + .UseMySql(configuration.GetConnectionString(FileManagementDbProperties.ConnectionStringName), MySqlServerVersion.LatestSupportedServerVersion); + return new FileManagementHttpApiHostMigrationsDbContext(builder.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } +} diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FileManagementHttpApiHostModule.cs b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FileManagementHttpApiHostModule.cs new file mode 100644 index 00000000..c4062302 --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FileManagementHttpApiHostModule.cs @@ -0,0 +1,202 @@ +using System; +using System.Linq; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.Extensions.Caching.Distributed; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.OpenApi.Models; +using Lion.AbpPro.FileManagement.EntityFrameworkCore; +using StackExchange.Redis; +using Swashbuckle.AspNetCore.SwaggerUI; +using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc.AntiForgery; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.Caching; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.Swashbuckle; +using Volo.Abp.VirtualFileSystem; + +namespace Lion.AbpPro.FileManagement; + +[DependsOn( + typeof(FileManagementApplicationModule), + typeof(FileManagementEntityFrameworkCoreModule), + typeof(FileManagementHttpApiModule), + typeof(AbpAutofacModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpSwashbuckleModule) +)] +public class FileManagementHttpApiHostModule : AbpModule +{ + private const string DefaultCorsPolicyName = "Default"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + ConfigureVirtualFileSystem(); + ConfigureSwaggerServices(context); + ConfigAntiForgery(); + ConfigureLocalization(); + ConfigureCache(context); + ConfigureCors(context); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + app.UseHttpsRedirection(); + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(DefaultCorsPolicyName); + app.UseAuthentication(); + app.UseAbpRequestLocalization(); + app.UseAuthorization(); + app.UseSwagger(); + app.UseAbpSwaggerUI(options => + { + options.SwaggerEndpoint("/swagger/v1/swagger.json", "FileManagement API"); + options.DocExpansion(DocExpansion.None); + options.DefaultModelExpandDepth(-2); + }); + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + } + + /// + /// 配置虚拟文件系统 + /// + private void ConfigureVirtualFileSystem() + { + Configure(options => { options.FileSets.AddEmbedded(); }); + } + + /// + /// 配置SwaggerUI + /// + /// + private static void ConfigureSwaggerServices(ServiceConfigurationContext context) + { + context.Services.AddSwaggerGen( + options => + { + options.SwaggerDoc("v1", new OpenApiInfo { Title = "FileManagement API", Version = "v1" }); + options.DocInclusionPredicate((docName, description) => true); + + + + + #region 多语言 + + options.AddSecurityDefinition("ApiKey", new OpenApiSecurityScheme + { + Type = SecuritySchemeType.ApiKey, + In = ParameterLocation.Header, + Name = "Accept-Language", + Description = "多语言" + }); + + options.AddSecurityRequirement(new OpenApiSecurityRequirement + { + { + new OpenApiSecurityScheme + { + Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "ApiKey" } + }, + new string[] { } + } + }); + + #endregion + }); + } + + private void ConfigAntiForgery() + { + Configure(options => { options.AutoValidate = false; }); + } + + /// + /// 配置本地化 + /// + private void ConfigureLocalization() + { + Configure(options => + { + options.Languages.Add(new LanguageInfo("ar", "ar", "العربية")); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi", "in")); + options.Languages.Add(new LanguageInfo("is", "is", "Icelandic", "is")); + options.Languages.Add(new LanguageInfo("it", "it", "Italiano", "it")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ro-RO", "ro-RO", "Română")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch")); + options.Languages.Add(new LanguageInfo("es", "es", "Español")); + }); + } + + /// + /// Redis缓存 + /// + /// + private void ConfigureCache(ServiceConfigurationContext context) + { + Configure(options => + { + options.KeyPrefix = "FileManagement:"; + options.GlobalCacheEntryOptions = new DistributedCacheEntryOptions + { + // 全局缓存有效时间 + AbsoluteExpiration = DateTimeOffset.UtcNow.AddHours(2) + }; + }); + + var configuration = context.Services.GetConfiguration(); + var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + context.Services + .AddDataProtection() + .PersistKeysToStackExchangeRedis(redis, "YH.Wms.Operations-Keys"); + } + + /// + /// 配置跨域 + /// + private void ConfigureCors(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + context.Services.AddCors(options => + { + options.AddPolicy(DefaultCorsPolicyName, builder => + { + builder + .WithOrigins( + configuration["App:CorsOrigins"] + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() + ) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FodyWeavers.xml b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/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/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Lion.AbpPro.FileManagement.HttpApi.Host.csproj b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Lion.AbpPro.FileManagement.HttpApi.Host.csproj new file mode 100644 index 00000000..965f7bee --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Lion.AbpPro.FileManagement.HttpApi.Host.csproj @@ -0,0 +1,47 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + true + Lion.AbpPro.FileManagement-c2d31439-b723-48e2-b061-5ebd7aeb6010 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Migrations/20220119101622_Init.Designer.cs b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Migrations/20220119101622_Init.Designer.cs new file mode 100644 index 00000000..d2e58df5 --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Migrations/20220119101622_Init.Designer.cs @@ -0,0 +1,93 @@ +// +using System; +using Lion.AbpPro.FileManagement.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace Lion.AbpPro.FileManagement.Migrations +{ + [DbContext(typeof(FileManagementHttpApiHostMigrationsDbContext))] + [Migration("20220119101622_Init")] + partial class Init + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Lion.AbpPro.FileManagement.Files.File", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasColumnType("varchar(255)"); + + b.Property("FilePath") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex("FileName"); + + b.ToTable("File", (string)null); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Migrations/20220119101622_Init.cs b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Migrations/20220119101622_Init.cs new file mode 100644 index 00000000..9b1c77b1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Migrations/20220119101622_Init.cs @@ -0,0 +1,60 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Lion.AbpPro.FileManagement.Migrations +{ + public partial class Init : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "File", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + FileName = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + FilePath = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_File", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_File_CreationTime", + table: "File", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_File_FileName", + table: "File", + column: "FileName"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "File"); + } + } +} diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Migrations/FileManagementHttpApiHostMigrationsDbContextModelSnapshot.cs b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Migrations/FileManagementHttpApiHostMigrationsDbContextModelSnapshot.cs new file mode 100644 index 00000000..101d458c --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Migrations/FileManagementHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -0,0 +1,91 @@ +// +using System; +using Lion.AbpPro.FileManagement.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace Lion.AbpPro.FileManagement.Migrations +{ + [DbContext(typeof(FileManagementHttpApiHostMigrationsDbContext))] + partial class FileManagementHttpApiHostMigrationsDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "6.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Lion.AbpPro.FileManagement.Files.File", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasColumnType("varchar(255)"); + + b.Property("FilePath") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex("FileName"); + + b.ToTable("File", (string)null); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Program.cs b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Program.cs new file mode 100644 index 00000000..f5e3cf2a --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Program.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; +using Serilog; + +namespace Lion.AbpPro.FileManagement; + +public class Program +{ + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) + { + return Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.ConfigureKestrel((context, options) => { options.Limits.MaxRequestBodySize = 1024 * 50; }); + webBuilder.UseStartup(); + }) + .UseSerilog().UseAutofac(); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Properties/launchSettings.json b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 00000000..07f30fd8 --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "Lion.AbpPro.FileManagement.HttpApi.Host": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "http://localhost:5001", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Startup.cs b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Startup.cs new file mode 100644 index 00000000..c8dd54dd --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/Startup.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace Lion.AbpPro.FileManagement; + +public class Startup +{ + public void ConfigureServices(IServiceCollection services) + { + services.AddApplication(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) + { + app.InitializeApplication(); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/appsettings.json b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/appsettings.json new file mode 100644 index 00000000..5b227b43 --- /dev/null +++ b/aspnet-core/modules/FileManagement/host/Lion.AbpPro.FileManagement.HttpApi.Host/appsettings.json @@ -0,0 +1,26 @@ +{ + "App": { + "CorsOrigins": "https://*.FileManagement.com,http://localhost:4200,http://localhost:44307,https://localhost:44307" + }, + "ConnectionStrings": { + "FileManagement":"Data Source=localhost;Database=FileManagement;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true", + }, + "Redis": { + "Configuration": "localhost,password=mypassword,defaultdatabase=1" + }, + "AliYun": { + "OSS": { + "AccessKeyId": "LTAI5tLkt3vvScGPVZ5qKJDc", + "AccessKeySecret": "BixV8vP5uPrbsdwjYzzsEXOPjkxPST", + "Endpoint": "oss-cn-shenzhen.aliyuncs.com", + "ContainerName": "lion-abp-pro", + "RegionId": "oss-cn-shenzhen", + "RoleArn": "acs:ram::1846393972471789:role/ramosstest" + } + } +} + +//用户登录名称 lion.abp@1846393972471789.onaliyun.com +//AccessKey ID LTAI5tLkt3vvScGPVZ5qKJDc +//AccessKey Secret BixV8vP5uPrbsdwjYzzsEXOPjkxPST +//acs:ram::1846393972471789:role/ramosstest \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FileManagementApplicationContractsModule.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FileManagementApplicationContractsModule.cs new file mode 100644 index 00000000..25ffa410 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FileManagementApplicationContractsModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Application; +using Volo.Abp.Authorization; +using Volo.Abp.Modularity; + +namespace Lion.AbpPro.FileManagement; + +[DependsOn( + typeof(FileManagementDomainSharedModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationModule) +)] +public class FileManagementApplicationContractsModule : AbpModule +{ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FileManagementRemoteServiceConsts.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FileManagementRemoteServiceConsts.cs new file mode 100644 index 00000000..9d913dc9 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FileManagementRemoteServiceConsts.cs @@ -0,0 +1,8 @@ +namespace Lion.AbpPro.FileManagement; + +public class FileManagementRemoteServiceConsts +{ + public const string RemoteServiceName = "FileManagement"; + + public const string ModuleName = "fileManagement"; +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/CreateFileInput.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/CreateFileInput.cs new file mode 100644 index 00000000..6e384bdb --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/CreateFileInput.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.DataAnnotations; + +namespace Lion.AbpPro.FileManagement.Files.Dto; + +public class CreateFileInput +{ + [Required(ErrorMessage = "文件名不能为空")] public string FileName { get; set; } + + [Required(ErrorMessage = "文件地址不能为空")] public string FilePath { get; set; } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/FileTokenOutput.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/FileTokenOutput.cs new file mode 100644 index 00000000..b480cc29 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/FileTokenOutput.cs @@ -0,0 +1,19 @@ +namespace Lion.AbpPro.FileManagement.Files.Dto; + +public class FileTokenOutput +{ + public string AccessKeyId { get; set; } + + public string AccessKeySecret { get; set; } + + public string Token { get; set; } + + /// + /// 过期时间 + /// + public string Expiration { get; set; } + + public string Bucket { get; set; } + + public string Region { get; set; } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/PagingFileOutput.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/PagingFileOutput.cs new file mode 100644 index 00000000..9a8c6047 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/PagingFileOutput.cs @@ -0,0 +1,16 @@ +using System; + +namespace Lion.AbpPro.FileManagement.Files.Dto; + +public class PagingFileOutput +{ + public Guid Id { get; set; } + + public Guid? TenantId { get; set; } + + public string FileName { get; set; } + + public string FilePath { get; set; } + + public DateTime CreationTime { get; set; } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/PagingInput.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/PagingInput.cs new file mode 100644 index 00000000..4e1bd78e --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/Dto/PagingInput.cs @@ -0,0 +1,8 @@ +using Lion.AbpPro.Extension.Customs.Dtos; + +namespace Lion.AbpPro.FileManagement.Files.Dto; + +public class PagingFileInput : PagingBase +{ + public string Filter { get; set; } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/IFileAppService.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/IFileAppService.cs new file mode 100644 index 00000000..4b41d92d --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Files/IFileAppService.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Lion.AbpPro.FileManagement.Files.Dto; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace Lion.AbpPro.FileManagement.Files; + +public interface IFileAppService : IApplicationService +{ + Task GetFileTokenAsync(); + Task CreateAsync(CreateFileInput input); + + Task> PagingAsync(PagingFileInput input); +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FodyWeavers.xml b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Lion.AbpPro.FileManagement.Application.Contracts.abppkg.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Lion.AbpPro.FileManagement.Application.Contracts.abppkg.json new file mode 100644 index 00000000..49032794 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Lion.AbpPro.FileManagement.Application.Contracts.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.application-contracts" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Lion.AbpPro.FileManagement.Application.Contracts.csproj b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Lion.AbpPro.FileManagement.Application.Contracts.csproj new file mode 100644 index 00000000..0ec90282 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Lion.AbpPro.FileManagement.Application.Contracts.csproj @@ -0,0 +1,17 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Permissions/FileManagementPermissionDefinitionProvider.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Permissions/FileManagementPermissionDefinitionProvider.cs new file mode 100644 index 00000000..157b4827 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Permissions/FileManagementPermissionDefinitionProvider.cs @@ -0,0 +1,24 @@ +using Lion.AbpPro.FileManagement.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace Lion.AbpPro.FileManagement.Permissions; + +public class FileManagementPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + + var abpIdentityGroup = context.GetGroup("AbpIdentity"); + + var dataDictionaryManagement = abpIdentityGroup.AddPermission(FileManagementPermissions.FileManagement.Default, + L("Permission:FileManagement")); + dataDictionaryManagement.AddChild(FileManagementPermissions.FileManagement.Upload, L("Permission:Upload")); + //dataDictionaryManagement.AddChild(FileManagementPermissions.FileManagement.Down, L("Permission:Down")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Permissions/FileManagementPermissions.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Permissions/FileManagementPermissions.cs new file mode 100644 index 00000000..df6bf96c --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Permissions/FileManagementPermissions.cs @@ -0,0 +1,19 @@ +using Volo.Abp.Reflection; + +namespace Lion.AbpPro.FileManagement.Permissions; + +public class FileManagementPermissions +{ + public const string GroupName = "System"; + + public static class FileManagement + { + public const string Default = GroupName + ".FileManagement"; + public const string Upload = Default + ".Upload"; + public const string Down = Default + ".Down"; + } + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(FileManagementPermissions)); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Samples/ISampleAppService.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Samples/ISampleAppService.cs new file mode 100644 index 00000000..e1e50e95 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Samples/ISampleAppService.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace Lion.AbpPro.FileManagement.Samples; + +public interface ISampleAppService : IApplicationService +{ + Task GetAsync(); + + Task GetAuthorizedAsync(); +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Samples/SampleDto.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Samples/SampleDto.cs new file mode 100644 index 00000000..9848148c --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application.Contracts/Samples/SampleDto.cs @@ -0,0 +1,6 @@ +namespace Lion.AbpPro.FileManagement.Samples; + +public class SampleDto +{ + public int Value { get; set; } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FileManagementAppService.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FileManagementAppService.cs new file mode 100644 index 00000000..d6507056 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FileManagementAppService.cs @@ -0,0 +1,13 @@ +using Lion.AbpPro.FileManagement.Localization; +using Volo.Abp.Application.Services; + +namespace Lion.AbpPro.FileManagement; + +public abstract class FileManagementAppService : ApplicationService +{ + protected FileManagementAppService() + { + LocalizationResource = typeof(FileManagementResource); + ObjectMapperContext = typeof(FileManagementApplicationModule); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FileManagementApplicationAutoMapperProfile.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FileManagementApplicationAutoMapperProfile.cs new file mode 100644 index 00000000..d26d51fe --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FileManagementApplicationAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; +using Lion.AbpPro.FileManagement.Files; +using Lion.AbpPro.FileManagement.Files.Dto; + +namespace Lion.AbpPro.FileManagement; + +public class FileManagementApplicationAutoMapperProfile : Profile +{ + public FileManagementApplicationAutoMapperProfile() + { + CreateMap(); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FileManagementApplicationModule.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FileManagementApplicationModule.cs new file mode 100644 index 00000000..276250c5 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FileManagementApplicationModule.cs @@ -0,0 +1,49 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Application; +using Volo.Abp.AutoMapper; +using Volo.Abp.BlobStoring; +using Volo.Abp.BlobStoring.Aliyun; +using Volo.Abp.Modularity; + +namespace Lion.AbpPro.FileManagement; + +[DependsOn( + typeof(FileManagementDomainModule), + typeof(FileManagementApplicationContractsModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule), + typeof(AbpBlobStoringAliyunModule) +)] +public class FileManagementApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + ConfigureBlobStoringAliyun(context); + Configure(options => { options.AddMaps(true); }); + } + + private void ConfigureBlobStoringAliyun(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + + Configure(options => + { + options.Containers.ConfigureDefault(container => + { + container.UseAliyun(aliyun => + { + aliyun.AccessKeyId = + configuration.GetValue("AliYun:OSS:AccessKeyId"); + aliyun.AccessKeySecret = + configuration.GetValue("AliYun:OSS:AccessKeySecret"); + aliyun.Endpoint = configuration.GetValue("AliYun:OSS:Endpoint"); + aliyun.RegionId = configuration.GetValue("AliYun:OSS:RegionId"); + aliyun.ContainerName = + configuration.GetValue("AliYun:OSS:ContainerName"); + }); + }); + }); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Files/FileAppService.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Files/FileAppService.cs new file mode 100644 index 00000000..93352a7c --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Files/FileAppService.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Aliyun.Acs.Core; +using Aliyun.Acs.Core.Auth.Sts; +using Aliyun.Acs.Core.Profile; +using Lion.AbpPro.FileManagement.Files.Dto; +using Lion.AbpPro.FileManagement.Permissions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Configuration; +using Volo.Abp.Application.Dtos; + +namespace Lion.AbpPro.FileManagement.Files; + +[Authorize(FileManagementPermissions.FileManagement.Default)] +public class FileAppService : FileManagementAppService, IFileAppService +{ + private readonly FileManager _fileManager; + private readonly IConfiguration _configuration; + + public FileAppService(FileManager fileManager, IConfiguration configuration) + { + _fileManager = fileManager; + _configuration = configuration; + } + + public async Task GetFileTokenAsync() + { + // 如何设置 sts https://help.aliyun.com/document_detail/100624.html + var regionId = _configuration.GetValue("AliYun:OSS:RegionId"); + var accessKeyId = _configuration.GetValue("AliYun:OSS:AccessKeyId"); + var accessKeySecret = _configuration.GetValue("AliYun:OSS:AccessKeySecret"); + var profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret); + var client = new DefaultAcsClient(profile); + var request = new AssumeRoleRequest() + { + RoleArn = _configuration.GetValue("AliYun:OSS:RoleArn"), + RoleSessionName = "YH.Wms" + }; + var response = client.GetAcsResponse(request); + + var result = new FileTokenOutput() + { + AccessKeyId = response.Credentials.AccessKeyId, + AccessKeySecret = response.Credentials.AccessKeySecret, + Token = response.Credentials.SecurityToken, + Expiration = response.Credentials.Expiration, + Region = _configuration.GetValue("AliYun:OSS:RegionId"), + Bucket = _configuration.GetValue("AliYun:OSS:ContainerName"), + }; + return await Task.FromResult(result); + } + + [Authorize(FileManagementPermissions.FileManagement.Upload)] + public async Task CreateAsync(CreateFileInput input) + { + await _fileManager.CreateAsync(input.FileName, input.FilePath); + } + + public async Task> PagingAsync(PagingFileInput input) + { + var result = new PagedResultDto(); + var totalCount = await _fileManager.CountAsync(input.Filter); + result.TotalCount = totalCount; + if (totalCount <= 0) return result; + var entities = await _fileManager.PagingAsync(input.Filter, input.PageSize, + input.SkipCount); + result.Items = ObjectMapper.Map, List>(entities); + return result; + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FodyWeavers.xml b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Lion.AbpPro.FileManagement.Application.abppkg.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Lion.AbpPro.FileManagement.Application.abppkg.json new file mode 100644 index 00000000..412567ac --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Lion.AbpPro.FileManagement.Application.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.application" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Lion.AbpPro.FileManagement.Application.csproj b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Lion.AbpPro.FileManagement.Application.csproj new file mode 100644 index 00000000..adf8c17b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Lion.AbpPro.FileManagement.Application.csproj @@ -0,0 +1,18 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Samples/SampleAppService.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Samples/SampleAppService.cs new file mode 100644 index 00000000..f9f9168b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Samples/SampleAppService.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; + +namespace Lion.AbpPro.FileManagement.Samples; + +public class SampleAppService : FileManagementAppService, ISampleAppService +{ + public Task GetAsync() + { + return Task.FromResult( + new SampleDto + { + Value = 42 + } + ); + } + + [Authorize] + public Task GetAuthorizedAsync() + { + return Task.FromResult( + new SampleDto + { + Value = 42 + } + ); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FileManagementDomainSharedModule.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FileManagementDomainSharedModule.cs new file mode 100644 index 00000000..397f28f1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FileManagementDomainSharedModule.cs @@ -0,0 +1,30 @@ +using Lion.AbpPro.FileManagement.Localization; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.Validation; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace Lion.AbpPro.FileManagement; + +[DependsOn( + typeof(AbpValidationModule) +)] +public class FileManagementDomainSharedModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { options.FileSets.AddEmbedded(); }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/FileManagement"); + }); + + Configure(options => { options.MapCodeNamespace("FileManagement", typeof(FileManagementResource)); }); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FileManagementErrorCodes.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FileManagementErrorCodes.cs new file mode 100644 index 00000000..6e4df5ce --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FileManagementErrorCodes.cs @@ -0,0 +1,6 @@ +namespace Lion.AbpPro.FileManagement; + +public static class FileManagementErrorCodes +{ + //Add your business exception error codes here... +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FodyWeavers.xml b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.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/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Lion.AbpPro.FileManagement.Domain.Shared.abppkg.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Lion.AbpPro.FileManagement.Domain.Shared.abppkg.json new file mode 100644 index 00000000..8b3de05f --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Lion.AbpPro.FileManagement.Domain.Shared.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.domain-shared" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Lion.AbpPro.FileManagement.Domain.Shared.csproj b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Lion.AbpPro.FileManagement.Domain.Shared.csproj new file mode 100644 index 00000000..412309d7 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Lion.AbpPro.FileManagement.Domain.Shared.csproj @@ -0,0 +1,24 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + true + + + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/ar.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/ar.json new file mode 100644 index 00000000..9b79f207 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/ar.json @@ -0,0 +1,7 @@ +{ + "culture": "ar", + "texts": { + "MyAccount": "إدارة ملفى", + "SamplePageMessage": "صفحة نموذجية للوحدة النمطية FileManagement" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/cs.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/cs.json new file mode 100644 index 00000000..a48d0d3e --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/cs.json @@ -0,0 +1,7 @@ +{ + "culture": "cs", + "texts": { + "MyAccount": "Spravovat profil", + "SamplePageMessage": "Ukázková stránka pro modul FileManagement" + } +} diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/de-DE.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/de-DE.json new file mode 100644 index 00000000..aebffd02 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/de-DE.json @@ -0,0 +1,7 @@ +{ + "culture": "de-DE", + "texts": { + "MyAccount": "Mein Konto", + "SamplePageMessage": "Eine Beispielseite für das Modul FileManagementModul" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/en-GB.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/en-GB.json new file mode 100644 index 00000000..83d0b21f --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/en-GB.json @@ -0,0 +1,7 @@ +{ + "culture": "en-GB", + "texts": { + "MyAccount": "My account", + "SamplePageMessage": "A sample page for the FileManagement module" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/en.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/en.json new file mode 100644 index 00000000..21c325ca --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/en.json @@ -0,0 +1,10 @@ +{ + "culture": "en", + "texts": { + "MyAccount": "My account", + "SamplePageMessage": "A sample page for the FileManagement module", + "Permission:FileManagement": "FileManagement", + "Permission:Upload": "Upload", + "Permission:Down": "Down" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/es.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/es.json new file mode 100644 index 00000000..fdda0495 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/es.json @@ -0,0 +1,7 @@ +{ + "culture": "es", + "texts": { + "MyAccount": "Mi cuenta", + "SamplePageMessage": "Una página de ejemplo para el módulo FileManagement " + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/fi.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/fi.json new file mode 100644 index 00000000..5a5f164b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/fi.json @@ -0,0 +1,7 @@ +{ + "culture": "fi", + "texts": { + "MyAccount": "Tilini", + "SamplePageMessage": "Esimerkkisivu FileManagement-moduulille" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/fr.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/fr.json new file mode 100644 index 00000000..f7147595 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/fr.json @@ -0,0 +1,7 @@ +{ + "culture": "fr", + "texts": { + "MyAccount": "Mon compte", + "SamplePageMessage": "Exemple de page pour le module FileManagement" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/hi.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/hi.json new file mode 100644 index 00000000..4c136691 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/hi.json @@ -0,0 +1,7 @@ +{ + "culture": "hi", + "texts": { + "MyAccount": "मेरा खाता", + "SamplePageMessage": "FileManagement मॉड्यूल के लिए एक नमूना पृष्ठ" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/hu.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/hu.json new file mode 100644 index 00000000..fcce8147 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/hu.json @@ -0,0 +1,7 @@ +{ + "culture": "hu", + "texts": { + "MyAccount": "A fiókom", + "SamplePageMessage": "Mintaoldal a FileManagement modulhoz" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/is.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/is.json new file mode 100644 index 00000000..5641a52a --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/is.json @@ -0,0 +1,7 @@ +{ + "culture": "is", + "texts": { + "MyAccount": "Minn aðgangur", + "SamplePageMessage": "Dæmi um síðu fyrir FileManagement eininguna" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/it.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/it.json new file mode 100644 index 00000000..7ece8eae --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/it.json @@ -0,0 +1,7 @@ +{ + "culture": "it", + "texts": { + "MyAccount": "Il mio conto", + "SamplePageMessage": "Una pagina di esempio per il modulo FileManagement" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/nl.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/nl.json new file mode 100644 index 00000000..593512cb --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/nl.json @@ -0,0 +1,7 @@ +{ + "culture": "nl", + "texts": { + "MyAccount": "Mijn rekening", + "SamplePageMessage": "Een voorbeeldpagina voor de FileManagement module" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/pl-PL.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/pl-PL.json new file mode 100644 index 00000000..a073c43c --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/pl-PL.json @@ -0,0 +1,5 @@ +{ + "culture": "pl-PL", + "texts": { + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/pt-BR.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/pt-BR.json new file mode 100644 index 00000000..2012b4c1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/pt-BR.json @@ -0,0 +1,5 @@ +{ + "culture": "pt-BR", + "texts": { + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/ro-RO.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/ro-RO.json new file mode 100644 index 00000000..333cba28 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/ro-RO.json @@ -0,0 +1,7 @@ +{ + "culture": "ro-RO", + "texts": { + "MyAccount": "Contul meu", + "SamplePageMessage": "Un exemplu de pagină pentru modululul FileManagement" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/sk.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/sk.json new file mode 100644 index 00000000..017a42c7 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/sk.json @@ -0,0 +1,6 @@ +{ + "culture": "sk", + "texts": { + "SamplePageMessage": "Ukážka stránky pre modul FileManagement" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/sl.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/sl.json new file mode 100644 index 00000000..d24eacb1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/sl.json @@ -0,0 +1,6 @@ +{ + "culture": "sl", + "texts": { + "MyAccount": "Moj račun" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/tr.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/tr.json new file mode 100644 index 00000000..d4f3e45c --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/tr.json @@ -0,0 +1,7 @@ +{ + "culture": "tr", + "texts": { + "MyAccount": "Hesabım", + "SamplePageMessage": "FileManagement modulünden örnek bir sayfa" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/vi.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/vi.json new file mode 100644 index 00000000..70fc26c8 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/vi.json @@ -0,0 +1,5 @@ +{ + "culture": "vi", + "texts": { + } +} diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/zh-Hans.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/zh-Hans.json new file mode 100644 index 00000000..9b1c8d60 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/zh-Hans.json @@ -0,0 +1,10 @@ +{ + "culture": "zh-Hans", + "texts": { + "MyAccount": "我的账户", + "SamplePageMessage": "FileManagement模块的示例页面", + "Permission:FileManagement": "文件管理", + "Permission:Upload": "上传", + "Permission:Down": "下载" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/zh-Hant.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/zh-Hant.json new file mode 100644 index 00000000..c41aaf68 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagement/zh-Hant.json @@ -0,0 +1,6 @@ +{ + "culture": "zh-Hant", + "texts": { + "MyAccount": "我的賬戶" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagementResource.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagementResource.cs new file mode 100644 index 00000000..959dd88e --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain.Shared/Localization/FileManagementResource.cs @@ -0,0 +1,8 @@ +using Volo.Abp.Localization; + +namespace Lion.AbpPro.FileManagement.Localization; + +[LocalizationResourceName("FileManagement")] +public class FileManagementResource +{ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Data/FileManagementDbMigrationService.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Data/FileManagementDbMigrationService.cs new file mode 100644 index 00000000..6fa5075a --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Data/FileManagementDbMigrationService.cs @@ -0,0 +1,170 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; + +namespace Lion.AbpPro.FileManagement.Data; + +public class FileManagementDbMigrationService : ITransientDependency +{ + private readonly IDataSeeder _dataSeeder; + private readonly IEnumerable _dbSchemaMigrators; + + public FileManagementDbMigrationService( + IDataSeeder dataSeeder, + IEnumerable dbSchemaMigrators) + { + _dataSeeder = dataSeeder; + _dbSchemaMigrators = dbSchemaMigrators; + Logger = NullLogger.Instance; + } + + public ILogger Logger { get; set; } + + public async Task MigrateAsync() + { + var initialMigrationAdded = AddInitialMigrationIfNotExist(); + + if (initialMigrationAdded) + { + return; + } + + Logger.LogInformation("Started database migrations..."); + await MigrateDatabaseSchemaAsync(); + await SeedDataAsync(); + Logger.LogInformation("Successfully completed host database migrations."); + Logger.LogInformation("You can safely end this process..."); + } + + private async Task MigrateDatabaseSchemaAsync() + { + foreach (var migrator in _dbSchemaMigrators) + { + await migrator.MigrateAsync(); + } + } + + private async Task SeedDataAsync() + { + await _dataSeeder.SeedAsync(new DataSeedContext()); + } + + private bool AddInitialMigrationIfNotExist() + { + try + { + if (!DbMigrationsProjectExists()) + { + return false; + } + } + catch (Exception) + { + return false; + } + + try + { + if (!MigrationsFolderExists()) + { + AddInitialMigration(); + return true; + } + + return false; + } + catch (Exception e) + { + Logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message); + return false; + } + } + + private bool DbMigrationsProjectExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return dbMigrationsProjectFolder != null; + } + + private bool MigrationsFolderExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); + } + + private void AddInitialMigration() + { + Logger.LogInformation("Creating initial migration..."); + + string argumentPrefix; + string fileName; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || + RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + argumentPrefix = "-c"; + fileName = "/bin/bash"; + } + else + { + argumentPrefix = "/C"; + fileName = "cmd.exe"; + } + + var procStartInfo = new ProcessStartInfo(fileName, + $"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\"\"" + ); + + try + { + Process.Start(procStartInfo); + } + catch (Exception) + { + throw new Exception("Couldn't run ABP CLI..."); + } + } + + private string GetEntityFrameworkCoreProjectFolderPath() + { + var slnDirectoryPath = GetSolutionDirectoryPath(); + + if (slnDirectoryPath == null) + { + throw new Exception("Solution folder not found!"); + } + + var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src"); + + return Directory.GetDirectories(srcDirectoryPath) + .FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore")); + } + + private string GetSolutionDirectoryPath() + { + var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (Directory.GetParent(currentDirectory.FullName) != null) + { + currentDirectory = Directory.GetParent(currentDirectory.FullName); + + if (Directory.GetFiles(currentDirectory.FullName) + .FirstOrDefault(f => f.EndsWith(".sln")) != null) + { + return currentDirectory.FullName; + } + } + + return null; + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Data/IFileManagementDbSchemaMigrator.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Data/IFileManagementDbSchemaMigrator.cs new file mode 100644 index 00000000..9202465b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Data/IFileManagementDbSchemaMigrator.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace Lion.AbpPro.FileManagement.Data; + +public interface IFileManagementDbSchemaMigrator +{ + Task MigrateAsync(); +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Data/NullFileManagementDbSchemaMigrator.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Data/NullFileManagementDbSchemaMigrator.cs new file mode 100644 index 00000000..ca9021ef --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Data/NullFileManagementDbSchemaMigrator.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Lion.AbpPro.FileManagement.Data; + +public class NullFileManagementDbSchemaMigrator : IFileManagementDbSchemaMigrator, ITransientDependency +{ + public Task MigrateAsync() + { + return Task.CompletedTask; + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FileManagementDbProperties.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FileManagementDbProperties.cs new file mode 100644 index 00000000..42d55254 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FileManagementDbProperties.cs @@ -0,0 +1,9 @@ +namespace Lion.AbpPro.FileManagement; + +public static class FileManagementDbProperties +{ + public const string ConnectionStringName = "FileManagement"; + public static string DbTablePrefix { get; set; } = ""; + + public static string DbSchema { get; set; } = null; +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FileManagementDomainModule.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FileManagementDomainModule.cs new file mode 100644 index 00000000..b5a8543d --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FileManagementDomainModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Domain; +using Volo.Abp.Modularity; + +namespace Lion.AbpPro.FileManagement; + +[DependsOn( + typeof(AbpDddDomainModule), + typeof(FileManagementDomainSharedModule) +)] +public class FileManagementDomainModule : AbpModule +{ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/Aggregates/File.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/Aggregates/File.cs new file mode 100644 index 00000000..18023245 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/Aggregates/File.cs @@ -0,0 +1,26 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Lion.AbpPro.FileManagement.Files; + +public class File: FullAuditedAggregateRoot, IMultiTenant +{ + public Guid? TenantId { get; private set; } + + public string FileName { get; private set; } + + public string FilePath { get; private set; } + + private File() + { + + } + + public File(Guid id, Guid? tenantId, string fileName, string filePath) : base(id) + { + TenantId = tenantId; + FileName = fileName; + FilePath = filePath; + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/FileManager.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/FileManager.cs new file mode 100644 index 00000000..f9376592 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/FileManager.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Domain.Services; + +namespace Lion.AbpPro.FileManagement.Files; + +public class FileManager : DomainService +{ + private readonly IFileRepository _fileRepository; + + public FileManager(IFileRepository fileRepository) + { + _fileRepository = fileRepository; + } + + public async Task CreateAsync(string fileName, string filePath) + { + Check.NotNullOrWhiteSpace(fileName, nameof(fileName)); + Check.NotNullOrWhiteSpace(filePath, nameof(filePath)); + var entity = new File(GuidGenerator.Create(), CurrentTenant.Id, fileName, filePath); + await _fileRepository.InsertAsync(entity); + } + + public async Task> PagingAsync( + string filter = null, + int maxResultCount = 10, + int skipCount = 0) + { + return await _fileRepository.GetPagingListAsync(filter, maxResultCount, skipCount); + } + + + public async Task CountAsync(string filter = null) + { + return await _fileRepository.GetPagingCountAsync(filter); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/IFileRepository.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/IFileRepository.cs new file mode 100644 index 00000000..a28f53fa --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/IFileRepository.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; + +namespace Lion.AbpPro.FileManagement.Files; + +public interface IFileRepository: IRepository +{ + Task> GetPagingListAsync( + string filter = null, + int maxResultCount = 10, + int skipCount = 0, + CancellationToken cancellationToken = default); + + Task GetPagingCountAsync(string filter = null, + CancellationToken cancellationToken = default); +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FodyWeavers.xml b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Lion.AbpPro.FileManagement.Domain.abppkg.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Lion.AbpPro.FileManagement.Domain.abppkg.json new file mode 100644 index 00000000..1d574efe --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Lion.AbpPro.FileManagement.Domain.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.domain" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Lion.AbpPro.FileManagement.Domain.csproj b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Lion.AbpPro.FileManagement.Domain.csproj new file mode 100644 index 00000000..10571970 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Lion.AbpPro.FileManagement.Domain.csproj @@ -0,0 +1,15 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Settings/FileManagementSettingDefinitionProvider.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Settings/FileManagementSettingDefinitionProvider.cs new file mode 100644 index 00000000..1fa5f8ed --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Settings/FileManagementSettingDefinitionProvider.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Settings; + +namespace Lion.AbpPro.FileManagement.Settings; + +public class FileManagementSettingDefinitionProvider : SettingDefinitionProvider +{ + public override void Define(ISettingDefinitionContext context) + { + /* Define module settings here. + * Use names from FileManagementSettings class. + */ + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Settings/FileManagementSettings.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Settings/FileManagementSettings.cs new file mode 100644 index 00000000..87853c24 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Settings/FileManagementSettings.cs @@ -0,0 +1,10 @@ +namespace Lion.AbpPro.FileManagement.Settings; + +public static class FileManagementSettings +{ + public const string GroupName = "FileManagement"; + + /* Add constants for setting names. Example: + * public const string MySettingName = GroupName + ".MySettingName"; + */ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/FileManagementDbContext.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/FileManagementDbContext.cs new file mode 100644 index 00000000..bd99e20d --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/FileManagementDbContext.cs @@ -0,0 +1,28 @@ +using Lion.AbpPro.FileManagement.Files; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace Lion.AbpPro.FileManagement.EntityFrameworkCore; + +[ConnectionStringName(FileManagementDbProperties.ConnectionStringName)] +public class FileManagementDbContext : AbpDbContext, IFileManagementDbContext +{ + /* Add DbSet for each Aggregate Root here. Example: + * public DbSet Questions { get; set; } + */ + + public FileManagementDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureFileManagement(); + } + + public DbSet Files { get; } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/FileManagementDbContextModelCreatingExtensions.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/FileManagementDbContextModelCreatingExtensions.cs new file mode 100644 index 00000000..2c04b4c1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/FileManagementDbContextModelCreatingExtensions.cs @@ -0,0 +1,24 @@ +using Lion.AbpPro.FileManagement.Files; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace Lion.AbpPro.FileManagement.EntityFrameworkCore; + +public static class FileManagementDbContextModelCreatingExtensions +{ + public static void ConfigureFileManagement( + this ModelBuilder builder) + { + Check.NotNull(builder, nameof(builder)); + + + builder.Entity(b => + { + b.ToTable(FileManagementDbProperties.DbTablePrefix + nameof(File), FileManagementDbProperties.DbSchema); + b.HasIndex(q => q.FileName); + b.HasIndex(q => q.CreationTime); + b.ConfigureByConvention(); + }); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/FileManagementEntityFrameworkCoreModule.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/FileManagementEntityFrameworkCoreModule.cs new file mode 100644 index 00000000..64046057 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/FileManagementEntityFrameworkCoreModule.cs @@ -0,0 +1,31 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.MySQL; +using Volo.Abp.Modularity; + +namespace Lion.AbpPro.FileManagement.EntityFrameworkCore; + +[DependsOn( + typeof(FileManagementDomainModule), + typeof(AbpEntityFrameworkCoreMySQLModule) +)] +public class FileManagementEntityFrameworkCoreModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + options.AddDefaultRepositories(true); + }); + + Configure(options => + { + /* The main point to change your DBMS. + * See also OperationsMigrationsDbContextFactory for EF Core tooling. */ + options.UseMySQL(); + }); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/Files/EfCoreFileRepository.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/Files/EfCoreFileRepository.cs new file mode 100644 index 00000000..a9d64ca9 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/Files/EfCoreFileRepository.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Lion.AbpPro.FileManagement.Files; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Lion.AbpPro.FileManagement.EntityFrameworkCore.Files; + +public class EfCoreFileRepository: EfCoreRepository, IFileRepository +{ + public EfCoreFileRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public async Task> GetPagingListAsync( + string filter = null, + int maxResultCount = 10, + int skipCount = 0, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .WhereIf(!filter.IsNullOrWhiteSpace(), + e => (e.FileName.Contains(filter))) + .OrderByDescending(e => e.CreationTime) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } + + public async Task GetPagingCountAsync(string filter = null, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .WhereIf(!filter.IsNullOrWhiteSpace(), + e => (e.FileName.Contains(filter))) + .CountAsync(cancellationToken: cancellationToken); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/IFileManagementDbContext.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/IFileManagementDbContext.cs new file mode 100644 index 00000000..dc15f179 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/EntityFrameworkCore/IFileManagementDbContext.cs @@ -0,0 +1,15 @@ +using Lion.AbpPro.FileManagement.Files; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace Lion.AbpPro.FileManagement.EntityFrameworkCore; + +[ConnectionStringName(FileManagementDbProperties.ConnectionStringName)] +public interface IFileManagementDbContext : IEfCoreDbContext +{ + /* Add DbSet for each Aggregate Root here. Example: + * DbSet Questions { get; } + */ + DbSet Files { get; } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/FodyWeavers.xml b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/Lion.AbpPro.FileManagement.EntityFrameworkCore.abppkg.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/Lion.AbpPro.FileManagement.EntityFrameworkCore.abppkg.json new file mode 100644 index 00000000..e1c64f01 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/Lion.AbpPro.FileManagement.EntityFrameworkCore.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.ef" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/Lion.AbpPro.FileManagement.EntityFrameworkCore.csproj b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/Lion.AbpPro.FileManagement.EntityFrameworkCore.csproj new file mode 100644 index 00000000..e35fb1ab --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.EntityFrameworkCore/Lion.AbpPro.FileManagement.EntityFrameworkCore.csproj @@ -0,0 +1,21 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + + + runtime; build; native; contentfiles; analyzers + compile; contentFiles; build; buildMultitargeting; buildTransitive; analyzers; native + + + diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/FileManagementHttpApiClientModule.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/FileManagementHttpApiClientModule.cs new file mode 100644 index 00000000..3087b7b9 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/FileManagementHttpApiClientModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace Lion.AbpPro.FileManagement; + +[DependsOn( + typeof(FileManagementApplicationContractsModule), + typeof(AbpHttpClientModule))] +public class FileManagementHttpApiClientModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(FileManagementApplicationContractsModule).Assembly, + FileManagementRemoteServiceConsts.RemoteServiceName + ); + + Configure(options => { options.FileSets.AddEmbedded(); }); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/FodyWeavers.xml b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/Lion.AbpPro.FileManagement.HttpApi.Client.abppkg.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/Lion.AbpPro.FileManagement.HttpApi.Client.abppkg.json new file mode 100644 index 00000000..7deef5e3 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/Lion.AbpPro.FileManagement.HttpApi.Client.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.http-api-client" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/Lion.AbpPro.FileManagement.HttpApi.Client.csproj b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/Lion.AbpPro.FileManagement.HttpApi.Client.csproj new file mode 100644 index 00000000..53fc8733 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi.Client/Lion.AbpPro.FileManagement.HttpApi.Client.csproj @@ -0,0 +1,20 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FileManagementController.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FileManagementController.cs new file mode 100644 index 00000000..3cdd3969 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FileManagementController.cs @@ -0,0 +1,12 @@ +using Lion.AbpPro.FileManagement.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace Lion.AbpPro.FileManagement; + +public abstract class FileManagementController : AbpControllerBase +{ + protected FileManagementController() + { + LocalizationResource = typeof(FileManagementResource); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FileManagementHttpApiModule.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FileManagementHttpApiModule.cs new file mode 100644 index 00000000..a3d58021 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FileManagementHttpApiModule.cs @@ -0,0 +1,29 @@ +using Localization.Resources.AbpUi; +using Microsoft.Extensions.DependencyInjection; +using Lion.AbpPro.FileManagement.Localization; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; + +namespace Lion.AbpPro.FileManagement; + +[DependsOn( + typeof(FileManagementApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] +public class FileManagementHttpApiModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => { mvcBuilder.AddApplicationPartIfNotExists(typeof(FileManagementHttpApiModule).Assembly); }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Files/FileController.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Files/FileController.cs new file mode 100644 index 00000000..2ac2b83b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Files/FileController.cs @@ -0,0 +1,39 @@ +using System.Threading.Tasks; +using Lion.AbpPro.FileManagement.Files.Dto; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Volo.Abp.Application.Dtos; + +namespace Lion.AbpPro.FileManagement.Files; + +[Route("Files")] +public class FileController: FileManagementController, IFileAppService +{ + private readonly IFileAppService _fileAppService; + + public FileController(IFileAppService fileAppService) + { + _fileAppService = fileAppService; + } + + [HttpGet("getFileToken")] + [SwaggerOperation(summary: "获取上传文件临时Token", Tags = new[] { "Files" })] + public Task GetFileTokenAsync() + { + return _fileAppService.GetFileTokenAsync(); + } + + [HttpPost("create")] + [SwaggerOperation(summary: "创建文件", Tags = new[] { "Files" })] + public Task CreateAsync(CreateFileInput input) + { + return _fileAppService.CreateAsync(input); + } + + [HttpPost("page")] + [SwaggerOperation(summary: "分页查询", Tags = new[] { "Files" })] + public Task> PagingAsync(PagingFileInput input) + { + return _fileAppService.PagingAsync(input); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FodyWeavers.xml b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Lion.AbpPro.FileManagement.HttpApi.abppkg.json b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Lion.AbpPro.FileManagement.HttpApi.abppkg.json new file mode 100644 index 00000000..515bfe64 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Lion.AbpPro.FileManagement.HttpApi.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.http-api" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Lion.AbpPro.FileManagement.HttpApi.csproj b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Lion.AbpPro.FileManagement.HttpApi.csproj new file mode 100644 index 00000000..8c170231 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Lion.AbpPro.FileManagement.HttpApi.csproj @@ -0,0 +1,16 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Samples/SampleController.cs b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Samples/SampleController.cs new file mode 100644 index 00000000..9e238f67 --- /dev/null +++ b/aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.HttpApi/Samples/SampleController.cs @@ -0,0 +1,33 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; + +namespace Lion.AbpPro.FileManagement.Samples; + +[Area(FileManagementRemoteServiceConsts.ModuleName)] +[RemoteService(Name = FileManagementRemoteServiceConsts.RemoteServiceName)] +[Route("api/FileManagement/sample")] +public class SampleController : FileManagementController, ISampleAppService +{ + private readonly ISampleAppService _sampleAppService; + + public SampleController(ISampleAppService sampleAppService) + { + _sampleAppService = sampleAppService; + } + + [HttpGet] + public async Task GetAsync() + { + return await _sampleAppService.GetAsync(); + } + + [HttpGet] + [Route("authorized")] + [Authorize] + public async Task GetAuthorizedAsync() + { + return await _sampleAppService.GetAsync(); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FileManagementApplicationTestBase.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FileManagementApplicationTestBase.cs new file mode 100644 index 00000000..29dbd89b --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FileManagementApplicationTestBase.cs @@ -0,0 +1,8 @@ +namespace Lion.AbpPro.FileManagement; + +/* Inherit from this class for your application layer tests. + * See SampleAppService_Tests for example. + */ +public abstract class FileManagementApplicationTestBase : FileManagementTestBase +{ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FileManagementApplicationTestModule.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FileManagementApplicationTestModule.cs new file mode 100644 index 00000000..a7f4204d --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FileManagementApplicationTestModule.cs @@ -0,0 +1,11 @@ +using Volo.Abp.Modularity; + +namespace Lion.AbpPro.FileManagement; + +[DependsOn( + typeof(FileManagementApplicationModule), + typeof(FileManagementDomainTestModule) +)] +public class FileManagementApplicationTestModule : AbpModule +{ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FodyWeavers.xml b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/Lion.AbpPro.FileManagement.Application.Tests.abppkg.json b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/Lion.AbpPro.FileManagement.Application.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/Lion.AbpPro.FileManagement.Application.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/Lion.AbpPro.FileManagement.Application.Tests.csproj b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/Lion.AbpPro.FileManagement.Application.Tests.csproj new file mode 100644 index 00000000..3fb48ce5 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/Lion.AbpPro.FileManagement.Application.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/Samples/SampleAppService_Tests.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/Samples/SampleAppService_Tests.cs new file mode 100644 index 00000000..16b05bf4 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Application.Tests/Samples/SampleAppService_Tests.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace Lion.AbpPro.FileManagement.Samples; + +public class SampleAppService_Tests : FileManagementApplicationTestBase +{ + private readonly ISampleAppService _sampleAppService; + + public SampleAppService_Tests() + { + _sampleAppService = GetRequiredService(); + } + + [Fact] + public async Task GetAsync() + { + var result = await _sampleAppService.GetAsync(); + result.Value.ShouldBe(42); + } + + [Fact] + public async Task GetAuthorizedAsync() + { + var result = await _sampleAppService.GetAuthorizedAsync(); + result.Value.ShouldBe(42); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FileManagementDomainTestBase.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FileManagementDomainTestBase.cs new file mode 100644 index 00000000..e5b51119 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FileManagementDomainTestBase.cs @@ -0,0 +1,8 @@ +namespace Lion.AbpPro.FileManagement; + +/* Inherit from this class for your domain layer tests. + * See SampleManager_Tests for example. + */ +public abstract class FileManagementDomainTestBase : FileManagementTestBase +{ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FileManagementDomainTestModule.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FileManagementDomainTestModule.cs new file mode 100644 index 00000000..097abc4d --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FileManagementDomainTestModule.cs @@ -0,0 +1,15 @@ +using Lion.AbpPro.FileManagement.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace Lion.AbpPro.FileManagement; + +/* 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(FileManagementEntityFrameworkCoreTestModule) +)] +public class FileManagementDomainTestModule : AbpModule +{ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FodyWeavers.xml b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/Lion.AbpPro.FileManagement.Domain.Tests.abppkg.json b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/Lion.AbpPro.FileManagement.Domain.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/Lion.AbpPro.FileManagement.Domain.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/Lion.AbpPro.FileManagement.Domain.Tests.csproj b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/Lion.AbpPro.FileManagement.Domain.Tests.csproj new file mode 100644 index 00000000..fbd77c2e --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/Lion.AbpPro.FileManagement.Domain.Tests.csproj @@ -0,0 +1,15 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/Samples/SampleManager_Tests.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/Samples/SampleManager_Tests.cs new file mode 100644 index 00000000..76cfb167 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.Domain.Tests/Samples/SampleManager_Tests.cs @@ -0,0 +1,6 @@ +namespace Lion.AbpPro.FileManagement.Samples; + +public class SampleManager_Tests : FileManagementDomainTestBase +{ + //private readonly SampleManager _sampleManager; +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/FileManagementEntityFrameworkCoreTestBase.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/FileManagementEntityFrameworkCoreTestBase.cs new file mode 100644 index 00000000..70030062 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/FileManagementEntityFrameworkCoreTestBase.cs @@ -0,0 +1,8 @@ +namespace Lion.AbpPro.FileManagement.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 FileManagementEntityFrameworkCoreTestBase : FileManagementTestBase +{ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/FileManagementEntityFrameworkCoreTestModule.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/FileManagementEntityFrameworkCoreTestModule.cs new file mode 100644 index 00000000..5156ff44 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/FileManagementEntityFrameworkCoreTestModule.cs @@ -0,0 +1,42 @@ +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 Lion.AbpPro.FileManagement.EntityFrameworkCore; + +[DependsOn( + typeof(FileManagementTestBaseModule), + typeof(FileManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) +)] +public class FileManagementEntityFrameworkCoreTestModule : 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 FileManagementDbContext( + new DbContextOptionsBuilder().UseSqlite(connection).Options + ).GetService().CreateTables(); + + return connection; + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs new file mode 100644 index 00000000..68920801 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs @@ -0,0 +1,11 @@ +using Lion.AbpPro.FileManagement.Samples; + +namespace Lion.AbpPro.FileManagement.EntityFrameworkCore.Samples; + +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 EF core. + */ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/FodyWeavers.xml b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests.abppkg.json b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests.csproj b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests.csproj new file mode 100644 index 00000000..f99c7f76 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests/Lion.AbpPro.FileManagement.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,18 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 00000000..8cf2935b --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,156 @@ +using System; +using System.Net.Http; +using System.Threading.Tasks; +using IdentityModel.Client; +using Microsoft.Extensions.Configuration; +using Lion.AbpPro.FileManagement.Samples; +using Volo.Abp.DependencyInjection; +using Volo.Abp.IdentityModel; + +namespace Lion.AbpPro.FileManagement +{ + public class ClientDemoService : ITransientDependency + { + private readonly ISampleAppService _sampleAppService; + private readonly IIdentityModelAuthenticationService _authenticationService; + private readonly IConfiguration _configuration; + + public ClientDemoService( + ISampleAppService sampleAppService, + IIdentityModelAuthenticationService authenticationService, + IConfiguration configuration) + { + _sampleAppService = sampleAppService; + _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)} *****"); + + var result = await _sampleAppService.GetAsync(); + Console.WriteLine("Result: " + result.Value); + + result = await _sampleAppService.GetAuthorizedAsync(); + Console.WriteLine("Result (authorized): " + result.Value); + } + + /* 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:FileManagement:BaseUrl"] + + "api/FileManagement/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:FileManagement:BaseUrl"] + + "api/FileManagement/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/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 00000000..67bfd1b2 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,38 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace Lion.AbpPro.FileManagement.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); + options.UseAutofac(); + })) + { + application.Initialize(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + application.Shutdown(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; + } +} diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/FileManagementConsoleApiClientModule.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/FileManagementConsoleApiClientModule.cs new file mode 100644 index 00000000..9239a80d --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/FileManagementConsoleApiClientModule.cs @@ -0,0 +1,16 @@ +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace Lion.AbpPro.FileManagement +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(FileManagementHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] + public class FileManagementConsoleApiClientModule : AbpModule + { + + } +} diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp.abppkg.json b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp.abppkg.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp.abppkg.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp.csproj b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 00000000..c9ea3f90 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,32 @@ + + + + Exe + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/Program.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 00000000..2a2fecad --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp +{ + class Program + { + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); + } +} diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/appsettings.json b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 00000000..411c9b8e --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,21 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44384/" + }, + "FileManagement": { + "BaseUrl": "https://localhost:44373/" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "FileManagement_App", + "ClientSecret": "1q2w3e*", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44384/", + "Scope": "FileManagement" + } + } +} diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FileManagementDataSeedContributor.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FileManagementDataSeedContributor.cs new file mode 100644 index 00000000..c2d53fe5 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FileManagementDataSeedContributor.cs @@ -0,0 +1,32 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; + +namespace Lion.AbpPro.FileManagement; + +public class FileManagementDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly ICurrentTenant _currentTenant; + private readonly IGuidGenerator _guidGenerator; + + public FileManagementDataSeedContributor( + 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; + } + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FileManagementTestBase.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FileManagementTestBase.cs new file mode 100644 index 00000000..48e17d17 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FileManagementTestBase.cs @@ -0,0 +1,59 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Testing; +using Volo.Abp.Uow; + +namespace Lion.AbpPro.FileManagement; + +/* All test classes are derived from this class, directly or indirectly. */ +public abstract class FileManagementTestBase : 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; + } + } + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FileManagementTestBaseModule.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FileManagementTestBaseModule.cs new file mode 100644 index 00000000..beeb8a70 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FileManagementTestBaseModule.cs @@ -0,0 +1,41 @@ +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 Lion.AbpPro.FileManagement; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(FileManagementDomainModule) +)] +public class FileManagementTestBaseModule : 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(); + } + }); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FodyWeavers.xml b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FodyWeavers.xml new file mode 100644 index 00000000..2ad59ce1 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FodyWeavers.xsd b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.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/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Lion.AbpPro.FileManagement.TestBase.abppkg.json b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Lion.AbpPro.FileManagement.TestBase.abppkg.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Lion.AbpPro.FileManagement.TestBase.abppkg.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Lion.AbpPro.FileManagement.TestBase.csproj b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Lion.AbpPro.FileManagement.TestBase.csproj new file mode 100644 index 00000000..b143d5a5 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Lion.AbpPro.FileManagement.TestBase.csproj @@ -0,0 +1,23 @@ + + + + + + net6.0 + Lion.AbpPro.FileManagement + + + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Samples/SampleRepository_Tests.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Samples/SampleRepository_Tests.cs new file mode 100644 index 00000000..e74cb84e --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Samples/SampleRepository_Tests.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Modularity; + +namespace Lion.AbpPro.FileManagement.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 : FileManagementTestBase + where TStartupModule : IAbpModule +{ + //private readonly ISampleRepository _sampleRepository; +} \ No newline at end of file diff --git a/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 00000000..d60a0ef7 --- /dev/null +++ b/aspnet-core/modules/FileManagement/test/Lion.AbpPro.FileManagement.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace Lion.AbpPro.FileManagement.Security; + +[Dependency(ReplaceServices = true)] +public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + private ClaimsPrincipal _principal; + + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal GetPrincipal() + { + if (_principal == null) + { + lock (this) + { + if (_principal == null) + { + _principal = new ClaimsPrincipal( + new ClaimsIdentity( + new List + { + new(AbpClaimTypes.UserId, "2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new(AbpClaimTypes.UserName, "admin"), + new(AbpClaimTypes.Email, "admin@abp.io") + } + ) + ); + } + } + } + + return _principal; + } +} \ No newline at end of file diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Extensions/SerilogToEsExtensions.cs b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Extensions/SerilogToEsExtensions.cs index 85227dc4..3f9f264c 100644 --- a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Extensions/SerilogToEsExtensions.cs +++ b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Extensions/SerilogToEsExtensions.cs @@ -17,10 +17,9 @@ namespace Lion.AbpPro.Extensions public static void SetSerilogConfiguration(LoggerConfiguration loggerConfiguration, IConfiguration configuration) { // 默认读取 configuration 中 "Serilog" 节点下的配置 - loggerConfiguration.ReadFrom.Configuration(configuration) + loggerConfiguration .ReadFrom.Configuration(configuration) - .Enrich.FromLogContext() - .WriteTo.Console(); + .Enrich.FromLogContext(); var writeToElasticSearch = configuration.GetValue("ElasticSearch:Enabled", false); diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json index 1eaa93bb..2d6eed8c 100644 --- a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json +++ b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json @@ -69,5 +69,15 @@ "Enabled": false, "Host": "http://localhost:8500", "Service": "Project-Service" + }, + "AliYun": { + "OSS": { + "AccessKeyId": "LTAI5tLkt3vvScGPVZ5qKJDc", + "AccessKeySecret": "BixV8vP5uPrbsdwjYzzsEXOPjkxPST", + "Endpoint": "oss-cn-shenzhen.aliyuncs.com", + "ContainerName": "lion-abp-pro", + "RegionId": "oss-cn-shenzhen", + "RoleArn": "acs:ram::1846393972471789:role/ramosstest" + } } } \ No newline at end of file diff --git a/aspnet-core/services/src/Lion.AbpPro.Application.Contracts/AbpProApplicationContractsModule.cs b/aspnet-core/services/src/Lion.AbpPro.Application.Contracts/AbpProApplicationContractsModule.cs index 30cb4b94..b12d855d 100644 --- a/aspnet-core/services/src/Lion.AbpPro.Application.Contracts/AbpProApplicationContractsModule.cs +++ b/aspnet-core/services/src/Lion.AbpPro.Application.Contracts/AbpProApplicationContractsModule.cs @@ -1,4 +1,5 @@ using Lion.AbpPro.DataDictionaryManagement; +using Lion.AbpPro.FileManagement; using Volo.Abp.Account; using Volo.Abp.FeatureManagement; using Volo.Abp.Identity; @@ -19,7 +20,8 @@ namespace Lion.AbpPro typeof(AbpSettingManagementApplicationContractsModule), typeof(AbpTenantManagementApplicationContractsModule), typeof(AbpObjectExtendingModule), - typeof(DataDictionaryManagementApplicationContractsModule) + typeof(DataDictionaryManagementApplicationContractsModule), + typeof(FileManagementApplicationContractsModule) )] public class AbpProApplicationContractsModule : AbpModule { diff --git a/aspnet-core/services/src/Lion.AbpPro.Application.Contracts/Lion.AbpPro.Application.Contracts.csproj b/aspnet-core/services/src/Lion.AbpPro.Application.Contracts/Lion.AbpPro.Application.Contracts.csproj index 663bbf47..66f9aeef 100644 --- a/aspnet-core/services/src/Lion.AbpPro.Application.Contracts/Lion.AbpPro.Application.Contracts.csproj +++ b/aspnet-core/services/src/Lion.AbpPro.Application.Contracts/Lion.AbpPro.Application.Contracts.csproj @@ -9,6 +9,7 @@ + diff --git a/aspnet-core/services/src/Lion.AbpPro.Application/AbpProApplicationModule.cs b/aspnet-core/services/src/Lion.AbpPro.Application/AbpProApplicationModule.cs index cd28964c..4c26c6c5 100644 --- a/aspnet-core/services/src/Lion.AbpPro.Application/AbpProApplicationModule.cs +++ b/aspnet-core/services/src/Lion.AbpPro.Application/AbpProApplicationModule.cs @@ -1,4 +1,5 @@ using Lion.AbpPro.DataDictionaryManagement; +using Lion.AbpPro.FileManagement; using Lion.AbpPro.NotificationManagement; using Volo.Abp.Account; using Volo.Abp.AuditLogging; @@ -23,7 +24,8 @@ namespace Lion.AbpPro typeof(AbpSettingManagementApplicationModule), typeof(AbpAuditLoggingDomainModule), typeof(DataDictionaryManagementApplicationModule), - typeof(NotificationManagementApplicationModule) + typeof(NotificationManagementApplicationModule), + typeof(FileManagementApplicationModule) )] public class AbpProApplicationModule : AbpModule { diff --git a/aspnet-core/services/src/Lion.AbpPro.Application/Lion.AbpPro.Application.csproj b/aspnet-core/services/src/Lion.AbpPro.Application/Lion.AbpPro.Application.csproj index e4793ac3..e983e5b8 100644 --- a/aspnet-core/services/src/Lion.AbpPro.Application/Lion.AbpPro.Application.csproj +++ b/aspnet-core/services/src/Lion.AbpPro.Application/Lion.AbpPro.Application.csproj @@ -8,6 +8,7 @@ + diff --git a/aspnet-core/services/src/Lion.AbpPro.Domain.Shared/AbpProDomainSharedModule.cs b/aspnet-core/services/src/Lion.AbpPro.Domain.Shared/AbpProDomainSharedModule.cs index 7d806745..f52d49ef 100644 --- a/aspnet-core/services/src/Lion.AbpPro.Domain.Shared/AbpProDomainSharedModule.cs +++ b/aspnet-core/services/src/Lion.AbpPro.Domain.Shared/AbpProDomainSharedModule.cs @@ -1,4 +1,5 @@ using Lion.AbpPro.DataDictionaryManagement; +using Lion.AbpPro.FileManagement; using Lion.AbpPro.Localization; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Localization; @@ -34,7 +35,8 @@ namespace Lion.AbpPro typeof(AbpPermissionManagementDomainSharedModule), typeof(AbpSettingManagementDomainSharedModule), typeof(AbpTenantManagementDomainSharedModule), - typeof(DataDictionaryManagementDomainSharedModule) + typeof(DataDictionaryManagementDomainSharedModule), + typeof(FileManagementDomainSharedModule) )] public class AbpProDomainSharedModule : AbpModule { diff --git a/aspnet-core/services/src/Lion.AbpPro.Domain.Shared/Lion.AbpPro.Domain.Shared.csproj b/aspnet-core/services/src/Lion.AbpPro.Domain.Shared/Lion.AbpPro.Domain.Shared.csproj index 5c643abf..b62f57e2 100644 --- a/aspnet-core/services/src/Lion.AbpPro.Domain.Shared/Lion.AbpPro.Domain.Shared.csproj +++ b/aspnet-core/services/src/Lion.AbpPro.Domain.Shared/Lion.AbpPro.Domain.Shared.csproj @@ -31,6 +31,7 @@ + diff --git a/aspnet-core/services/src/Lion.AbpPro.Domain/AbpProDomainModule.cs b/aspnet-core/services/src/Lion.AbpPro.Domain/AbpProDomainModule.cs index 9ae07a52..0431b72e 100644 --- a/aspnet-core/services/src/Lion.AbpPro.Domain/AbpProDomainModule.cs +++ b/aspnet-core/services/src/Lion.AbpPro.Domain/AbpProDomainModule.cs @@ -1,4 +1,5 @@ using Lion.AbpPro.DataDictionaryManagement; +using Lion.AbpPro.FileManagement; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Lion.AbpPro.MultiTenancy; @@ -31,7 +32,8 @@ namespace Lion.AbpPro typeof(AbpTenantManagementDomainModule), typeof(AbpEmailingModule), typeof(DataDictionaryManagementDomainModule), - typeof(NotificationManagementDomainModule) + typeof(NotificationManagementDomainModule), + typeof(FileManagementDomainModule) )] public class AbpProDomainModule : AbpModule { diff --git a/aspnet-core/services/src/Lion.AbpPro.Domain/Lion.AbpPro.Domain.csproj b/aspnet-core/services/src/Lion.AbpPro.Domain/Lion.AbpPro.Domain.csproj index 4d42b362..879531e9 100644 --- a/aspnet-core/services/src/Lion.AbpPro.Domain/Lion.AbpPro.Domain.csproj +++ b/aspnet-core/services/src/Lion.AbpPro.Domain/Lion.AbpPro.Domain.csproj @@ -9,6 +9,7 @@ + diff --git a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/EntityFrameworkCore/AbpProDbContext.cs b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/EntityFrameworkCore/AbpProDbContext.cs index 51ae49d9..8da8d94a 100644 --- a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/EntityFrameworkCore/AbpProDbContext.cs +++ b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/EntityFrameworkCore/AbpProDbContext.cs @@ -1,5 +1,7 @@ using Lion.AbpPro.DataDictionaryManagement; using Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore; +using Lion.AbpPro.FileManagement.EntityFrameworkCore; +using Lion.AbpPro.FileManagement.Files; using Lion.AbpPro.NotificationManagement; using Lion.AbpPro.NotificationManagement.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; @@ -42,7 +44,8 @@ namespace Lion.AbpPro.EntityFrameworkCore ISettingManagementDbContext, ITenantManagementDbContext, IBackgroundJobsDbContext, - IAuditLoggingDbContext + IAuditLoggingDbContext, + IFileManagementDbContext { public DbSet Users { get; } public DbSet Roles { get; } @@ -57,7 +60,8 @@ namespace Lion.AbpPro.EntityFrameworkCore public DbSet TenantConnectionStrings { get; } public DbSet BackgroundJobs { get; } public DbSet AuditLogs { get; } - + public DbSet Files { get; } + /* Add DbSet properties for your Aggregate Roots / Entities here. * Also map them inside AbpProDbContextModelCreatingExtensions.ConfigureAbpPro */ @@ -95,6 +99,10 @@ namespace Lion.AbpPro.EntityFrameworkCore // 消息通知 builder.ConfigureNotificationManagement(); + + // 文件管理 + builder.ConfigureFileManagement(); } + } } \ No newline at end of file diff --git a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/EntityFrameworkCore/AbpProEntityFrameworkCoreModule.cs b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/EntityFrameworkCore/AbpProEntityFrameworkCoreModule.cs index ac07f59c..0342ed0c 100644 --- a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/EntityFrameworkCore/AbpProEntityFrameworkCoreModule.cs +++ b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/EntityFrameworkCore/AbpProEntityFrameworkCoreModule.cs @@ -1,4 +1,5 @@ using Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore; +using Lion.AbpPro.FileManagement.EntityFrameworkCore; using Lion.AbpPro.NotificationManagement.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AuditLogging.EntityFrameworkCore; @@ -27,7 +28,8 @@ namespace Lion.AbpPro.EntityFrameworkCore typeof(AbpTenantManagementEntityFrameworkCoreModule), typeof(AbpFeatureManagementEntityFrameworkCoreModule), typeof(DataDictionaryManagementEntityFrameworkCoreModule), - typeof(NotificationManagementEntityFrameworkCoreModule) + typeof(NotificationManagementEntityFrameworkCoreModule), + typeof(FileManagementEntityFrameworkCoreModule) )] public class AbpProEntityFrameworkCoreModule : AbpModule { diff --git a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Lion.AbpPro.EntityFrameworkCore.csproj b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Lion.AbpPro.EntityFrameworkCore.csproj index 80ce3c3b..5cdd55f4 100644 --- a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Lion.AbpPro.EntityFrameworkCore.csproj +++ b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Lion.AbpPro.EntityFrameworkCore.csproj @@ -8,6 +8,7 @@ + diff --git a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20211126170744_Init.Designer.cs b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20220119125638_Init.Designer.cs similarity index 96% rename from aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20211126170744_Init.Designer.cs rename to aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20220119125638_Init.Designer.cs index ffad9c6d..308d3eda 100644 --- a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20211126170744_Init.Designer.cs +++ b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20220119125638_Init.Designer.cs @@ -12,7 +12,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Lion.AbpPro.Migrations { [DbContext(typeof(AbpProDbContext))] - [Migration("20211126170744_Init")] + [Migration("20220119125638_Init")] partial class Init { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -140,7 +140,71 @@ namespace Lion.AbpPro.Migrations b.ToTable("DataDictionaryDetail", (string)null); }); - modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Notification", b => + modelBuilder.Entity("Lion.AbpPro.FileManagement.Files.File", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasColumnType("varchar(255)"); + + b.Property("FilePath") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex("FileName"); + + b.ToTable("File", (string)null); + }); + + modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.Notification", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -207,7 +271,7 @@ namespace Lion.AbpPro.Migrations b.ToTable("Notification", (string)null); }); - modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.NotificationSubscription", b => + modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.NotificationSubscription", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -335,16 +399,28 @@ namespace Lion.AbpPro.Migrations .HasColumnType("char(36)") .HasColumnName("ImpersonatorTenantId"); + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + b.Property("ImpersonatorUserId") .HasColumnType("char(36)") .HasColumnName("ImpersonatorUserId"); + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + b.Property("TenantId") .HasColumnType("char(36)") .HasColumnName("TenantId"); b.Property("TenantName") - .HasColumnType("longtext"); + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); b.Property("Url") .HasMaxLength(256) @@ -2175,9 +2251,9 @@ namespace Lion.AbpPro.Migrations .IsRequired(); }); - modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.NotificationSubscription", b => + modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.NotificationSubscription", b => { - b.HasOne("Lion.AbpPro.NotificationManagement.Notifications.Notification", null) + b.HasOne("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.Notification", null) .WithMany("NotificationSubscriptions") .HasForeignKey("NotificationId"); }); @@ -2464,7 +2540,7 @@ namespace Lion.AbpPro.Migrations b.Navigation("Details"); }); - modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Notification", b => + modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.Notification", b => { b.Navigation("NotificationSubscriptions"); }); diff --git a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20211126170744_Init.cs b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20220119125638_Init.cs similarity index 97% rename from aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20211126170744_Init.cs rename to aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20220119125638_Init.cs index 9db4cdc1..90dc2583 100644 --- a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20211126170744_Init.cs +++ b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/20220119125638_Init.cs @@ -23,10 +23,14 @@ namespace Lion.AbpPro.Migrations UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - TenantName = table.Column(type: "longtext", nullable: true) + TenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ImpersonatorUserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ImpersonatorUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ImpersonatorTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ImpersonatorTenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ExecutionTime = table.Column(type: "datetime(6)", nullable: false), ExecutionDuration = table.Column(type: "int", nullable: false), ClientIpAddress = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) @@ -387,6 +391,34 @@ namespace Lion.AbpPro.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "File", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + FileName = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + FilePath = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LastModificationTime = table.Column(type: "datetime(6)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + DeletionTime = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_File", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "IdentityServerApiResources", columns: table => new @@ -1522,6 +1554,16 @@ namespace Lion.AbpPro.Migrations table: "DataDictionaryDetail", column: "DataDictionaryId"); + migrationBuilder.CreateIndex( + name: "IX_File_CreationTime", + table: "File", + column: "CreationTime"); + + migrationBuilder.CreateIndex( + name: "IX_File_FileName", + table: "File", + column: "FileName"); + migrationBuilder.CreateIndex( name: "IX_IdentityServerClients_ClientId", table: "IdentityServerClients", @@ -1620,6 +1662,9 @@ namespace Lion.AbpPro.Migrations migrationBuilder.DropTable( name: "DataDictionaryDetail"); + migrationBuilder.DropTable( + name: "File"); + migrationBuilder.DropTable( name: "IdentityServerApiResourceClaims"); diff --git a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/AbpProDbContextModelSnapshot.cs b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/AbpProDbContextModelSnapshot.cs index 919ac5fc..ea68e5ce 100644 --- a/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/AbpProDbContextModelSnapshot.cs +++ b/aspnet-core/services/src/Lion.AbpPro.EntityFrameworkCore/Migrations/AbpProDbContextModelSnapshot.cs @@ -138,7 +138,71 @@ namespace Lion.AbpPro.Migrations b.ToTable("DataDictionaryDetail", (string)null); }); - modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Notification", b => + modelBuilder.Entity("Lion.AbpPro.FileManagement.Files.File", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasColumnType("varchar(255)"); + + b.Property("FilePath") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.HasIndex("FileName"); + + b.ToTable("File", (string)null); + }); + + modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.Notification", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -205,7 +269,7 @@ namespace Lion.AbpPro.Migrations b.ToTable("Notification", (string)null); }); - modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.NotificationSubscription", b => + modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.NotificationSubscription", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -333,16 +397,28 @@ namespace Lion.AbpPro.Migrations .HasColumnType("char(36)") .HasColumnName("ImpersonatorTenantId"); + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + b.Property("ImpersonatorUserId") .HasColumnType("char(36)") .HasColumnName("ImpersonatorUserId"); + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + b.Property("TenantId") .HasColumnType("char(36)") .HasColumnName("TenantId"); b.Property("TenantName") - .HasColumnType("longtext"); + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); b.Property("Url") .HasMaxLength(256) @@ -2173,9 +2249,9 @@ namespace Lion.AbpPro.Migrations .IsRequired(); }); - modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.NotificationSubscription", b => + modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.NotificationSubscription", b => { - b.HasOne("Lion.AbpPro.NotificationManagement.Notifications.Notification", null) + b.HasOne("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.Notification", null) .WithMany("NotificationSubscriptions") .HasForeignKey("NotificationId"); }); @@ -2462,7 +2538,7 @@ namespace Lion.AbpPro.Migrations b.Navigation("Details"); }); - modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Notification", b => + modelBuilder.Entity("Lion.AbpPro.NotificationManagement.Notifications.Aggregates.Notification", b => { b.Navigation("NotificationSubscriptions"); }); diff --git a/aspnet-core/services/src/Lion.AbpPro.HttpApi.Client/AbpProHttpApiClientModule.cs b/aspnet-core/services/src/Lion.AbpPro.HttpApi.Client/AbpProHttpApiClientModule.cs index 9f34647e..7aca2448 100644 --- a/aspnet-core/services/src/Lion.AbpPro.HttpApi.Client/AbpProHttpApiClientModule.cs +++ b/aspnet-core/services/src/Lion.AbpPro.HttpApi.Client/AbpProHttpApiClientModule.cs @@ -1,4 +1,5 @@ using Lion.AbpPro.DataDictionaryManagement; +using Lion.AbpPro.FileManagement; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Account; using Volo.Abp.FeatureManagement; @@ -18,7 +19,8 @@ namespace Lion.AbpPro typeof(AbpTenantManagementHttpApiClientModule), typeof(AbpFeatureManagementHttpApiClientModule), typeof(AbpSettingManagementHttpApiClientModule), - typeof(DataDictionaryManagementHttpApiClientModule) + typeof(DataDictionaryManagementHttpApiClientModule), + typeof(FileManagementHttpApiClientModule) )] public class AbpProHttpApiClientModule : AbpModule { diff --git a/aspnet-core/services/src/Lion.AbpPro.HttpApi.Client/Lion.AbpPro.HttpApi.Client.csproj b/aspnet-core/services/src/Lion.AbpPro.HttpApi.Client/Lion.AbpPro.HttpApi.Client.csproj index e93b2fbf..a36716c8 100644 --- a/aspnet-core/services/src/Lion.AbpPro.HttpApi.Client/Lion.AbpPro.HttpApi.Client.csproj +++ b/aspnet-core/services/src/Lion.AbpPro.HttpApi.Client/Lion.AbpPro.HttpApi.Client.csproj @@ -9,6 +9,7 @@ + diff --git a/aspnet-core/services/src/Lion.AbpPro.HttpApi/AbpProHttpApiModule.cs b/aspnet-core/services/src/Lion.AbpPro.HttpApi/AbpProHttpApiModule.cs index 597b49df..fa48f815 100644 --- a/aspnet-core/services/src/Lion.AbpPro.HttpApi/AbpProHttpApiModule.cs +++ b/aspnet-core/services/src/Lion.AbpPro.HttpApi/AbpProHttpApiModule.cs @@ -1,4 +1,5 @@ using Lion.AbpPro.DataDictionaryManagement; +using Lion.AbpPro.FileManagement; using Localization.Resources.AbpUi; using Lion.AbpPro.Localization; using Lion.AbpPro.NotificationManagement; @@ -22,7 +23,8 @@ namespace Lion.AbpPro typeof(AbpFeatureManagementHttpApiModule), typeof(AbpSettingManagementHttpApiModule), typeof(DataDictionaryManagementHttpApiModule), - typeof(NotificationManagementHttpApiModule) + typeof(NotificationManagementHttpApiModule), + typeof(FileManagementHttpApiModule) )] public class AbpProHttpApiModule : AbpModule { diff --git a/aspnet-core/services/src/Lion.AbpPro.HttpApi/Lion.AbpPro.HttpApi.csproj b/aspnet-core/services/src/Lion.AbpPro.HttpApi/Lion.AbpPro.HttpApi.csproj index 9624e9c6..682f0a8d 100644 --- a/aspnet-core/services/src/Lion.AbpPro.HttpApi/Lion.AbpPro.HttpApi.csproj +++ b/aspnet-core/services/src/Lion.AbpPro.HttpApi/Lion.AbpPro.HttpApi.csproj @@ -9,6 +9,7 @@ + diff --git a/vben271/package.json b/vben271/package.json index 78bb26ab..4986b04f 100644 --- a/vben271/package.json +++ b/vben271/package.json @@ -39,6 +39,7 @@ "@microsoft/signalr": "^5.0.8", "@vueuse/core": "^5.3.0", "@zxcvbn-ts/core": "^1.0.0-beta.0", + "ali-oss": "^6.16.0", "ant-design-vue": "2.2.6", "axios": "^0.21.1", "crypto-js": "^4.1.1", @@ -150,4 +151,4 @@ "engines": { "node": "^12 || >=14" } -} \ No newline at end of file +} diff --git a/vben271/src/locales/lang/en/common.ts b/vben271/src/locales/lang/en/common.ts index 23e1c039..edd9ce69 100644 --- a/vben271/src/locales/lang/en/common.ts +++ b/vben271/src/locales/lang/en/common.ts @@ -32,4 +32,5 @@ export default { detail: 'Detail', status: 'Status', active: 'IsActive', + download: 'DownLoad', }; diff --git a/vben271/src/locales/lang/en/routes/admin.ts b/vben271/src/locales/lang/en/routes/admin.ts index 0579c34a..88bf6ee9 100644 --- a/vben271/src/locales/lang/en/routes/admin.ts +++ b/vben271/src/locales/lang/en/routes/admin.ts @@ -60,4 +60,6 @@ export default { dictionaryOrder: 'Order', chooseDictionary: 'Please Choose DataDictionary Type', nonZeroMessage: 'Please enter a non-zero positive integer', + fileName: 'FileName', + fileNameManagement: 'FileNameManagement', }; diff --git a/vben271/src/locales/lang/zh-CN/common.ts b/vben271/src/locales/lang/zh-CN/common.ts index 77b40a75..2ea70354 100644 --- a/vben271/src/locales/lang/zh-CN/common.ts +++ b/vben271/src/locales/lang/zh-CN/common.ts @@ -35,4 +35,5 @@ export default { detail: '详情', status: '状态', active: '是否激活', + download: '下载', }; diff --git a/vben271/src/locales/lang/zh-CN/routes/admin.ts b/vben271/src/locales/lang/zh-CN/routes/admin.ts index 17a4cd90..d9419ca3 100644 --- a/vben271/src/locales/lang/zh-CN/routes/admin.ts +++ b/vben271/src/locales/lang/zh-CN/routes/admin.ts @@ -59,4 +59,6 @@ export default { dictionaryOrder: '排序', chooseDictionary: '请选择字典类型', nonZeroMessage: '请输入非零的正整数', + fileName: '文件名称', + fileNameManagement: '文件管理', }; diff --git a/vben271/src/router/routes/modules/admin.ts b/vben271/src/router/routes/modules/admin.ts index d1b41f72..0be6e4b5 100644 --- a/vben271/src/router/routes/modules/admin.ts +++ b/vben271/src/router/routes/modules/admin.ts @@ -73,6 +73,16 @@ const admin: AppRouteModule = { policy: 'System.DataDictionaryManagement', }, }, + { + path: 'files', + name: 'files', + component: () => import('/@/views/admin/files/File.vue'), + meta: { + title: t('routes.admin.fileNameManagement'), + icon: 'ant-design:snippets-outlined', + policy: 'System.FileManagement', + }, + }, ], }; diff --git a/vben271/src/router/routes/modules/identityServer.ts b/vben271/src/router/routes/modules/identityServer.ts index 8d1d07aa..cf5f9ec7 100644 --- a/vben271/src/router/routes/modules/identityServer.ts +++ b/vben271/src/router/routes/modules/identityServer.ts @@ -8,7 +8,7 @@ const identityServer: AppRouteModule = { //redirect: '/admin/abpUser', meta: { orderNo: 30, - icon: 'ion:grid-outline', + icon: 'ant-design:skin-outlined', title: t('routes.admin.identityServer'), }, children: [ diff --git a/vben271/src/router/routes/modules/tenant.ts b/vben271/src/router/routes/modules/tenant.ts index e1494e1b..d656fa96 100644 --- a/vben271/src/router/routes/modules/tenant.ts +++ b/vben271/src/router/routes/modules/tenant.ts @@ -7,7 +7,7 @@ const tenant: AppRouteModule = { component: LAYOUT, meta: { orderNo: 30, - icon: 'ion:grid-outline', + icon: 'ant-design:contacts-outlined', title: t('routes.tenant.tenantManagement'), }, children: [ diff --git a/vben271/src/services/ServiceProxies.ts b/vben271/src/services/ServiceProxies.ts index 134043f3..ff8af53d 100644 --- a/vben271/src/services/ServiceProxies.ts +++ b/vben271/src/services/ServiceProxies.ts @@ -2,7 +2,7 @@ /* eslint-disable */ //---------------------- // -// Generated using the NSwag toolchain v13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) // //---------------------- // ReSharper disable InconsistentNaming @@ -72,43 +72,50 @@ export class AbpApiDefinitionServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = ApplicationApiDescriptionModel.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -172,43 +179,50 @@ export class AbpApplicationConfigurationServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = ApplicationConfigurationDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -278,43 +292,50 @@ export class AccountServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = LoginOutput.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -372,43 +393,50 @@ export class AccountServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = LoginOutput.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -478,43 +506,50 @@ export class ApiResourceServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = ApiResourceOutputPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -574,43 +609,50 @@ export class ApiResourceServiceProxy extends ServiceProxyBase { else { result200 = null; } - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -665,42 +707,49 @@ export class ApiResourceServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -755,42 +804,49 @@ export class ApiResourceServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -845,42 +901,49 @@ export class ApiResourceServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -950,43 +1013,50 @@ export class ApiScopeServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = PagingApiScopeListOutputPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1041,42 +1111,49 @@ export class ApiScopeServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1131,42 +1208,49 @@ export class ApiScopeServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1221,42 +1305,49 @@ export class ApiScopeServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1316,43 +1407,50 @@ export class ApiScopeServiceProxy extends ServiceProxyBase { else { result200 = null; } - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1422,43 +1520,50 @@ export class AuditLogsServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = GetAuditLogPageListOutputPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1528,43 +1633,50 @@ export class ClientServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = PagingClientListOutputPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1619,42 +1731,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1709,42 +1828,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1799,42 +1925,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1889,42 +2022,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -1979,42 +2119,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2069,42 +2216,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2159,42 +2313,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2249,42 +2410,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2339,42 +2507,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2429,42 +2604,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2519,42 +2701,49 @@ export class ClientServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2624,43 +2813,50 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = PagingDataDictionaryOutputPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2718,43 +2914,50 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = PagingDataDictionaryDetailOutputPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2809,42 +3012,49 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2899,42 +3109,49 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -2989,42 +3206,49 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3079,42 +3303,49 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3169,42 +3400,49 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3213,7 +3451,7 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase { } } -export class FileConfigurationServiceProxy extends ServiceProxyBase { +export class FilesServiceProxy extends ServiceProxyBase { private instance: AxiosInstance; private baseUrl: string; protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; @@ -3225,16 +3463,18 @@ export class FileConfigurationServiceProxy extends ServiceProxyBase { } /** + * 获取上传文件临时Token * @return Success */ - configurationGet( cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + "/configuration"; + getFileToken( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Files/getFileToken"; url_ = url_.replace(/[?&]$/, ""); let options_ = { method: "GET", url: url_, headers: { + "Accept": "text/plain" }, cancelToken }; @@ -3248,11 +3488,11 @@ export class FileConfigurationServiceProxy extends ServiceProxyBase { throw _error; } }).then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processConfigurationGet(_response)); + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processGetFileToken(_response)); }); } - protected processConfigurationGet(response: AxiosResponse): Promise { + protected processGetFileToken(response: AxiosResponse): Promise { const status = response.status; let _headers: any = {}; if (response.headers && typeof response.headers === "object") { @@ -3264,17 +3504,322 @@ export class FileConfigurationServiceProxy extends ServiceProxyBase { } if (status === 200) { const _responseText = response.data; - return Promise.resolve(null); - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return Promise.resolve(null); - } + let result200: any = null; + let resultData200 = _responseText; + result200 = FileTokenOutput.fromJS(resultData200); + return Promise.resolve(result200); - /** - * @param body (optional) - * @return Success + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null); + } + + /** + * 创建文件 + * @param body (optional) + * @return Success + */ + create(body: CreateFileInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Files/create"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); + }); + } + + protected processCreate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null); + } + + /** + * 分页查询 + * @param body (optional) + * @return Success + */ + page(body: PagingFileInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Files/page"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + }); + } + + protected processPage(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PagingFileOutputPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null); + } +} + +export class FileConfigurationServiceProxy extends ServiceProxyBase { + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * @return Success + */ + configurationGet( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/configuration"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { + method: "GET", + url: url_, + headers: { + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processConfigurationGet(_response)); + }); + } + + protected processConfigurationGet(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null); + } + + /** + * @param body (optional) + * @return Success */ configurationPost(body: FileConfiguration | undefined , cancelToken?: CancelToken | undefined): Promise { let url_ = this.baseUrl + "/configuration"; @@ -3318,6 +3863,7 @@ export class FileConfigurationServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3387,43 +3933,50 @@ export class IdentityResourceServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = PagingIdentityResourceListOutputPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3483,43 +4036,50 @@ export class IdentityResourceServiceProxy extends ServiceProxyBase { else { result200 = null; } - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3574,42 +4134,49 @@ export class IdentityResourceServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3664,42 +4231,49 @@ export class IdentityResourceServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3754,42 +4328,49 @@ export class IdentityResourceServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3859,43 +4440,50 @@ export class EsLogServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = PagingElasticSearchLogOutputCustomePagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -3965,43 +4553,50 @@ export class NotificationServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = PagingNotificationListOutputPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -4059,43 +4654,50 @@ export class NotificationServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = PagingNotificationListOutputPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -4150,42 +4752,49 @@ export class NotificationServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -4240,42 +4849,49 @@ export class NotificationServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -4345,42 +4961,49 @@ export class NotificationServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -4444,6 +5067,7 @@ export class OutputCacheServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -4475,11 +5099,216 @@ export class PermissionsServiceProxy extends ServiceProxyBase { const content_ = JSON.stringify(body); let options_ = { - data: content_, + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + "Accept": "text/plain" + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processTree(_response)); + }); + } + + protected processTree(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + let result200: any = null; + let resultData200 = _responseText; + result200 = PermissionOutput.fromJS(resultData200); + return Promise.resolve(result200); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null); + } + + /** + * 更新角色 + * @param body (optional) + * @return Success + */ + update(body: UpdateRolePermissionsInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Permissions/update"; + url_ = url_.replace(/[?&]$/, ""); + + const content_ = JSON.stringify(body); + + let options_ = { + data: content_, + method: "POST", + url: url_, + headers: { + "Content-Type": "application/json", + }, + cancelToken + }; + + return this.transformOptions(options_).then(transformedOptions_ => { + return this.instance.request(transformedOptions_); + }).catch((_error: any) => { + if (isAxiosError(_error) && _error.response) { + return _error.response; + } else { + throw _error; + } + }).then((_response: AxiosResponse) => { + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + }); + } + + protected processUpdate(response: AxiosResponse): Promise { + const status = response.status; + let _headers: any = {}; + if (response.headers && typeof response.headers === "object") { + for (let k in response.headers) { + if (response.headers.hasOwnProperty(k)) { + _headers[k] = response.headers[k]; + } + } + } + if (status === 200) { + const _responseText = response.data; + return Promise.resolve(null); + + } else if (status === 403) { + const _responseText = response.data; + let result403: any = null; + let resultData403 = _responseText; + result403 = RemoteServiceErrorResponse.fromJS(resultData403); + return throwException("Forbidden", status, _responseText, _headers, result403); + + } else if (status === 401) { + const _responseText = response.data; + let result401: any = null; + let resultData401 = _responseText; + result401 = RemoteServiceErrorResponse.fromJS(resultData401); + return throwException("Unauthorized", status, _responseText, _headers, result401); + + } else if (status === 400) { + const _responseText = response.data; + let result400: any = null; + let resultData400 = _responseText; + result400 = RemoteServiceErrorResponse.fromJS(resultData400); + return throwException("Bad Request", status, _responseText, _headers, result400); + + } else if (status === 404) { + const _responseText = response.data; + let result404: any = null; + let resultData404 = _responseText; + result404 = RemoteServiceErrorResponse.fromJS(resultData404); + return throwException("Not Found", status, _responseText, _headers, result404); + + } else if (status === 501) { + const _responseText = response.data; + let result501: any = null; + let resultData501 = _responseText; + result501 = RemoteServiceErrorResponse.fromJS(resultData501); + return throwException("Server Error", status, _responseText, _headers, result501); + + } else if (status === 500) { + const _responseText = response.data; + let result500: any = null; + let resultData500 = _responseText; + result500 = RemoteServiceErrorResponse.fromJS(resultData500); + return throwException("Server Error", status, _responseText, _headers, result500); + + } else if (status !== 200 && status !== 204) { + const _responseText = response.data; + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + } + return Promise.resolve(null); + } +} + +export class RolesServiceProxy extends ServiceProxyBase { + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + } + + /** + * 获取所有角色 + * @return Success + */ + all( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/all"; + url_ = url_.replace(/[?&]$/, ""); + + let options_ = { method: "POST", url: url_, headers: { - "Content-Type": "application/json", "Accept": "text/plain" }, cancelToken @@ -4494,11 +5323,11 @@ export class PermissionsServiceProxy extends ServiceProxyBase { throw _error; } }).then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processTree(_response)); + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processAll(_response)); }); } - protected processTree(response: AxiosResponse): Promise { + protected processAll(response: AxiosResponse): Promise { const status = response.status; let _headers: any = {}; if (response.headers && typeof response.headers === "object") { @@ -4512,58 +5341,65 @@ export class PermissionsServiceProxy extends ServiceProxyBase { const _responseText = response.data; let result200: any = null; let resultData200 = _responseText; - result200 = PermissionOutput.fromJS(resultData200); - return result200; + result200 = IdentityRoleDtoListResultDto.fromJS(resultData200); + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); } - return Promise.resolve(null); + return Promise.resolve(null); } /** - * 更新角色 + * 分页获取角色 * @param body (optional) * @return Success */ - update(body: UpdateRolePermissionsInput | undefined , cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + "/Permissions/update"; + page(body: PagingRoleListInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/page"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); @@ -4574,6 +5410,7 @@ export class PermissionsServiceProxy extends ServiceProxyBase { url: url_, headers: { "Content-Type": "application/json", + "Accept": "text/plain" }, cancelToken }; @@ -4587,11 +5424,11 @@ export class PermissionsServiceProxy extends ServiceProxyBase { throw _error; } }).then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); }); } - protected processUpdate(response: AxiosResponse): Promise { + protected processPage(response: AxiosResponse): Promise { const status = response.status; let _headers: any = {}; if (response.headers && typeof response.headers === "object") { @@ -4603,74 +5440,77 @@ export class PermissionsServiceProxy extends ServiceProxyBase { } if (status === 200) { const _responseText = response.data; - return Promise.resolve(null); + let result200: any = null; + let resultData200 = _responseText; + result200 = IdentityRoleDtoPagedResultDto.fromJS(resultData200); + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); } - return Promise.resolve(null); - } -} - -export class RolesServiceProxy extends ServiceProxyBase { - private instance: AxiosInstance; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, instance?: AxiosInstance) { - super(); - this.instance = instance ? instance : axios.create(); - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; + return Promise.resolve(null); } /** - * 获取所有角色 + * 创建角色 + * @param body (optional) * @return Success */ - all( cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + "/Roles/all"; + create(body: IdentityRoleCreateDto | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/create"; url_ = url_.replace(/[?&]$/, ""); + const content_ = JSON.stringify(body); + let options_ = { + data: content_, method: "POST", url: url_, headers: { + "Content-Type": "application/json", "Accept": "text/plain" }, cancelToken @@ -4685,11 +5525,11 @@ export class RolesServiceProxy extends ServiceProxyBase { throw _error; } }).then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processAll(_response)); + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); }); } - protected processAll(response: AxiosResponse): Promise { + protected processCreate(response: AxiosResponse): Promise { const status = response.status; let _headers: any = {}; if (response.headers && typeof response.headers === "object") { @@ -4703,58 +5543,65 @@ export class RolesServiceProxy extends ServiceProxyBase { const _responseText = response.data; let result200: any = null; let resultData200 = _responseText; - result200 = IdentityRoleDtoListResultDto.fromJS(resultData200); - return result200; + result200 = IdentityRoleDto.fromJS(resultData200); + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); } - return Promise.resolve(null); + return Promise.resolve(null); } /** - * 分页获取角色 + * 更新角色 * @param body (optional) * @return Success */ - page(body: PagingRoleListInput | undefined , cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + "/Roles/page"; + update(body: UpdateRoleInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/update"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); @@ -4779,11 +5626,11 @@ export class RolesServiceProxy extends ServiceProxyBase { throw _error; } }).then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response)); + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); }); } - protected processPage(response: AxiosResponse): Promise { + protected processUpdate(response: AxiosResponse): Promise { const status = response.status; let _headers: any = {}; if (response.headers && typeof response.headers === "object") { @@ -4797,58 +5644,65 @@ export class RolesServiceProxy extends ServiceProxyBase { const _responseText = response.data; let result200: any = null; let resultData200 = _responseText; - result200 = IdentityRoleDtoPagedResultDto.fromJS(resultData200); - return result200; + result200 = IdentityRoleDto.fromJS(resultData200); + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); } - return Promise.resolve(null); + return Promise.resolve(null); } /** - * 创建角色 + * 删除角色 * @param body (optional) * @return Success */ - create(body: IdentityRoleCreateDto | undefined , cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + "/Roles/create"; + delete(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/Roles/delete"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); @@ -4859,7 +5713,6 @@ export class RolesServiceProxy extends ServiceProxyBase { url: url_, headers: { "Content-Type": "application/json", - "Accept": "text/plain" }, cancelToken }; @@ -4873,11 +5726,11 @@ export class RolesServiceProxy extends ServiceProxyBase { throw _error; } }).then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processCreate(_response)); + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDelete(_response)); }); } - protected processCreate(response: AxiosResponse): Promise { + protected processDelete(response: AxiosResponse): Promise { const status = response.status; let _headers: any = {}; if (response.headers && typeof response.headers === "object") { @@ -4889,70 +5742,80 @@ export class RolesServiceProxy extends ServiceProxyBase { } if (status === 200) { const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText; - result200 = IdentityRoleDto.fromJS(resultData200); - return result200; + return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); } - return Promise.resolve(null); + return Promise.resolve(null); + } +} + +export class SampleServiceProxy extends ServiceProxyBase { + private instance: AxiosInstance; + private baseUrl: string; + protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; + + constructor(baseUrl?: string, instance?: AxiosInstance) { + super(); + this.instance = instance ? instance : axios.create(); + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : ""; } /** - * 更新角色 - * @param body (optional) * @return Success */ - update(body: UpdateRoleInput | undefined , cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + "/Roles/update"; + sample( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/api/FileManagement/sample"; url_ = url_.replace(/[?&]$/, ""); - const content_ = JSON.stringify(body); - let options_ = { - data: content_, - method: "POST", + method: "GET", url: url_, headers: { - "Content-Type": "application/json", "Accept": "text/plain" }, cancelToken @@ -4967,11 +5830,11 @@ export class RolesServiceProxy extends ServiceProxyBase { throw _error; } }).then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processUpdate(_response)); + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processSample(_response)); }); } - protected processUpdate(response: AxiosResponse): Promise { + protected processSample(response: AxiosResponse): Promise { const status = response.status; let _headers: any = {}; if (response.headers && typeof response.headers === "object") { @@ -4985,68 +5848,70 @@ export class RolesServiceProxy extends ServiceProxyBase { const _responseText = response.data; let result200: any = null; let resultData200 = _responseText; - result200 = IdentityRoleDto.fromJS(resultData200); - return result200; + result200 = SampleDto.fromJS(resultData200); + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); } - return Promise.resolve(null); + return Promise.resolve(null); } /** - * 删除角色 - * @param body (optional) * @return Success */ - delete(body: IdInput | undefined , cancelToken?: CancelToken | undefined): Promise { - let url_ = this.baseUrl + "/Roles/delete"; + authorized( cancelToken?: CancelToken | undefined): Promise { + let url_ = this.baseUrl + "/api/FileManagement/sample/authorized"; url_ = url_.replace(/[?&]$/, ""); - const content_ = JSON.stringify(body); - let options_ = { - data: content_, - method: "POST", + method: "GET", url: url_, headers: { - "Content-Type": "application/json", + "Accept": "text/plain" }, cancelToken }; @@ -5060,11 +5925,11 @@ export class RolesServiceProxy extends ServiceProxyBase { throw _error; } }).then((_response: AxiosResponse) => { - return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processDelete(_response)); + return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processAuthorized(_response)); }); } - protected processDelete(response: AxiosResponse): Promise { + protected processAuthorized(response: AxiosResponse): Promise { const status = response.status; let _headers: any = {}; if (response.headers && typeof response.headers === "object") { @@ -5076,48 +5941,58 @@ export class RolesServiceProxy extends ServiceProxyBase { } if (status === 200) { const _responseText = response.data; - return Promise.resolve(null); + let result200: any = null; + let resultData200 = _responseText; + result200 = SampleDto.fromJS(resultData200); + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); } - return Promise.resolve(null); + return Promise.resolve(null); } } @@ -5184,43 +6059,50 @@ export class SettingsServiceProxy extends ServiceProxyBase { else { result200 = null; } - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -5275,42 +6157,49 @@ export class SettingsServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -5380,43 +6269,50 @@ export class TenantsServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = FindTenantResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -5474,43 +6370,50 @@ export class TenantsServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = TenantDtoPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -5568,43 +6471,50 @@ export class TenantsServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = TenantDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -5662,43 +6572,50 @@ export class TenantsServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = TenantDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -5753,42 +6670,49 @@ export class TenantsServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -5845,44 +6769,52 @@ export class TenantsServiceProxy extends ServiceProxyBase { const _responseText = response.data; let result200: any = null; let resultData200 = _responseText; - result200 = resultData200 !== undefined ? resultData200 : null; - return result200; + result200 = resultData200 !== undefined ? resultData200 : null; + + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -5937,42 +6869,49 @@ export class TenantsServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -6027,42 +6966,49 @@ export class TenantsServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -6132,43 +7078,50 @@ export class UsersServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = IdentityUserDtoPagedResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -6226,43 +7179,50 @@ export class UsersServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = IdentityUserDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -6320,43 +7280,50 @@ export class UsersServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = IdentityUserDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -6411,42 +7378,49 @@ export class UsersServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -6504,43 +7478,50 @@ export class UsersServiceProxy extends ServiceProxyBase { let result200: any = null; let resultData200 = _responseText; result200 = IdentityRoleDtoListResultDto.fromJS(resultData200); - return result200; + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -6597,44 +7578,52 @@ export class UsersServiceProxy extends ServiceProxyBase { const _responseText = response.data; let result200: any = null; let resultData200 = _responseText; - result200 = resultData200 !== undefined ? resultData200 : null; - return result200; + result200 = resultData200 !== undefined ? resultData200 : null; + + return Promise.resolve(result200); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -6689,42 +7678,49 @@ export class UsersServiceProxy extends ServiceProxyBase { if (status === 200) { const _responseText = response.data; return Promise.resolve(null); + } else if (status === 403) { const _responseText = response.data; let result403: any = null; let resultData403 = _responseText; result403 = RemoteServiceErrorResponse.fromJS(resultData403); return throwException("Forbidden", status, _responseText, _headers, result403); + } else if (status === 401) { const _responseText = response.data; let result401: any = null; let resultData401 = _responseText; result401 = RemoteServiceErrorResponse.fromJS(resultData401); return throwException("Unauthorized", status, _responseText, _headers, result401); + } else if (status === 400) { const _responseText = response.data; let result400: any = null; let resultData400 = _responseText; result400 = RemoteServiceErrorResponse.fromJS(resultData400); return throwException("Bad Request", status, _responseText, _headers, result400); + } else if (status === 404) { const _responseText = response.data; let result404: any = null; let resultData404 = _responseText; result404 = RemoteServiceErrorResponse.fromJS(resultData404); return throwException("Not Found", status, _responseText, _headers, result404); + } else if (status === 501) { const _responseText = response.data; let result501: any = null; let resultData501 = _responseText; result501 = RemoteServiceErrorResponse.fromJS(resultData501); return throwException("Server Error", status, _responseText, _headers, result501); + } else if (status === 500) { const _responseText = response.data; let result500: any = null; let resultData500 = _responseText; result500 = RemoteServiceErrorResponse.fromJS(resultData500); return throwException("Server Error", status, _responseText, _headers, result500); + } else if (status !== 200 && status !== 204) { const _responseText = response.data; return throwException("An unexpected server error occurred.", status, _responseText, _headers); @@ -6764,7 +7760,7 @@ export class AbpLoginResult implements IAbpLoginResult { data = typeof data === 'object' ? data : {}; data["result"] = this.result; data["description"] = this.description; - return data; + return data; } } @@ -6852,7 +7848,7 @@ export class ActionApiDescriptionModel implements IActionApiDescriptionModel { data["returnValue"] = this.returnValue ? this.returnValue.toJSON() : undefined; data["allowAnonymous"] = this.allowAnonymous; data["implementFrom"] = this.implementFrom; - return data; + return data; } } @@ -6900,7 +7896,7 @@ export class AddCorsInput implements IAddCorsInput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["origin"] = this.origin; - return data; + return data; } } @@ -6940,7 +7936,7 @@ export class AddRedirectUriInput implements IAddRedirectUriInput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["uri"] = this.uri; - return data; + return data; } } @@ -6983,7 +7979,7 @@ export class AggregateRouteConfig implements IAggregateRouteConfig { data["routeKey"] = this.routeKey; data["parameter"] = this.parameter; data["jsonPath"] = this.jsonPath; - return data; + return data; } } @@ -7024,7 +8020,7 @@ export class ApiResourceClaimOutput implements IApiResourceClaimOutput { data = typeof data === 'object' ? data : {}; data["apiResourceId"] = this.apiResourceId; data["type"] = this.type; - return data; + return data; } } @@ -7123,7 +8119,7 @@ export class ApiResourceOutput implements IApiResourceOutput { for (let item of this.properties) data["properties"].push(item.toJSON()); } - return data; + return data; } } @@ -7180,7 +8176,7 @@ export class ApiResourceOutputPagedResultDto implements IApiResourceOutputPagedR data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -7223,7 +8219,7 @@ export class ApiResourcePropertyOutput implements IApiResourcePropertyOutput { data["apiResourceId"] = this.apiResourceId; data["key"] = this.key; data["value"] = this.value; - return data; + return data; } } @@ -7264,7 +8260,7 @@ export class ApiResourceScopeOutput implements IApiResourceScopeOutput { data = typeof data === 'object' ? data : {}; data["apiResourceId"] = this.apiResourceId; data["scope"] = this.scope; - return data; + return data; } } @@ -7313,7 +8309,7 @@ export class ApiResourceSecretOutput implements IApiResourceSecretOutput { data["value"] = this.value; data["description"] = this.description; data["expiration"] = this.expiration ? this.expiration.toISOString() : undefined; - return data; + return data; } } @@ -7380,7 +8376,7 @@ export class ApplicationApiDescriptionModel implements IApplicationApiDescriptio (data["types"])[key] = this.types[key] ? this.types[key].toJSON() : undefined; } } - return data; + return data; } } @@ -7444,7 +8440,7 @@ export class ApplicationAuthConfigurationDto implements IApplicationAuthConfigur (data["grantedPolicies"])[key] = this.grantedPolicies[key]; } } - return data; + return data; } } @@ -7508,7 +8504,7 @@ export class ApplicationConfigurationDto implements IApplicationConfigurationDto data["timing"] = this.timing ? this.timing.toJSON() : undefined; data["clock"] = this.clock ? this.clock.toJSON() : undefined; data["objectExtensions"] = this.objectExtensions ? this.objectExtensions.toJSON() : undefined; - return data; + return data; } } @@ -7565,7 +8561,7 @@ export class ApplicationFeatureConfigurationDto implements IApplicationFeatureCo (data["values"])[key] = this.values[key]; } } - return data; + return data; } } @@ -7660,7 +8656,7 @@ export class ApplicationLocalizationConfigurationDto implements IApplicationLoca (data["languageFilesMap"])[key] = this.languageFilesMap[key]; } } - return data; + return data; } } @@ -7713,7 +8709,7 @@ export class ApplicationSettingConfigurationDto implements IApplicationSettingCo (data["values"])[key] = this.values[key]; } } - return data; + return data; } } @@ -7752,7 +8748,7 @@ export class ChangePasswordInput implements IChangePasswordInput { data = typeof data === 'object' ? data : {}; data["currentPassword"] = this.currentPassword; data["newPassword"] = this.newPassword; - return data; + return data; } } @@ -7795,7 +8791,7 @@ export class ClientClaimOutput implements IClientClaimOutput { data["clientId"] = this.clientId; data["type"] = this.type; data["value"] = this.value; - return data; + return data; } } @@ -7836,7 +8832,7 @@ export class ClientCorsOriginOutput implements IClientCorsOriginOutput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["origin"] = this.origin; - return data; + return data; } } @@ -7876,7 +8872,7 @@ export class ClientGrantTypeOutput implements IClientGrantTypeOutput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["grantType"] = this.grantType; - return data; + return data; } } @@ -7916,7 +8912,7 @@ export class ClientIdPRestrictionOutput implements IClientIdPRestrictionOutput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["provider"] = this.provider; - return data; + return data; } } @@ -7956,7 +8952,7 @@ export class ClientPostLogoutRedirectUriOutput implements IClientPostLogoutRedir data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["postLogoutRedirectUri"] = this.postLogoutRedirectUri; - return data; + return data; } } @@ -7999,7 +8995,7 @@ export class ClientPropertyOutput implements IClientPropertyOutput { data["clientId"] = this.clientId; data["key"] = this.key; data["value"] = this.value; - return data; + return data; } } @@ -8040,7 +9036,7 @@ export class ClientRedirectUriOutput implements IClientRedirectUriOutput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["redirectUri"] = this.redirectUri; - return data; + return data; } } @@ -8080,7 +9076,7 @@ export class ClientScopeOutput implements IClientScopeOutput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["scope"] = this.scope; - return data; + return data; } } @@ -8126,7 +9122,7 @@ export class ClientSecretOutput implements IClientSecretOutput { data["value"] = this.value; data["description"] = this.description; data["expiration"] = this.expiration ? this.expiration.toISOString() : undefined; - return data; + return data; } } @@ -8165,7 +9161,7 @@ export class ClockDto implements IClockDto { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["kind"] = this.kind; - return data; + return data; } } @@ -8233,7 +9229,7 @@ export class ControllerApiDescriptionModel implements IControllerApiDescriptionM (data["actions"])[key] = this.actions[key] ? this.actions[key].toJSON() : undefined; } } - return data; + return data; } } @@ -8273,7 +9269,7 @@ export class ControllerInterfaceApiDescriptionModel implements IControllerInterf toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["type"] = this.type; - return data; + return data; } } @@ -8327,7 +9323,7 @@ export class CreateApiResourceInput implements ICreateApiResourceInput { data["allowedAccessTokenSigningAlgorithms"] = this.allowedAccessTokenSigningAlgorithms; data["showInDiscoveryDocument"] = this.showInDiscoveryDocument; data["secret"] = this.secret; - return data; + return data; } } @@ -8387,7 +9383,7 @@ export class CreateApiScopeInput implements ICreateApiScopeInput { data["required"] = this.required; data["emphasize"] = this.emphasize; data["showInDiscoveryDocument"] = this.showInDiscoveryDocument; - return data; + return data; } } @@ -8438,7 +9434,7 @@ export class CreateClientInput implements ICreateClientInput { data["clientName"] = this.clientName; data["description"] = this.description; data["allowedGrantTypes"] = this.allowedGrantTypes; - return data; + return data; } } @@ -8489,7 +9485,7 @@ export class CreateDataDictinaryDetailInput implements ICreateDataDictinaryDetai data["displayText"] = this.displayText; data["description"] = this.description; data["order"] = this.order; - return data; + return data; } } @@ -8535,7 +9531,7 @@ export class CreateDataDictinaryInput implements ICreateDataDictinaryInput { data["code"] = this.code; data["displayText"] = this.displayText; data["description"] = this.description; - return data; + return data; } } @@ -8545,6 +9541,46 @@ export interface ICreateDataDictinaryInput { description: string | undefined; } +export class CreateFileInput implements ICreateFileInput { + fileName!: string; + filePath!: string; + + constructor(data?: ICreateFileInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.fileName = _data["fileName"]; + this.filePath = _data["filePath"]; + } + } + + static fromJS(data: any): CreateFileInput { + data = typeof data === 'object' ? data : {}; + let result = new CreateFileInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["fileName"] = this.fileName; + data["filePath"] = this.filePath; + return data; + } +} + +export interface ICreateFileInput { + fileName: string; + filePath: string; +} + export class CreateIdentityResourceInput implements ICreateIdentityResourceInput { name!: string | undefined; displayName!: string | undefined; @@ -8591,7 +9627,7 @@ export class CreateIdentityResourceInput implements ICreateIdentityResourceInput data["required"] = this.required; data["emphasize"] = this.emphasize; data["showInDiscoveryDocument"] = this.showInDiscoveryDocument; - return data; + return data; } } @@ -8654,7 +9690,7 @@ export class CreateNotificationInput implements ICreateNotificationInput { for (let item of this.receiveIds) data["receiveIds"].push(item); } - return data; + return data; } } @@ -8721,7 +9757,7 @@ export class CurrentCultureDto implements ICurrentCultureDto { data["name"] = this.name; data["nativeName"] = this.nativeName; data["dateTimeFormat"] = this.dateTimeFormat ? this.dateTimeFormat.toJSON() : undefined; - return data; + return data; } } @@ -8771,7 +9807,7 @@ export class CurrentTenantDto implements ICurrentTenantDto { data["id"] = this.id; data["name"] = this.name; data["isAvailable"] = this.isAvailable; - return data; + return data; } } @@ -8859,7 +9895,7 @@ export class CurrentUserDto implements ICurrentUserDto { for (let item of this.roles) data["roles"].push(item); } - return data; + return data; } } @@ -8927,7 +9963,7 @@ export class DateTimeFormatDto implements IDateTimeFormatDto { data["dateSeparator"] = this.dateSeparator; data["shortTimePattern"] = this.shortTimePattern; data["longTimePattern"] = this.longTimePattern; - return data; + return data; } } @@ -8972,7 +10008,7 @@ export class DeleteDataDictionaryDetailInput implements IDeleteDataDictionaryDet data = typeof data === 'object' ? data : {}; data["dataDictionaryId"] = this.dataDictionaryId; data["dataDictionayDetailId"] = this.dataDictionayDetailId; - return data; + return data; } } @@ -9033,7 +10069,7 @@ export class EmailSettingsDto implements IEmailSettingsDto { data["smtpUseDefaultCredentials"] = this.smtpUseDefaultCredentials; data["defaultFromAddress"] = this.defaultFromAddress; data["defaultFromDisplayName"] = this.defaultFromDisplayName; - return data; + return data; } } @@ -9080,7 +10116,7 @@ export class EnabledInput implements IEnabledInput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["enabled"] = this.enabled; - return data; + return data; } } @@ -9144,7 +10180,7 @@ export class EntityExtensionDto implements IEntityExtensionDto { (data["configuration"])[key] = this.configuration[key]; } } - return data; + return data; } } @@ -9192,7 +10228,7 @@ export class ExtensionEnumDto implements IExtensionEnumDto { data["fields"].push(item.toJSON()); } data["localizationResource"] = this.localizationResource; - return data; + return data; } } @@ -9232,7 +10268,7 @@ export class ExtensionEnumFieldDto implements IExtensionEnumFieldDto { data = typeof data === 'object' ? data : {}; data["name"] = this.name; data["value"] = this.value; - return data; + return data; } } @@ -9269,7 +10305,7 @@ export class ExtensionPropertyApiCreateDto implements IExtensionPropertyApiCreat toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["isAvailable"] = this.isAvailable; - return data; + return data; } } @@ -9311,7 +10347,7 @@ export class ExtensionPropertyApiDto implements IExtensionPropertyApiDto { data["onGet"] = this.onGet ? this.onGet.toJSON() : undefined; data["onCreate"] = this.onCreate ? this.onCreate.toJSON() : undefined; data["onUpdate"] = this.onUpdate ? this.onUpdate.toJSON() : undefined; - return data; + return data; } } @@ -9349,7 +10385,7 @@ export class ExtensionPropertyApiGetDto implements IExtensionPropertyApiGetDto { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["isAvailable"] = this.isAvailable; - return data; + return data; } } @@ -9385,7 +10421,7 @@ export class ExtensionPropertyApiUpdateDto implements IExtensionPropertyApiUpdat toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["isAvailable"] = this.isAvailable; - return data; + return data; } } @@ -9436,7 +10472,7 @@ export class ExtensionPropertyAttributeDto implements IExtensionPropertyAttribut (data["config"])[key] = this.config[key]; } } - return data; + return data; } } @@ -9514,7 +10550,7 @@ export class ExtensionPropertyDto implements IExtensionPropertyDto { } } data["defaultValue"] = this.defaultValue; - return data; + return data; } } @@ -9566,7 +10602,7 @@ export class ExtensionPropertyUiDto implements IExtensionPropertyUiDto { data["onCreateForm"] = this.onCreateForm ? this.onCreateForm.toJSON() : undefined; data["onEditForm"] = this.onEditForm ? this.onEditForm.toJSON() : undefined; data["lookup"] = this.lookup ? this.lookup.toJSON() : undefined; - return data; + return data; } } @@ -9605,7 +10641,7 @@ export class ExtensionPropertyUiFormDto implements IExtensionPropertyUiFormDto { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["isVisible"] = this.isVisible; - return data; + return data; } } @@ -9653,7 +10689,7 @@ export class ExtensionPropertyUiLookupDto implements IExtensionPropertyUiLookupD data["displayPropertyName"] = this.displayPropertyName; data["valuePropertyName"] = this.valuePropertyName; data["filterParamName"] = this.filterParamName; - return data; + return data; } } @@ -9693,7 +10729,7 @@ export class ExtensionPropertyUiTableDto implements IExtensionPropertyUiTableDto toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["isVisible"] = this.isVisible; - return data; + return data; } } @@ -9750,7 +10786,7 @@ export class FeatureDto implements IFeatureDto { data["valueType"] = this.valueType ? this.valueType.toJSON() : undefined; data["depth"] = this.depth; data["parentName"] = this.parentName; - return data; + return data; } } @@ -9807,7 +10843,7 @@ export class FeatureGroupDto implements IFeatureGroupDto { for (let item of this.features) data["features"].push(item.toJSON()); } - return data; + return data; } } @@ -9848,7 +10884,7 @@ export class FeatureProviderDto implements IFeatureProviderDto { data = typeof data === 'object' ? data : {}; data["name"] = this.name; data["key"] = this.key; - return data; + return data; } } @@ -9930,7 +10966,7 @@ export class FileAggregateRoute implements IFileAggregateRoute { data["upstreamHttpMethod"].push(item); } data["priority"] = this.priority; - return data; + return data; } } @@ -9984,7 +11020,7 @@ export class FileAuthenticationOptions implements IFileAuthenticationOptions { for (let item of this.allowedScopes) data["allowedScopes"].push(item); } - return data; + return data; } } @@ -10024,7 +11060,7 @@ export class FileCacheOptions implements IFileCacheOptions { data = typeof data === 'object' ? data : {}; data["ttlSeconds"] = this.ttlSeconds; data["region"] = this.region; - return data; + return data; } } @@ -10094,7 +11130,7 @@ export class FileConfiguration implements IFileConfiguration { data["aggregates"].push(item.toJSON()); } data["globalConfiguration"] = this.globalConfiguration ? this.globalConfiguration.toJSON() : undefined; - return data; + return data; } } @@ -10139,7 +11175,7 @@ export class FileDynamicRoute implements IFileDynamicRoute { data["serviceName"] = this.serviceName; data["rateLimitRule"] = this.rateLimitRule ? this.rateLimitRule.toJSON() : undefined; data["downstreamHttpVersion"] = this.downstreamHttpVersion; - return data; + return data; } } @@ -10201,7 +11237,7 @@ export class FileGlobalConfiguration implements IFileGlobalConfiguration { data["downstreamScheme"] = this.downstreamScheme; data["httpHandlerOptions"] = this.httpHandlerOptions ? this.httpHandlerOptions.toJSON() : undefined; data["downstreamHttpVersion"] = this.downstreamHttpVersion; - return data; + return data; } } @@ -10248,7 +11284,7 @@ export class FileHostAndPort implements IFileHostAndPort { data = typeof data === 'object' ? data : {}; data["host"] = this.host; data["port"] = this.port; - return data; + return data; } } @@ -10297,7 +11333,7 @@ export class FileHttpHandlerOptions implements IFileHttpHandlerOptions { data["useTracing"] = this.useTracing; data["useProxy"] = this.useProxy; data["maxConnectionsPerServer"] = this.maxConnectionsPerServer; - return data; + return data; } } @@ -10343,7 +11379,7 @@ export class FileLoadBalancerOptions implements IFileLoadBalancerOptions { data["type"] = this.type; data["key"] = this.key; data["expiry"] = this.expiry; - return data; + return data; } } @@ -10387,7 +11423,7 @@ export class FileQoSOptions implements IFileQoSOptions { data["exceptionsAllowedBeforeBreaking"] = this.exceptionsAllowedBeforeBreaking; data["durationOfBreak"] = this.durationOfBreak; data["timeoutValue"] = this.timeoutValue; - return data; + return data; } } @@ -10437,7 +11473,7 @@ export class FileRateLimitOptions implements IFileRateLimitOptions { data["rateLimitCounterPrefix"] = this.rateLimitCounterPrefix; data["disableRateLimitHeaders"] = this.disableRateLimitHeaders; data["httpStatusCode"] = this.httpStatusCode; - return data; + return data; } } @@ -10497,7 +11533,7 @@ export class FileRateLimitRule implements IFileRateLimitRule { data["period"] = this.period; data["periodTimespan"] = this.periodTimespan; data["limit"] = this.limit; - return data; + return data; } } @@ -10735,7 +11771,7 @@ export class FileRoute implements IFileRoute { data["dangerousAcceptAnyServerCertificateValidator"] = this.dangerousAcceptAnyServerCertificateValidator; data["securityOptions"] = this.securityOptions ? this.securityOptions.toJSON() : undefined; data["downstreamHttpVersion"] = this.downstreamHttpVersion; - return data; + return data; } } @@ -10820,7 +11856,7 @@ export class FileSecurityOptions implements IFileSecurityOptions { for (let item of this.ipBlockedList) data["ipBlockedList"].push(item); } - return data; + return data; } } @@ -10878,7 +11914,7 @@ export class FileServiceDiscoveryProvider implements IFileServiceDiscoveryProvid data["configurationKey"] = this.configurationKey; data["pollingInterval"] = this.pollingInterval; data["namespace"] = this.namespace; - return data; + return data; } } @@ -10893,6 +11929,64 @@ export interface IFileServiceDiscoveryProvider { namespace: string | undefined; } +export class FileTokenOutput implements IFileTokenOutput { + accessKeyId!: string | undefined; + accessKeySecret!: string | undefined; + token!: string | undefined; + /** 过期时间 */ + expiration!: string | undefined; + bucket!: string | undefined; + region!: string | undefined; + + constructor(data?: IFileTokenOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.accessKeyId = _data["accessKeyId"]; + this.accessKeySecret = _data["accessKeySecret"]; + this.token = _data["token"]; + this.expiration = _data["expiration"]; + this.bucket = _data["bucket"]; + this.region = _data["region"]; + } + } + + static fromJS(data: any): FileTokenOutput { + data = typeof data === 'object' ? data : {}; + let result = new FileTokenOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["accessKeyId"] = this.accessKeyId; + data["accessKeySecret"] = this.accessKeySecret; + data["token"] = this.token; + data["expiration"] = this.expiration; + data["bucket"] = this.bucket; + data["region"] = this.region; + return data; + } +} + +export interface IFileTokenOutput { + accessKeyId: string | undefined; + accessKeySecret: string | undefined; + token: string | undefined; + /** 过期时间 */ + expiration: string | undefined; + bucket: string | undefined; + region: string | undefined; +} + export class FindTenantByNameInput implements IFindTenantByNameInput { name!: string | undefined; @@ -10921,7 +12015,7 @@ export class FindTenantByNameInput implements IFindTenantByNameInput { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["name"] = this.name; - return data; + return data; } } @@ -10966,7 +12060,7 @@ export class FindTenantResultDto implements IFindTenantResultDto { data["tenantId"] = this.tenantId; data["name"] = this.name; data["isActive"] = this.isActive; - return data; + return data; } } @@ -11059,7 +12153,7 @@ export class GetAuditLogPageListOutput implements IGetAuditLogPageListOutput { data["exceptions"] = this.exceptions; data["comments"] = this.comments; data["httpStatusCode"] = this.httpStatusCode; - return data; + return data; } } @@ -11124,7 +12218,7 @@ export class GetAuditLogPageListOutputPagedResultDto implements IGetAuditLogPage data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -11169,7 +12263,7 @@ export class GetFeatureListResultDto implements IGetFeatureListResultDto { for (let item of this.groups) data["groups"].push(item.toJSON()); } - return data; + return data; } } @@ -11208,7 +12302,7 @@ export class GetPermissionInput implements IGetPermissionInput { data = typeof data === 'object' ? data : {}; data["providerName"] = this.providerName; data["providerKey"] = this.providerKey; - return data; + return data; } } @@ -11256,7 +12350,7 @@ export class GetPermissionListResultDto implements IGetPermissionListResultDto { for (let item of this.groups) data["groups"].push(item.toJSON()); } - return data; + return data; } } @@ -11357,7 +12451,7 @@ export class IanaTimeZone implements IIanaTimeZone { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["timeZoneName"] = this.timeZoneName; - return data; + return data; } } @@ -11414,7 +12508,7 @@ export class IdentityRoleCreateDto implements IIdentityRoleCreateDto { data["name"] = this.name; data["isDefault"] = this.isDefault; data["isPublic"] = this.isPublic; - return data; + return data; } } @@ -11483,7 +12577,7 @@ export class IdentityRoleDto implements IIdentityRoleDto { data["isStatic"] = this.isStatic; data["isPublic"] = this.isPublic; data["concurrencyStamp"] = this.concurrencyStamp; - return data; + return data; } } @@ -11533,7 +12627,7 @@ export class IdentityRoleDtoListResultDto implements IIdentityRoleDtoListResultD for (let item of this.items) data["items"].push(item.toJSON()); } - return data; + return data; } } @@ -11580,7 +12674,7 @@ export class IdentityRoleDtoPagedResultDto implements IIdentityRoleDtoPagedResul data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -11641,7 +12735,7 @@ export class IdentityRoleUpdateDto implements IIdentityRoleUpdateDto { data["isDefault"] = this.isDefault; data["isPublic"] = this.isPublic; data["concurrencyStamp"] = this.concurrencyStamp; - return data; + return data; } } @@ -11728,7 +12822,7 @@ export class IdentityUserCreateDto implements IIdentityUserCreateDto { data["roleNames"].push(item); } data["password"] = this.password; - return data; + return data; } } @@ -11845,7 +12939,7 @@ export class IdentityUserDto implements IIdentityUserDto { data["lockoutEnabled"] = this.lockoutEnabled; data["lockoutEnd"] = this.lockoutEnd ? this.lockoutEnd.toISOString() : undefined; data["concurrencyStamp"] = this.concurrencyStamp; - return data; + return data; } } @@ -11912,7 +13006,7 @@ export class IdentityUserDtoPagedResultDto implements IIdentityUserDtoPagedResul data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -11999,7 +13093,7 @@ export class IdentityUserUpdateDto implements IIdentityUserUpdateDto { } data["password"] = this.password; data["concurrencyStamp"] = this.concurrencyStamp; - return data; + return data; } } @@ -12056,7 +13150,7 @@ export class IdentityUserUpdateRolesDto implements IIdentityUserUpdateRolesDto { for (let item of this.roleNames) data["roleNames"].push(item); } - return data; + return data; } } @@ -12092,7 +13186,7 @@ export class IdInput implements IIdInput { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["id"] = this.id; - return data; + return data; } } @@ -12146,7 +13240,7 @@ export class IStringValueType implements IIStringValueType { } } data["validator"] = this.validator ? this.validator.toJSON() : undefined; - return data; + return data; } } @@ -12199,7 +13293,7 @@ export class IValueValidator implements IIValueValidator { (data["properties"])[key] = this.properties[key]; } } - return data; + return data; } } @@ -12245,7 +13339,7 @@ export class LanguageInfo implements ILanguageInfo { data["uiCultureName"] = this.uiCultureName; data["displayName"] = this.displayName; data["flagIcon"] = this.flagIcon; - return data; + return data; } } @@ -12287,7 +13381,7 @@ export class LocalizableStringDto implements ILocalizableStringDto { data = typeof data === 'object' ? data : {}; data["name"] = this.name; data["resource"] = this.resource; - return data; + return data; } } @@ -12327,7 +13421,7 @@ export class LockUserInput implements ILockUserInput { data = typeof data === 'object' ? data : {}; data["userId"] = this.userId; data["locked"] = this.locked; - return data; + return data; } } @@ -12370,7 +13464,7 @@ export class LoginInput implements ILoginInput { data = typeof data === 'object' ? data : {}; data["name"] = this.name; data["password"] = this.password; - return data; + return data; } } @@ -12430,7 +13524,7 @@ export class LoginOutput implements ILoginOutput { for (let item of this.roles) data["roles"].push(item); } - return data; + return data; } } @@ -12499,7 +13593,7 @@ export class MethodParameterApiDescriptionModel implements IMethodParameterApiDe data["typeSimple"] = this.typeSimple; data["isOptional"] = this.isOptional; data["defaultValue"] = this.defaultValue; - return data; + return data; } } @@ -12558,7 +13652,7 @@ export class ModuleApiDescriptionModel implements IModuleApiDescriptionModel { (data["controllers"])[key] = this.controllers[key] ? this.controllers[key].toJSON() : undefined; } } - return data; + return data; } } @@ -12623,7 +13717,7 @@ export class ModuleExtensionDto implements IModuleExtensionDto { (data["configuration"])[key] = this.configuration[key]; } } - return data; + return data; } } @@ -12660,7 +13754,7 @@ export class MultiTenancyInfoDto implements IMultiTenancyInfoDto { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["isEnabled"] = this.isEnabled; - return data; + return data; } } @@ -12699,7 +13793,7 @@ export class NameValue implements INameValue { data = typeof data === 'object' ? data : {}; data["name"] = this.name; data["value"] = this.value; - return data; + return data; } } @@ -12763,7 +13857,7 @@ export class ObjectExtensionsDto implements IObjectExtensionsDto { (data["enums"])[key] = this.enums[key] ? this.enums[key].toJSON() : undefined; } } - return data; + return data; } } @@ -12812,7 +13906,7 @@ export class PagingApiRseourceListInput implements IPagingApiRseourceListInput { data["pageSize"] = this.pageSize; data["skipCount"] = this.skipCount; data["filter"] = this.filter; - return data; + return data; } } @@ -12866,7 +13960,7 @@ export class PagingApiScopeListInput implements IPagingApiScopeListInput { data["pageSize"] = this.pageSize; data["skipCount"] = this.skipCount; data["filter"] = this.filter; - return data; + return data; } } @@ -12929,7 +14023,7 @@ export class PagingApiScopeListOutput implements IPagingApiScopeListOutput { data["required"] = this.required; data["emphasize"] = this.emphasize; data["showInDiscoveryDocument"] = this.showInDiscoveryDocument; - return data; + return data; } } @@ -12983,7 +14077,7 @@ export class PagingApiScopeListOutputPagedResultDto implements IPagingApiScopeLi data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -13065,7 +14159,7 @@ export class PagingAuditLogListInput implements IPagingAuditLogListInput { data["minExecutionDuration"] = this.minExecutionDuration; data["hasException"] = this.hasException; data["httpStatusCode"] = this.httpStatusCode; - return data; + return data; } } @@ -13130,7 +14224,7 @@ export class PagingClientListInput implements IPagingClientListInput { data["pageSize"] = this.pageSize; data["skipCount"] = this.skipCount; data["filter"] = this.filter; - return data; + return data; } } @@ -13388,7 +14482,7 @@ export class PagingClientListOutput implements IPagingClientListOutput { for (let item of this.properties) data["properties"].push(item.toJSON()); } - return data; + return data; } } @@ -13483,7 +14577,7 @@ export class PagingClientListOutputPagedResultDto implements IPagingClientListOu data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -13535,7 +14629,7 @@ export class PagingDataDictionaryDetailInput implements IPagingDataDictionaryDet data["skipCount"] = this.skipCount; data["dataDictionaryId"] = this.dataDictionaryId; data["filter"] = this.filter; - return data; + return data; } } @@ -13602,7 +14696,7 @@ export class PagingDataDictionaryDetailOutput implements IPagingDataDictionaryDe data["displayText"] = this.displayText; data["description"] = this.description; data["isEnabled"] = this.isEnabled; - return data; + return data; } } @@ -13661,7 +14755,7 @@ export class PagingDataDictionaryDetailOutputPagedResultDto implements IPagingDa data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -13710,7 +14804,7 @@ export class PagingDataDictionaryInput implements IPagingDataDictionaryInput { data["pageSize"] = this.pageSize; data["skipCount"] = this.skipCount; data["filter"] = this.filter; - return data; + return data; } } @@ -13764,7 +14858,7 @@ export class PagingDataDictionaryOutput implements IPagingDataDictionaryOutput { data["code"] = this.code; data["displayText"] = this.displayText; data["description"] = this.description; - return data; + return data; } } @@ -13817,7 +14911,7 @@ export class PagingDataDictionaryOutputPagedResultDto implements IPagingDataDict data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -13872,7 +14966,7 @@ export class PagingElasticSearchLogInput implements IPagingElasticSearchLogInput data["filter"] = this.filter; data["startCreationTime"] = this.startCreationTime ? this.startCreationTime.toISOString() : undefined; data["endCreationTime"] = this.endCreationTime ? this.endCreationTime.toISOString() : undefined; - return data; + return data; } } @@ -13925,7 +15019,7 @@ export class PagingElasticSearchLogOutput implements IPagingElasticSearchLogOutp data["level"] = this.level; data["message"] = this.message; data["creationTime"] = this.creationTime ? this.creationTime.toISOString() : undefined; - return data; + return data; } } @@ -13977,7 +15071,7 @@ export class PagingElasticSearchLogOutputCustomePagedResultDto implements IPagin data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -13986,6 +15080,160 @@ export interface IPagingElasticSearchLogOutputCustomePagedResultDto { totalCount: number; } +export class PagingFileInput implements IPagingFileInput { + /** 当前页面.默认从1开始 */ + pageIndex!: number; + /** 每页多少条.每页显示多少记录 */ + pageSize!: number; + /** 跳过多少条 */ + readonly skipCount!: number; + filter!: string | undefined; + + constructor(data?: IPagingFileInput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.pageIndex = _data["pageIndex"]; + this.pageSize = _data["pageSize"]; + (this).skipCount = _data["skipCount"]; + this.filter = _data["filter"]; + } + } + + static fromJS(data: any): PagingFileInput { + data = typeof data === 'object' ? data : {}; + let result = new PagingFileInput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["pageIndex"] = this.pageIndex; + data["pageSize"] = this.pageSize; + data["skipCount"] = this.skipCount; + data["filter"] = this.filter; + return data; + } +} + +export interface IPagingFileInput { + /** 当前页面.默认从1开始 */ + pageIndex: number; + /** 每页多少条.每页显示多少记录 */ + pageSize: number; + /** 跳过多少条 */ + skipCount: number; + filter: string | undefined; +} + +export class PagingFileOutput implements IPagingFileOutput { + id!: string; + tenantId!: string | undefined; + fileName!: string | undefined; + filePath!: string | undefined; + creationTime!: moment.Moment; + + constructor(data?: IPagingFileOutput) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.id = _data["id"]; + this.tenantId = _data["tenantId"]; + this.fileName = _data["fileName"]; + this.filePath = _data["filePath"]; + this.creationTime = _data["creationTime"] ? moment(_data["creationTime"].toString()) : undefined; + } + } + + static fromJS(data: any): PagingFileOutput { + data = typeof data === 'object' ? data : {}; + let result = new PagingFileOutput(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["id"] = this.id; + data["tenantId"] = this.tenantId; + data["fileName"] = this.fileName; + data["filePath"] = this.filePath; + data["creationTime"] = this.creationTime ? this.creationTime.toISOString() : undefined; + return data; + } +} + +export interface IPagingFileOutput { + id: string; + tenantId: string | undefined; + fileName: string | undefined; + filePath: string | undefined; + creationTime: moment.Moment; +} + +export class PagingFileOutputPagedResultDto implements IPagingFileOutputPagedResultDto { + items!: PagingFileOutput[] | undefined; + totalCount!: number; + + constructor(data?: IPagingFileOutputPagedResultDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + if (Array.isArray(_data["items"])) { + this.items = [] as any; + for (let item of _data["items"]) + this.items!.push(PagingFileOutput.fromJS(item)); + } + this.totalCount = _data["totalCount"]; + } + } + + static fromJS(data: any): PagingFileOutputPagedResultDto { + data = typeof data === 'object' ? data : {}; + let result = new PagingFileOutputPagedResultDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + if (Array.isArray(this.items)) { + data["items"] = []; + for (let item of this.items) + data["items"].push(item.toJSON()); + } + data["totalCount"] = this.totalCount; + return data; + } +} + +export interface IPagingFileOutputPagedResultDto { + items: PagingFileOutput[] | undefined; + totalCount: number; +} + export class PagingIdentityResourceListInput implements IPagingIdentityResourceListInput { /** 当前页面.默认从1开始 */ pageIndex!: number; @@ -14026,7 +15274,7 @@ export class PagingIdentityResourceListInput implements IPagingIdentityResourceL data["pageSize"] = this.pageSize; data["skipCount"] = this.skipCount; data["filter"] = this.filter; - return data; + return data; } } @@ -14089,7 +15337,7 @@ export class PagingIdentityResourceListOutput implements IPagingIdentityResource data["required"] = this.required; data["emphasize"] = this.emphasize; data["showInDiscoveryDocument"] = this.showInDiscoveryDocument; - return data; + return data; } } @@ -14143,7 +15391,7 @@ export class PagingIdentityResourceListOutputPagedResultDto implements IPagingId data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -14189,7 +15437,7 @@ export class PagingNotificationListInput implements IPagingNotificationListInput data["pageIndex"] = this.pageIndex; data["pageSize"] = this.pageSize; data["skipCount"] = this.skipCount; - return data; + return data; } } @@ -14242,7 +15490,7 @@ export class PagingNotificationListOutput implements IPagingNotificationListOutp data["content"] = this.content; data["creationTime"] = this.creationTime ? this.creationTime.toISOString() : undefined; data["read"] = this.read; - return data; + return data; } } @@ -14293,7 +15541,7 @@ export class PagingNotificationListOutputPagedResultDto implements IPagingNotifi data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -14342,7 +15590,7 @@ export class PagingRoleListInput implements IPagingRoleListInput { data["pageSize"] = this.pageSize; data["skipCount"] = this.skipCount; data["filter"] = this.filter; - return data; + return data; } } @@ -14396,7 +15644,7 @@ export class PagingTenantInput implements IPagingTenantInput { data["pageSize"] = this.pageSize; data["skipCount"] = this.skipCount; data["filter"] = this.filter; - return data; + return data; } } @@ -14451,7 +15699,7 @@ export class PagingUserListInput implements IPagingUserListInput { data["pageSize"] = this.pageSize; data["skipCount"] = this.skipCount; data["filter"] = this.filter; - return data; + return data; } } @@ -14529,7 +15777,7 @@ export class ParameterApiDescriptionModel implements IParameterApiDescriptionMod } data["bindingSourceId"] = this.bindingSourceId; data["descriptorName"] = this.descriptorName; - return data; + return data; } } @@ -14605,7 +15853,7 @@ export class PermissionGrantInfoDto implements IPermissionGrantInfoDto { for (let item of this.grantedProviders) data["grantedProviders"].push(item.toJSON()); } - return data; + return data; } } @@ -14660,7 +15908,7 @@ export class PermissionGroupDto implements IPermissionGroupDto { for (let item of this.permissions) data["permissions"].push(item.toJSON()); } - return data; + return data; } } @@ -14728,7 +15976,7 @@ export class PermissionOutput implements IPermissionOutput { for (let item of this.permissions) data["permissions"].push(item.toJSON()); } - return data; + return data; } } @@ -14780,7 +16028,7 @@ export class PermissionTreeDto implements IPermissionTreeDto { for (let item of this.children) data["children"].push(item.toJSON()); } - return data; + return data; } } @@ -14854,7 +16102,7 @@ export class ProfileDto implements IProfileDto { data["isExternal"] = this.isExternal; data["hasPassword"] = this.hasPassword; data["concurrencyStamp"] = this.concurrencyStamp; - return data; + return data; } } @@ -14910,7 +16158,7 @@ export class PropertyApiDescriptionModel implements IPropertyApiDescriptionModel data["type"] = this.type; data["typeSimple"] = this.typeSimple; data["isRequired"] = this.isRequired; - return data; + return data; } } @@ -14953,7 +16201,7 @@ export class ProviderInfoDto implements IProviderInfoDto { data = typeof data === 'object' ? data : {}; data["providerName"] = this.providerName; data["providerKey"] = this.providerKey; - return data; + return data; } } @@ -15014,7 +16262,7 @@ export class RegisterDto implements IRegisterDto { data["emailAddress"] = this.emailAddress; data["password"] = this.password; data["appName"] = this.appName; - return data; + return data; } } @@ -15086,7 +16334,7 @@ export class RemoteServiceErrorInfo implements IRemoteServiceErrorInfo { for (let item of this.validationErrors) data["validationErrors"].push(item.toJSON()); } - return data; + return data; } } @@ -15126,7 +16374,7 @@ export class RemoteServiceErrorResponse implements IRemoteServiceErrorResponse { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["error"] = this.error ? this.error.toJSON() : undefined; - return data; + return data; } } @@ -15173,7 +16421,7 @@ export class RemoteServiceValidationErrorInfo implements IRemoteServiceValidatio for (let item of this.members) data["members"].push(item); } - return data; + return data; } } @@ -15213,7 +16461,7 @@ export class RemoveCorsInput implements IRemoveCorsInput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["origin"] = this.origin; - return data; + return data; } } @@ -15253,7 +16501,7 @@ export class RemoveRedirectUriInput implements IRemoveRedirectUriInput { data = typeof data === 'object' ? data : {}; data["clientId"] = this.clientId; data["uri"] = this.uri; - return data; + return data; } } @@ -15296,7 +16544,7 @@ export class ResetPasswordDto implements IResetPasswordDto { data["userId"] = this.userId; data["resetToken"] = this.resetToken; data["password"] = this.password; - return data; + return data; } } @@ -15337,7 +16585,7 @@ export class ReturnValueApiDescriptionModel implements IReturnValueApiDescriptio data = typeof data === 'object' ? data : {}; data["type"] = this.type; data["typeSimple"] = this.typeSimple; - return data; + return data; } } @@ -15346,6 +16594,42 @@ export interface IReturnValueApiDescriptionModel { typeSimple: string | undefined; } +export class SampleDto implements ISampleDto { + value!: number; + + constructor(data?: ISampleDto) { + if (data) { + for (var property in data) { + if (data.hasOwnProperty(property)) + (this)[property] = (data)[property]; + } + } + } + + init(_data?: any) { + if (_data) { + this.value = _data["value"]; + } + } + + static fromJS(data: any): SampleDto { + data = typeof data === 'object' ? data : {}; + let result = new SampleDto(); + result.init(data); + return result; + } + + toJSON(data?: any) { + data = typeof data === 'object' ? data : {}; + data["value"] = this.value; + return data; + } +} + +export interface ISampleDto { + value: number; +} + export class SendPasswordResetCodeDto implements ISendPasswordResetCodeDto { email!: string; appName!: string; @@ -15383,7 +16667,7 @@ export class SendPasswordResetCodeDto implements ISendPasswordResetCodeDto { data["appName"] = this.appName; data["returnUrl"] = this.returnUrl; data["returnUrlHash"] = this.returnUrlHash; - return data; + return data; } } @@ -15428,7 +16712,7 @@ export class SetDataDictinaryDetailInput implements ISetDataDictinaryDetailInput data["dataDictionaryId"] = this.dataDictionaryId; data["dataDictionayDetailId"] = this.dataDictionayDetailId; data["isEnabled"] = this.isEnabled; - return data; + return data; } } @@ -15469,7 +16753,7 @@ export class SetReadInput implements ISetReadInput { data = typeof data === 'object' ? data : {}; data["id"] = this.id; data["receiveId"] = this.receiveId; - return data; + return data; } } @@ -15523,7 +16807,7 @@ export class SettingItemOutput implements ISettingItemOutput { data["description"] = this.description; data["value"] = this.value; data["type"] = this.type; - return data; + return data; } } @@ -15584,7 +16868,7 @@ export class SettingOutput implements ISettingOutput { for (let item of this.settingItemOutput) data["settingItemOutput"].push(item.toJSON()); } - return data; + return data; } } @@ -15627,7 +16911,7 @@ export class StringStringFromSelector implements IStringStringFromSelector { data = typeof data === 'object' ? data : {}; data["value"] = this.value; data["label"] = this.label; - return data; + return data; } } @@ -15685,7 +16969,7 @@ export class TenantCreateDto implements ITenantCreateDto { data["name"] = this.name; data["adminEmailAddress"] = this.adminEmailAddress; data["adminPassword"] = this.adminPassword; - return data; + return data; } } @@ -15745,7 +17029,7 @@ export class TenantDto implements ITenantDto { data["id"] = this.id; data["name"] = this.name; data["concurrencyStamp"] = this.concurrencyStamp; - return data; + return data; } } @@ -15795,7 +17079,7 @@ export class TenantDtoPagedResultDto implements ITenantDtoPagedResultDto { data["items"].push(item.toJSON()); } data["totalCount"] = this.totalCount; - return data; + return data; } } @@ -15850,7 +17134,7 @@ export class TenantUpdateDto implements ITenantUpdateDto { } data["name"] = this.name; data["concurrencyStamp"] = this.concurrencyStamp; - return data; + return data; } } @@ -15891,7 +17175,7 @@ export class TimeZone implements ITimeZone { data = typeof data === 'object' ? data : {}; data["iana"] = this.iana ? this.iana.toJSON() : undefined; data["windows"] = this.windows ? this.windows.toJSON() : undefined; - return data; + return data; } } @@ -15928,7 +17212,7 @@ export class TimingDto implements ITimingDto { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["timeZone"] = this.timeZone ? this.timeZone.toJSON() : undefined; - return data; + return data; } } @@ -16011,7 +17295,7 @@ export class TypeApiDescriptionModel implements ITypeApiDescriptionModel { for (let item of this.properties) data["properties"].push(item.toJSON()); } - return data; + return data; } } @@ -16175,7 +17459,7 @@ export class UpdataBasicDataInput implements IUpdataBasicDataInput { data["secret"] = this.secret; data["secretType"] = this.secretType; data["allowedGrantTypes"] = this.allowedGrantTypes; - return data; + return data; } } @@ -16281,7 +17565,7 @@ export class UpdateApiResourceInput implements IUpdateApiResourceInput { for (let item of this.apiScopes) data["apiScopes"].push(item); } - return data; + return data; } } @@ -16327,7 +17611,7 @@ export class UpdateConnectionStringInput implements IUpdateConnectionStringInput data = typeof data === 'object' ? data : {}; data["id"] = this.id; data["connectionString"] = this.connectionString; - return data; + return data; } } @@ -16385,7 +17669,7 @@ export class UpdateCreateApiScopeInput implements IUpdateCreateApiScopeInput { data["required"] = this.required; data["emphasize"] = this.emphasize; data["showInDiscoveryDocument"] = this.showInDiscoveryDocument; - return data; + return data; } } @@ -16440,7 +17724,7 @@ export class UpdateDetailInput implements IUpdateDetailInput { data["displayText"] = this.displayText; data["description"] = this.description; data["order"] = this.order; - return data; + return data; } } @@ -16504,7 +17788,7 @@ export class UpdateEmailSettingsDto implements IUpdateEmailSettingsDto { data["smtpUseDefaultCredentials"] = this.smtpUseDefaultCredentials; data["defaultFromAddress"] = this.defaultFromAddress; data["defaultFromDisplayName"] = this.defaultFromDisplayName; - return data; + return data; } } @@ -16551,7 +17835,7 @@ export class UpdateFeatureDto implements IUpdateFeatureDto { data = typeof data === 'object' ? data : {}; data["name"] = this.name; data["value"] = this.value; - return data; + return data; } } @@ -16596,7 +17880,7 @@ export class UpdateFeaturesDto implements IUpdateFeaturesDto { for (let item of this.features) data["features"].push(item.toJSON()); } - return data; + return data; } } @@ -16650,7 +17934,7 @@ export class UpdateIdentityResourceInput implements IUpdateIdentityResourceInput data["required"] = this.required; data["emphasize"] = this.emphasize; data["showInDiscoveryDocument"] = this.showInDiscoveryDocument; - return data; + return data; } } @@ -16695,7 +17979,7 @@ export class UpdatePermissionDto implements IUpdatePermissionDto { data = typeof data === 'object' ? data : {}; data["name"] = this.name; data["isGranted"] = this.isGranted; - return data; + return data; } } @@ -16740,7 +18024,7 @@ export class UpdatePermissionsDto implements IUpdatePermissionsDto { for (let item of this.permissions) data["permissions"].push(item.toJSON()); } - return data; + return data; } } @@ -16806,7 +18090,7 @@ export class UpdateProfileDto implements IUpdateProfileDto { data["surname"] = this.surname; data["phoneNumber"] = this.phoneNumber; data["concurrencyStamp"] = this.concurrencyStamp; - return data; + return data; } } @@ -16851,7 +18135,7 @@ export class UpdateRoleInput implements IUpdateRoleInput { data = typeof data === 'object' ? data : {}; data["roleId"] = this.roleId; data["roleInfo"] = this.roleInfo ? this.roleInfo.toJSON() : undefined; - return data; + return data; } } @@ -16894,7 +18178,7 @@ export class UpdateRolePermissionsInput implements IUpdateRolePermissionsInput { data["providerName"] = this.providerName; data["providerKey"] = this.providerKey; data["updatePermissionsDto"] = this.updatePermissionsDto ? this.updatePermissionsDto.toJSON() : undefined; - return data; + return data; } } @@ -16943,7 +18227,7 @@ export class UpdateScopeInput implements IUpdateScopeInput { for (let item of this.scopes) data["scopes"].push(item); } - return data; + return data; } } @@ -16992,7 +18276,7 @@ export class UpdateSettingInput implements IUpdateSettingInput { (data["values"])[key] = this.values[key]; } } - return data; + return data; } } @@ -17031,7 +18315,7 @@ export class UpdateTenantInput implements IUpdateTenantInput { data = typeof data === 'object' ? data : {}; data["id"] = this.id; data["name"] = this.name; - return data; + return data; } } @@ -17071,7 +18355,7 @@ export class UpdateUserInput implements IUpdateUserInput { data = typeof data === 'object' ? data : {}; data["userId"] = this.userId; data["userInfo"] = this.userInfo ? this.userInfo.toJSON() : undefined; - return data; + return data; } } @@ -17132,7 +18416,7 @@ export class UserData implements IUserData { data["emailConfirmed"] = this.emailConfirmed; data["phoneNumber"] = this.phoneNumber; data["phoneNumberConfirmed"] = this.phoneNumberConfirmed; - return data; + return data; } } @@ -17184,7 +18468,7 @@ export class UserDataListResultDto implements IUserDataListResultDto { for (let item of this.items) data["items"].push(item.toJSON()); } - return data; + return data; } } @@ -17226,7 +18510,7 @@ export class UserLoginInfo implements IUserLoginInfo { data["userNameOrEmailAddress"] = this.userNameOrEmailAddress; data["password"] = this.password; data["rememberMe"] = this.rememberMe; - return data; + return data; } } @@ -17264,7 +18548,7 @@ export class WindowsTimeZone implements IWindowsTimeZone { toJSON(data?: any) { data = typeof data === 'object' ? data : {}; data["timeZoneId"] = this.timeZoneId; - return data; + return data; } } diff --git a/vben271/src/views/admin/files/File.ts b/vben271/src/views/admin/files/File.ts new file mode 100644 index 00000000..a411cab9 --- /dev/null +++ b/vben271/src/views/admin/files/File.ts @@ -0,0 +1,39 @@ +import { FormSchema } from '/@/components/Table'; +import { BasicColumn } from '/@/components/Table'; +import moment from 'moment'; +import { FilesServiceProxy, PagingFileInput } from '/@/services/ServiceProxies'; +import { useI18n } from '/@/hooks/web/useI18n'; +const { t } = useI18n(); +export const searchFormSchema: FormSchema[] = [ + { + field: 'filter', + label: t('routes.admin.fileName'), + component: 'Input', + colProps: { span: 8 }, + }, +]; + +export const tableColumns: BasicColumn[] = [ + { + title: t('routes.admin.fileName'), + dataIndex: 'fileName', + }, + + { + title: t('routes.admin.userManagement_createTime'), + dataIndex: 'creationTime', + customRender: ({ text }) => { + return moment(text).format('YYYY-MM-DD HH:mm:ss'); + }, + }, +]; + +/** + * 分页列表 + * @param params + * @returns + */ +export async function getTableListAsync(params: PagingFileInput) { + const _filesServiceProxy = new FilesServiceProxy(); + return _filesServiceProxy.page(params); +} diff --git a/vben271/src/views/admin/files/File.vue b/vben271/src/views/admin/files/File.vue new file mode 100644 index 00000000..7bf04cbb --- /dev/null +++ b/vben271/src/views/admin/files/File.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/vben271/src/views/admin/files/UploadOss.ts b/vben271/src/views/admin/files/UploadOss.ts new file mode 100644 index 00000000..edf75278 --- /dev/null +++ b/vben271/src/views/admin/files/UploadOss.ts @@ -0,0 +1,69 @@ +import { FilesServiceProxy, FileTokenOutput } from '/@/services/ServiceProxies'; +import OSS from 'ali-oss'; +import moment from 'moment'; + +export async function importFileAsync({ request }) { + const _filesServiceProxy = new FilesServiceProxy(); + await _filesServiceProxy.create(request); +} + +async function getFileTokenAsync() { + const _filesServiceProxy = new FilesServiceProxy(); + var result = await _filesServiceProxy.getFileToken(); + sessionStorage.setItem('oss', JSON.stringify(result)); + return result; +} + +export async function getOSSClient(): Promise { + let fileToken = new FileTokenOutput(); + try { + let oss = sessionStorage.getItem('oss'); + if (!oss) { + fileToken = await getFileTokenAsync(); + } else { + fileToken = JSON.parse(oss); + + let expiration = moment(fileToken.expiration).format('YYYY-MM-DD HH:mm:ss'); + debugger; + if (expiration < formatDate(moment.now())) { + fileToken = await getFileTokenAsync(); + } + } + let requet = { + region: fileToken.region, + accessKeyId: fileToken.accessKeyId, + accessKeySecret: fileToken.accessKeySecret, + bucket: fileToken.bucket, + stsToken: fileToken.token as string, + }; + + return Promise.resolve(new OSS(requet)); + } catch (error) { + console.error('获取oss Client失败'); + } +} + +export async function downLoadFile(fileName) { + let oss = await getOSSClient(); + const response = { + 'content-disposition': `attachment; filename=${encodeURIComponent(fileName)}`, + }; + const url = (oss as OSS).signatureUrl(fileName, { response }); + let link = document.createElement('a'); //创建a标签 + link.style.display = 'none'; //使其隐藏 + link.href = url; //赋予文件下载地址 + link.setAttribute('download', fileName); //设置下载属性 以及文件名 + document.body.appendChild(link); //a标签插至页面中 + link.click(); //强制触发a标签事件 +} + +function formatDate(dateTime) { + var date = new Date(dateTime); + var YY = date.getFullYear() + '-'; + var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; + var DD = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); + var hh = date.getHours() + ':'; + var mm = date.getMinutes() + ':'; + var ss = date.getSeconds(); + return YY + MM + DD + ' ' + hh + mm + ss; +} diff --git a/vben271/src/views/admin/users/AbpUser.vue b/vben271/src/views/admin/users/AbpUser.vue index 53067707..040932d8 100644 --- a/vben271/src/views/admin/users/AbpUser.vue +++ b/vben271/src/views/admin/users/AbpUser.vue @@ -73,7 +73,6 @@ import { useModal } from '/@/components/Modal'; import CreateAbpUser from './CreateAbpUser.vue'; import EditAbpUser from './EditAbpUser.vue'; - import { useUserStoreWithOut } from '/@/store/modules/user'; import { message } from 'ant-design-vue'; import { useI18n } from '/@/hooks/web/useI18n'; import { LockUserInput } from '/@/services/ServiceProxies'; @@ -88,9 +87,6 @@ Tag, }, setup() { - const userStore = useUserStoreWithOut(); - const userInfo = userStore.getUserInfo; - let currentUserId = userInfo.userId; const { createConfirm } = useMessage(); const { t } = useI18n(); const [registerCreateAbpUserModal, { openModal: openCreateAbpUserModal }] = useModal(); @@ -147,14 +143,6 @@ }; const handleLock = async (record: Recordable) => { - if (!record.lockoutEnabled && currentUserId === record.id) { - createConfirm({ - iconType: 'warning', - title: t('common.tip'), - content: t('common.disEnabledSelf'), - }); - return; - } let request = new LockUserInput(); request.userId = record.id; request.locked = !record.isActive;