Add category IDs support to product DTOs and protobuf

This commit is contained in:
masoodafar-web
2025-11-27 05:43:01 +03:30
parent 8878c07031
commit 3e5f8348c2
9 changed files with 20 additions and 8 deletions

View File

@@ -7,7 +7,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.2" /> <PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.2" />
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.128" /> <PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.129" />
<PackageReference Include="Mapster" Version="7.3.0" /> <PackageReference Include="Mapster" Version="7.3.0" />
<PackageReference Include="Mapster.DependencyInjection" Version="1.0.0" /> <PackageReference Include="Mapster.DependencyInjection" Version="1.0.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.0.0" /> <PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />

View File

@@ -10,6 +10,8 @@ public record CreateNewProductsCommand : IRequest<CreateNewProductsResponseDto>
public int Rate { get; init; } public int Rate { get; init; }
public ImageFileModel ImageFile { get; init; } public ImageFileModel ImageFile { get; init; }
public ImageFileModel ThumbnailFile { get; init; } public ImageFileModel ThumbnailFile { get; init; }
// لیست شناسه دسته‌بندی‌های محصول
public ICollection<long>? CategoryIds { get; init; }
} }
public class ImageFileModel public class ImageFileModel
@@ -18,4 +20,3 @@ public class ImageFileModel
public string FileName { get; set; } public string FileName { get; set; }
public string Mime { get; set; } public string Mime { get; set; }
} }

View File

@@ -13,6 +13,8 @@ public record UpdateProductsCommand : IRequest<Unit>
public string ThumbnailPath { get; init; } public string ThumbnailPath { get; init; }
public ImageFileModel ImageFile { get; init; } public ImageFileModel ImageFile { get; init; }
public ImageFileModel ThumbnailFile { get; init; } public ImageFileModel ThumbnailFile { get; init; }
// لیست شناسه دسته‌بندی‌های محصول
public ICollection<long>? CategoryIds { get; init; }
} }
public class ImageFileModel public class ImageFileModel
@@ -21,4 +23,3 @@ public class ImageFileModel
public string FileName { get; set; } public string FileName { get; set; }
public string Mime { get; set; } public string Mime { get; set; }
} }

View File

@@ -20,5 +20,6 @@ public class GetAllProductsByFilterResponseModel
public int SaleCount { get; set; } public int SaleCount { get; set; }
public int ViewCount { get; set; } public int ViewCount { get; set; }
public int RemainingCount { get; set; } public int RemainingCount { get; set; }
// لیست شناسه دسته‌بندی‌های محصول
public List<long> CategoryIds { get; set; } = new();
} }

View File

@@ -14,5 +14,6 @@ public class GetProductsResponseDto
public int SaleCount { get; set; } public int SaleCount { get; set; }
public int ViewCount { get; set; } public int ViewCount { get; set; }
public int RemainingCount { get; set; } public int RemainingCount { get; set; }
// لیست شناسه دسته‌بندی‌های محصول
public List<long> CategoryIds { get; set; } = new();
} }

View File

@@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.119" /> <PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.129" />
<PackageReference Include="Afrino.FMSMicroservice.Protobuf" Version="0.0.122" /> <PackageReference Include="Afrino.FMSMicroservice.Protobuf" Version="0.0.122" />
<PackageReference Include="Google.Protobuf" Version="3.23.3" /> <PackageReference Include="Google.Protobuf" Version="3.23.3" />

View File

@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>0.0.1</Version> <Version>0.0.3</Version>
<DebugType>None</DebugType> <DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild> <GeneratePackageOnBuild>False</GeneratePackageOnBuild>

View File

@@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>0.0.4</Version> <Version>0.0.6</Version>
<DebugType>None</DebugType> <DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild> <GeneratePackageOnBuild>False</GeneratePackageOnBuild>

View File

@@ -106,6 +106,8 @@ message CreateNewProductsRequest
int32 rate = 7; int32 rate = 7;
ImageFileModel image_file = 8; ImageFileModel image_file = 8;
ImageFileModel thumbnail_file = 9; ImageFileModel thumbnail_file = 9;
// لیست شناسه دسته‌بندی‌های محصول
repeated int64 category_ids = 10;
} }
message CreateNewProductsResponse message CreateNewProductsResponse
@@ -127,6 +129,8 @@ message UpdateProductsRequest
string thumbnail_path = 10; string thumbnail_path = 10;
ImageFileModel image_file = 11; ImageFileModel image_file = 11;
ImageFileModel thumbnail_file = 12; ImageFileModel thumbnail_file = 12;
// لیست شناسه دسته‌بندی‌های محصول
repeated int64 category_ids = 13;
} }
message DeleteProductsRequest message DeleteProductsRequest
@@ -154,6 +158,8 @@ message GetProductsResponse
int32 sale_count = 11; int32 sale_count = 11;
int32 view_count = 12; int32 view_count = 12;
int32 remaining_count = 13; int32 remaining_count = 13;
// لیست شناسه دسته‌بندی‌های محصول
repeated int64 category_ids = 14;
} }
message GetAllProductsByFilterRequest message GetAllProductsByFilterRequest
@@ -196,6 +202,8 @@ message GetAllProductsByFilterResponseModel
int32 sale_count = 11; int32 sale_count = 11;
int32 view_count = 12; int32 view_count = 12;
int32 remaining_count = 13; int32 remaining_count = 13;
// لیست شناسه دسته‌بندی‌های محصول
repeated int64 category_ids = 14;
} }
message PaginationState message PaginationState