Skip to content

Commit 38907e5

Browse files
authored
Merge pull request #156 from IT-Cotato/feature/155
feat: 상품 목록 응답에 brandId 추가 및 랜덤 카테고리 기본 개수 변경
2 parents 68e54d4 + c0530a2 commit 38907e5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/main/java/com/ongil/backend/domain/category/controller/CategoryController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public DataResponse<List<SubCategoryResponse>> getSubCategories(
4646
@Operation(summary = "랜덤 카테고리 조회", description = "홈 화면용 랜덤 카테고리를 조회합니다. 상품 이미지 포함.")
4747
@GetMapping("/random")
4848
public DataResponse<List<CategoryRandomResponse>> getRandomCategories(
49-
@RequestParam(defaultValue = "8") @Min(1) @Max(100) int count
49+
@RequestParam(defaultValue = "4") @Min(1) @Max(100) int count
5050
) {
5151
List<CategoryRandomResponse> categories = categoryService.getRandomCategories(count);
5252
return DataResponse.from(categories);

src/main/java/com/ongil/backend/domain/product/converter/ProductConverter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public ProductSimpleResponse toSimpleResponse(Product product) {
6262
.discountRate(product.getDiscountRate())
6363
.finalPrice(calculateFinalPrice(product))
6464
.thumbnailImageUrl(getFirstImage(product.getImageUrls()))
65+
.brandId(product.getBrand().getId())
6566
.brandName(product.getBrand().getName())
6667
.productType(product.getProductType())
6768
.viewCount(product.getViewCount())

src/main/java/com/ongil/backend/domain/product/dto/response/ProductSimpleResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public class ProductSimpleResponse {
2929
@Schema(description = "대표 이미지 URL")
3030
private String thumbnailImageUrl;
3131

32+
@Schema(description = "브랜드 ID")
33+
private Long brandId;
34+
3235
@Schema(description = "브랜드명")
3336
private String brandName;
3437

0 commit comments

Comments
 (0)