From ce84b3baac2142b34fe521d9f959ae2ca7a96f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:48:08 +0300 Subject: [PATCH] =?UTF-8?q?Developer=20Kits=20Dynamic=20Services=20d=C3=BC?= =?UTF-8?q?zeltildi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Seeds/LanguagesData.json | 18 +- .../TableNameResolver.cs | 2 +- ....cs => 20251105111749_Initial.Designer.cs} | 4 +- ...4_Initial.cs => 20251105111749_Initial.cs} | 68 +- .../PlatformDbContextModelSnapshot.cs | 2 +- .../developerKit/ComponentManager.tsx | 2 +- .../developerKit/DynamicAppServiceEditor.tsx | 681 +++++++++--------- .../developerKit/MigrationManager.tsx | 4 +- ui/src/services/dynamicService.service.ts | 6 +- 9 files changed, 392 insertions(+), 395 deletions(-) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251105082644_Initial.Designer.cs => 20251105111749_Initial.Designer.cs} (99%) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251105082644_Initial.cs => 20251105111749_Initial.cs} (99%) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json index b7ee69f1..f6ed100e 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json @@ -685,6 +685,18 @@ "en": "Custom Components", "tr": "Özel Bileşenler" }, + { + "resourceName": "Platform", + "key": "App.DeveloperKit.DynamicServices", + "en": "Dynamic Services", + "tr": "Dinamik Servisler" + }, + { + "resourceName": "Platform", + "key": "App.DeveloperKit.DynamicServices.Description", + "en": "Create and publish dynamic AppServices by writing C# code", + "tr": "C# kod yazarak dinamik AppService'ler oluşturun ve yayınlayın" + }, { "resourceName": "Platform", "key": "App.Forum", @@ -9913,12 +9925,6 @@ "en": "fields", "tr": "alan" }, - { - "resourceName": "Platform", - "key": "App.DeveloperKit.DynamicServices", - "en": "Dynamic Services", - "tr": "Dinamik Hizmetler" - }, { "resourceName": "Platform", "key": "App.DeveloperKit.Migration.Generating", diff --git a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs index 99cac76e..582e0e61 100644 --- a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs @@ -12,7 +12,6 @@ public static class TableNameResolver _map = new(StringComparer.OrdinalIgnoreCase) { // 🔹 MODULE TABLOLARI - { nameof(TableNameEnum.DynamicService), (TablePrefix.PlatformByName, MenuPrefix.Platform) }, { nameof(TableNameEnum.LogEntry), (TablePrefix.PlatformByName, MenuPrefix.Platform) }, { nameof(TableNameEnum.Language), (TablePrefix.PlatformByName, MenuPrefix.Platform) }, { nameof(TableNameEnum.LanguageKey), (TablePrefix.PlatformByName, MenuPrefix.Platform) }, @@ -57,6 +56,7 @@ public static class TableNameResolver { nameof(TableNameEnum.CrudEndpoint), (TablePrefix.TenantByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.CustomEndpoint), (TablePrefix.TenantByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.CustomComponent), (TablePrefix.TenantByName, MenuPrefix.Saas) }, + { nameof(TableNameEnum.DynamicService), (TablePrefix.TenantByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.ReportCategory), (TablePrefix.TenantByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.ReportTemplate), (TablePrefix.TenantByName, MenuPrefix.Saas) }, { nameof(TableNameEnum.ReportParameter), (TablePrefix.TenantByName, MenuPrefix.Saas) }, diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105082644_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105111749_Initial.Designer.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105082644_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105111749_Initial.Designer.cs index d6a554d7..4d71978f 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105082644_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105111749_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251105082644_Initial")] + [Migration("20251105111749_Initial")] partial class Initial { /// @@ -3648,7 +3648,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("Plat_H_DynamicService", (string)null); + b.ToTable("Sas_T_DynamicService", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.EducationStatus", b => diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105082644_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105111749_Initial.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105082644_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105111749_Initial.cs index eb6a85cd..be325691 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105082644_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251105111749_Initial.cs @@ -1477,37 +1477,6 @@ namespace Kurs.Platform.Migrations table.UniqueConstraint("AK_Plat_H_BackgroundWorker_MailQueueTableFormat_TableName", x => x.TableName); }); - migrationBuilder.CreateTable( - name: "Plat_H_DynamicService", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - DisplayName = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), - Description = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - Code = table.Column(type: "text", nullable: false), - IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), - CompilationStatus = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), - LastCompilationError = table.Column(type: "text", nullable: true), - LastSuccessfulCompilation = table.Column(type: "datetime2", nullable: true), - Version = table.Column(type: "int", nullable: false, defaultValue: 1), - CodeHash = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - PrimaryEntityType = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - ControllerName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Plat_H_DynamicService", x => x.Id); - }); - migrationBuilder.CreateTable( name: "Plat_H_Language", columns: table => new @@ -2186,6 +2155,37 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_Sas_T_CustomEntity", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Sas_T_DynamicService", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + DisplayName = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Description = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + Code = table.Column(type: "text", nullable: false), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), + CompilationStatus = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: false), + LastCompilationError = table.Column(type: "text", nullable: true), + LastSuccessfulCompilation = table.Column(type: "datetime2", nullable: true), + Version = table.Column(type: "int", nullable: false, defaultValue: 1), + CodeHash = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + PrimaryEntityType = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ControllerName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Sas_T_DynamicService", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Sas_T_GlobalSearch", columns: table => new @@ -6370,9 +6370,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "Plat_H_BackgroundWorker_MailQueueEvents"); - migrationBuilder.DropTable( - name: "Plat_H_DynamicService"); - migrationBuilder.DropTable( name: "Plat_H_LanguageText"); @@ -6454,6 +6451,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "Sas_T_CustomEntityField"); + migrationBuilder.DropTable( + name: "Sas_T_DynamicService"); + migrationBuilder.DropTable( name: "Sas_T_GlobalSearch"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 4a31110f..93409530 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -3645,7 +3645,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("Plat_H_DynamicService", (string)null); + b.ToTable("Sas_T_DynamicService", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.EducationStatus", b => diff --git a/ui/src/components/developerKit/ComponentManager.tsx b/ui/src/components/developerKit/ComponentManager.tsx index 3dd87b05..f336bf57 100644 --- a/ui/src/components/developerKit/ComponentManager.tsx +++ b/ui/src/components/developerKit/ComponentManager.tsx @@ -92,7 +92,7 @@ const ComponentManager: React.FC = () => {

- {translate('::App.DeveloperKit.Component')} + {translate('::App.DeveloperKit.Components')}

{translate('::App.DeveloperKit.Component.Description')}

diff --git a/ui/src/components/developerKit/DynamicAppServiceEditor.tsx b/ui/src/components/developerKit/DynamicAppServiceEditor.tsx index e7a9d10e..a2909d3a 100644 --- a/ui/src/components/developerKit/DynamicAppServiceEditor.tsx +++ b/ui/src/components/developerKit/DynamicAppServiceEditor.tsx @@ -19,7 +19,7 @@ import { type PublishResult, type DynamicServiceDto, postTestCompile, - TestCompileRequestDto, + TestCompileDto, } from '@/services/dynamicService.service' const DynamicAppServiceEditor: React.FC = () => { @@ -131,10 +131,9 @@ namespace DynamicServices setIsCompiling(true) setCompileResult(null) console.log('Test compile code:', code) - const input = { code: code } as TestCompileRequestDto + const input = { code: code } as TestCompileDto const result = await postTestCompile(input) setCompileResult(result.data) - } catch (error: any) { console.error('Test compile error:', error) console.error('Error response:', error.response?.data) @@ -193,14 +192,14 @@ namespace DynamicServices const loadService = async (service: DynamicServiceDto) => { try { const data = await dynamicServiceService.getById(service.id) - + setSelectedService(data) setCode(data.code) setServiceName(data.name) setDisplayName(data.displayName || '') setDescription(data.description || '') setPrimaryEntityType(data.primaryEntityType || '') - + setCompileResult(null) setPublishResult(null) } catch (error) { @@ -256,367 +255,363 @@ namespace DynamicServices } return ( -
-
- {/* Header */} -
-
-
-

Dynamic AppService Editor

-

- C# kod yazarak dinamik AppService'ler oluşturun ve yayınlayın -

+
+ {/* Header */} +
+
+

+ {translate('::App.DeveloperKit.DynamicServices')} +

+

+ {translate('::App.DeveloperKit.DynamicServices.Description')} +

+
+
+ + +
+
+ +
+ {/* Service List */} + {showServiceList && ( +
+
+
+
+

Mevcut Servisler

+
+ + +
+
+
+ +
+ {isLoading ? ( +
+ + Yükleniyor... +
+ ) : services.length > 0 ? ( + services.map((service) => ( +
loadService(service)} + > +
+
+

{service.name}

+ {service.displayName && ( +

{service.displayName}

+ )} +
+ + {service.compilationStatus} + + v{service.version} +
+
+ +
+
+ )) + ) : ( +
Henüz servis yok
+ )} +
-
+
+ )} + + {/* Main Editor */} +
+ {/* Service Info Form */} +
+
+
+ + setServiceName(e.target.value)} + placeholder="ör: DynamicCustomerAppService" + className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent" + /> +
+
+ + setDisplayName(e.target.value)} + placeholder="ör: Müşteri Yönetimi" + className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent" + /> +
+
+ +