Files
CMS/src/CMSMicroservice.Protobuf/Protos/category.proto
T
masoodafar-web 2502cbbda2
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m44s
feat: integrate PYMS payment gateway, add blog/sitepage/image services, local file manager
Payment Gateway:
- Add PYMSPaymentService: IPaymentGatewayService via gRPC to PYMS microservice
- Add ZarinPalPaymentService: direct ZarinPal integration (backup)
- Register 'pyms' payment provider in DI ConfigureServices
- Add PYMS proto files (pyms_transaction.proto, pyms_public_messages.proto)
- Fix VerifyDiscountWalletCharge: pass 'OK' as status instead of Authority
- Update appsettings: PaymentProvider=pyms, sandbox mode, merchant ID

Blog System:
- Add BlogCategory, BlogPost, BlogPostImage entities and CQRS
- Add proto files and gRPC services for blog management
- Add Mapster profiles for blog responses

Content Management:
- Add SitePage entity and CQRS for static pages
- Add proto and gRPC service for site pages

Image/File Management:
- Add LocalFileManager with disk storage + base64 serving + FMS fallback
- Add ImagePathResolverInterceptor for gRPC responses
- Add ImageResolverService for explicit image resolution
- Add UploadsController for public file serving with FMS fallback
- Add PaymentCallbackController for discount order payment callbacks

Database:
- Add blog and content entity migrations
- Remove ImagePath MaxLength constraints
- Remove old FileManagementService (replaced by LocalFileManager)
2026-02-15 23:01:16 +03:30

181 lines
5.1 KiB
Protocol Buffer

syntax = "proto3";
package category;
import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.Category";
service CategoryContract
{
rpc CreateNewCategory(CreateNewCategoryRequest) returns (CreateNewCategoryResponse){
option (google.api.http) = {
post: "/CreateNewCategory"
body: "*"
};
};
rpc UpdateCategory(UpdateCategoryRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
put: "/UpdateCategory"
body: "*"
};
};
rpc DeleteCategory(DeleteCategoryRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
delete: "/DeleteCategory"
body: "*"
};
};
rpc GetCategory(GetCategoryRequest) returns (GetCategoryResponse){
option (google.api.http) = {
get: "/GetCategory"
};
};
rpc GetAllCategoryByFilter(GetAllCategoryByFilterRequest) returns (GetAllCategoryByFilterResponse){
option (google.api.http) = {
get: "/GetAllCategoryByFilter"
};
};
rpc GetAllCategoriesForCustomer(GetAllCategoriesForCustomerRequest) returns (GetAllCategoriesForCustomerResponse){
option (google.api.http) = {
get: "/Customer/Categories/GetAllCategories"
};
};
rpc GetCategoryByIdForCustomer(GetCategoryByIdForCustomerRequest) returns (GetCategoryByIdForCustomerResponse){
option (google.api.http) = {
get: "/Customer/Categories/GetCategory/{id}"
};
};
rpc GetAllCategories(GetAllCategoriesRequest) returns (GetAllCategoriesResponse){
option (google.api.http) = {
get: "/Customer/GetAllCategories"
};
};
}
message CreateNewCategoryRequest
{
string name = 1;
string title = 2;
google.protobuf.StringValue description = 3;
google.protobuf.StringValue image_path = 4;
google.protobuf.Int64Value parent_id = 5;
bool is_active = 6;
int32 sort_order = 7;
}
message CreateNewCategoryResponse
{
int64 id = 1;
}
message UpdateCategoryRequest
{
int64 id = 1;
string name = 2;
string title = 3;
google.protobuf.StringValue description = 4;
google.protobuf.StringValue image_path = 5;
google.protobuf.Int64Value parent_id = 6;
bool is_active = 7;
int32 sort_order = 8;
}
message DeleteCategoryRequest
{
int64 id = 1;
}
message GetCategoryRequest
{
int64 id = 1;
}
message GetCategoryResponse
{
int64 id = 1;
string name = 2;
string title = 3;
google.protobuf.StringValue description = 4;
google.protobuf.StringValue image_path = 5;
google.protobuf.Int64Value parent_id = 6;
bool is_active = 7;
int32 sort_order = 8;
}
message GetAllCategoryByFilterRequest
{
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
GetAllCategoryByFilterFilter filter = 3;
}
message GetAllCategoryByFilterFilter
{
google.protobuf.Int64Value id = 1;
google.protobuf.StringValue name = 2;
google.protobuf.StringValue title = 3;
google.protobuf.StringValue description = 4;
google.protobuf.StringValue image_path = 5;
google.protobuf.Int64Value parent_id = 6;
google.protobuf.BoolValue is_active = 7;
google.protobuf.Int32Value sort_order = 8;
}
message GetAllCategoryByFilterResponse
{
messages.MetaData meta_data = 1;
repeated GetAllCategoryByFilterResponseModel models = 2;
}
message GetAllCategoryByFilterResponseModel
{
int64 id = 1;
string name = 2;
string title = 3;
google.protobuf.StringValue description = 4;
google.protobuf.StringValue image_path = 5;
google.protobuf.Int64Value parent_id = 6;
bool is_active = 7;
int32 sort_order = 8;
// تعداد محصولات این دسته‌بندی
int32 product_count = 9;
}
message GetAllCategoriesRequest {
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
GetAllCategoryByFilterFilter filter = 3;
}
message GetAllCategoriesResponse {
messages.MetaData meta_data = 1;
repeated GetAllCategoryFilterResponseModel models = 2;
}
message GetAllCategoryFilterResponseModel {
int64 id = 1;
string name = 2;
string title = 3;
string description = 4;
google.protobuf.StringValue image_path = 5;
google.protobuf.Int64Value parent_id = 6;
bool is_active = 7;
int32 sort_order = 8;
}
// Customer Messages
message GetAllCategoriesForCustomerRequest {
google.protobuf.Int64Value parent_id = 1;
int32 page_number = 2;
int32 page_size = 3;
}
message GetAllCategoriesForCustomerResponse {
messages.MetaData meta_data = 1;
repeated GetAllCategoryFilterResponseModel models = 2;
}
message GetCategoryByIdForCustomerRequest {
int64 id = 1;
}
message GetCategoryByIdForCustomerResponse {
GetAllCategoryFilterResponseModel category = 1;
}