feat: Add SitePageSettings - simplified page management system
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m2s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m2s
- New entities: SitePageSettings + SitePageImage (4 fixed pages) - EF Migration: AddSitePageSettings (SitePageSettings + SitePageImages tables) - Proto: sitepagesettings.proto with 5 RPCs - CQRS: GetPageSettings, GetAllPageSettings, SavePageSettings, SavePageImage, DeletePageImage - gRPC Service: SitePageSettingsService (auto-registered) - Proto NuGet bumped to 0.0.180
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.0.179</Version>
|
||||
<Version>0.0.180</Version>
|
||||
<DebugType>None</DebugType>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
@@ -71,6 +71,7 @@
|
||||
<Protobuf Include="Protos\blogcategory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\blogpostimage.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\sitepage.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\sitepagesettings.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<!-- Image Resolver Service -->
|
||||
<Protobuf Include="Protos\imageresolver.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package sitepagesettings;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.SitePageSettings";
|
||||
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
// سرویس مدیریت صفحات سایت (نسخه سادهشده)
|
||||
// ۴ صفحه ثابت: landing, about, contact, licenses
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
service SitePageSettingsContract
|
||||
{
|
||||
// دریافت تنظیمات صفحه با کلید — مورد استفاده FrontOffice
|
||||
rpc GetPageSettings(GetPageSettingsRequest) returns (PageSettingsResponse){
|
||||
option (google.api.http) = { get: "/api/page-settings/{page_key}" };
|
||||
};
|
||||
|
||||
// دریافت لیست همه صفحات — مورد استفاده BackOffice
|
||||
rpc GetAllPageSettings(GetAllPageSettingsRequest) returns (GetAllPageSettingsResponse){
|
||||
option (google.api.http) = { get: "/api/page-settings" };
|
||||
};
|
||||
|
||||
// ذخیره تنظیمات صفحه — مورد استفاده BackOffice
|
||||
rpc SavePageSettings(SavePageSettingsRequest) returns (SavePageSettingsResponse){
|
||||
option (google.api.http) = { put: "/api/page-settings" body: "*" };
|
||||
};
|
||||
|
||||
// ذخیره تصویر صفحه (مجوزها، تیم، ارزشها) — مورد استفاده BackOffice
|
||||
rpc SavePageImage(SavePageImageRequest) returns (SavePageImageResponse){
|
||||
option (google.api.http) = { put: "/api/page-settings/images" body: "*" };
|
||||
};
|
||||
|
||||
// حذف تصویر صفحه — مورد استفاده BackOffice
|
||||
rpc DeletePageImage(DeletePageImageRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = { delete: "/api/page-settings/images/{id}" };
|
||||
};
|
||||
}
|
||||
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
// Get Page Settings
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
message GetPageSettingsRequest
|
||||
{
|
||||
string page_key = 1; // "landing" | "about" | "contact" | "licenses"
|
||||
}
|
||||
|
||||
message PageSettingsResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
string page_key = 2;
|
||||
string title = 3;
|
||||
google.protobuf.StringValue meta_description = 4;
|
||||
google.protobuf.StringValue hero_title = 5;
|
||||
google.protobuf.StringValue hero_subtitle = 6;
|
||||
google.protobuf.StringValue hero_image_path = 7;
|
||||
bool is_active = 8;
|
||||
string settings_json = 9; // JSON تنظیمات — ساختار بر اساس page_key متفاوت
|
||||
repeated PageImageItem images = 10; // تصاویر مرتبط (مجوزها، تیم، ارزشها)
|
||||
}
|
||||
|
||||
message PageImageItem
|
||||
{
|
||||
int64 id = 1;
|
||||
string image_group = 2; // "licenses" | "team" | "values"
|
||||
google.protobuf.StringValue title = 3;
|
||||
google.protobuf.StringValue subtitle = 4;
|
||||
google.protobuf.StringValue description = 5;
|
||||
string image_path = 6;
|
||||
google.protobuf.StringValue thumbnail_path = 7;
|
||||
google.protobuf.StringValue link_url = 8;
|
||||
google.protobuf.StringValue icon_name = 9;
|
||||
int32 sort_order = 10;
|
||||
bool is_active = 11;
|
||||
}
|
||||
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
// Get All Page Settings (Summary)
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
message GetAllPageSettingsRequest {}
|
||||
|
||||
message GetAllPageSettingsResponse
|
||||
{
|
||||
repeated PageSettingsSummary pages = 1;
|
||||
}
|
||||
|
||||
message PageSettingsSummary
|
||||
{
|
||||
int64 id = 1;
|
||||
string page_key = 2;
|
||||
string title = 3;
|
||||
bool is_active = 4;
|
||||
int32 image_count = 5;
|
||||
google.protobuf.Timestamp last_modified = 6;
|
||||
}
|
||||
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
// Save Page Settings
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
message SavePageSettingsRequest
|
||||
{
|
||||
string page_key = 1; // کلید صفحه (نمیتونه تغییر کنه)
|
||||
string title = 2;
|
||||
google.protobuf.StringValue meta_description = 3;
|
||||
google.protobuf.StringValue hero_title = 4;
|
||||
google.protobuf.StringValue hero_subtitle = 5;
|
||||
bool is_active = 6;
|
||||
string settings_json = 7; // JSON تنظیمات
|
||||
PageSettingsImageFile hero_image_file = 8; // آپلود تصویر Hero (اختیاری)
|
||||
}
|
||||
|
||||
message SavePageSettingsResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
bool success = 2;
|
||||
}
|
||||
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
// Save Page Image (Add/Update)
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
message SavePageImageRequest
|
||||
{
|
||||
int64 id = 1; // 0 = ایجاد جدید، > 0 = ویرایش
|
||||
int64 site_page_settings_id = 2; // شناسه صفحه
|
||||
string image_group = 3; // "licenses" | "team" | "values"
|
||||
google.protobuf.StringValue title = 4;
|
||||
google.protobuf.StringValue subtitle = 5;
|
||||
google.protobuf.StringValue description = 6;
|
||||
google.protobuf.StringValue link_url = 7;
|
||||
google.protobuf.StringValue icon_name = 8;
|
||||
int32 sort_order = 9;
|
||||
bool is_active = 10;
|
||||
PageSettingsImageFile image_file = 11; // فایل تصویر (اختیاری برای ویرایش)
|
||||
}
|
||||
|
||||
message SavePageImageResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
bool success = 2;
|
||||
}
|
||||
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
// Delete Page Image
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
message DeletePageImageRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
// File Upload Model
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
message PageSettingsImageFile
|
||||
{
|
||||
bytes file = 1;
|
||||
string mime = 2;
|
||||
string file_name = 3;
|
||||
}
|
||||
Reference in New Issue
Block a user