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; }