Add category products query and update endpoints

This commit is contained in:
masoodafar-web
2025-11-27 04:58:09 +03:30
parent bb8d35a1d1
commit 8878c07031
9 changed files with 242 additions and 2 deletions

View File

@@ -73,6 +73,19 @@ service ProductsContract
body: "*"
};
};
rpc GetProductsForCategory(GetProductsForCategoryRequest) returns (GetProductsForCategoryResponse){
option (google.api.http) = {
get: "/GetProductsForCategory"
};
};
rpc UpdateCategoryProducts(UpdateCategoryProductsRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: "/UpdateCategoryProducts"
body: "*"
};
};
}
message ImageFileModel
@@ -269,3 +282,26 @@ message UpdateProductCategoriesRequest
int64 product_id = 1;
repeated int64 category_ids = 2;
}
message CategoryProductItem
{
int64 id = 1;
string title = 2;
bool selected = 3;
}
message GetProductsForCategoryRequest
{
int64 category_id = 1;
}
message GetProductsForCategoryResponse
{
repeated CategoryProductItem items = 1;
}
message UpdateCategoryProductsRequest
{
int64 category_id = 1;
repeated int64 product_ids = 2;
}