Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package clap.server.adapter.inbound.web.dto.admin.response;

import io.swagger.v3.oas.annotations.media.Schema;

import java.util.List;

public record FindAllCategoryResponse(
Long id,
@Schema(description = "메인 카테고리 ID", example = "1")
Long mainCategoryId,

@Schema(description = "카테고리 이름", example = "VM 관련")
String name,

@Schema(description = "카테고리 코드", example = "VM")
String code,

@Schema(description = "서브 카테고리 목록")
List<FindSubCategoryResponse> subCategory
) {
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
package clap.server.adapter.inbound.web.dto.admin.response;

import io.swagger.v3.oas.annotations.media.Schema;

public record FindMainCategoryResponse(
Long id,
@Schema(description = "메인 카테고리 ID", example = "1")
Long mainCategoryId,

@Schema(description = "카테고리 이름", example = "VM 관련")
String name,

@Schema(description = "카테고리 코드", example = "VM")
String code
) {
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
package clap.server.adapter.inbound.web.dto.admin.response;

import io.swagger.v3.oas.annotations.media.Schema;

public record FindSubCategoryResponse(
Long id,
@Schema(description = "서브 카테고리 ID", example = "4")
Long subCategoryId,

@Schema(description = "메인 카테고리 ID", example = "1")
Long mainCategoryId,

@Schema(description = "카테고리 이름", example = "VM 수정")
String name,

@Schema(description = "카테고리 코드", example = "VU")
String code,

@Schema(description = "카테고리 설명 예시", example = "VM을 수정합니다.")
String descriptionExample
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class CategoryResponseMapper {
private CategoryResponseMapper() {throw new IllegalStateException("Utility class");}

public static FindAllCategoryResponse toFindAllCategoryResponse(
Long id,
Long mainCategoryId,
String name,
String code,
List<FindSubCategoryResponse> subCategoryResponses) {
return new FindAllCategoryResponse(id, name, code, subCategoryResponses);
return new FindAllCategoryResponse(mainCategoryId, name, code, subCategoryResponses);
}

public static FindMainCategoryResponse toFindMainCategoryResponse(Category category) {
Expand Down