-
Notifications
You must be signed in to change notification settings - Fork 0
[FEATURE] 외주 상세 정보 조회 기능 구현 #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
aa8a876
Merge branch 'feat/#54-commission-scheduler' into feat/#53-commission…
fervovita 98dd535
Feat(commission): CommissionId로 조회 가능한 메서드 추가
fervovita 76403de
Feat(commission): 카테고리별 상세 조회 로직 추가
fervovita 3b1ee45
Feat(commission): 외주 상세 조회 API 구현
fervovita 4afe75f
Docs(commission): 카테고리 상세 응답에 oneOf 스키마 추가
fervovita 96a935f
Merge remote-tracking branch 'origin/dev' into feat/#53-commission-de…
Jong0128 cef7e16
Refactor(Commission): 가격 정보를 CommissionPricePolicy로 통일
Jong0128 19bf6dc
Refactor(commission): 내부 가격 객체와 응답 DTO 분리
fervovita File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...in/java/ditda/backend/domain/commission/category/textbook/dto/TextbookCategoryDetail.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package ditda.backend.domain.commission.category.textbook.dto; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import ditda.backend.domain.commission.category.textbook.dto.response.TextbookDetailResponse; | ||
| import ditda.backend.domain.commission.category.textbook.entity.Textbook; | ||
| import ditda.backend.domain.commission.category.textbook.entity.TextbookPage; | ||
| import ditda.backend.domain.commission.core.dto.response.CategoryDetailResponse; | ||
| import ditda.backend.domain.commission.core.handler.CategoryDetail; | ||
|
|
||
| public record TextbookCategoryDetail( | ||
| Textbook textbook, | ||
| List<TextbookPage> pages | ||
| ) implements CategoryDetail { | ||
|
|
||
| @Override | ||
| public CategoryDetailResponse toResponse() { | ||
|
|
||
| return new TextbookDetailResponse( | ||
| textbook.getTitle(), | ||
| textbook.getInstructorName(), | ||
| textbook.getSubject(), | ||
| pages.stream() | ||
| .map(p -> new TextbookDetailResponse.RequiredPage( | ||
| p.getPageType(), p.getPageDescription())) | ||
| .toList() | ||
| ); | ||
| } | ||
| } |
35 changes: 35 additions & 0 deletions
35
...itda/backend/domain/commission/category/textbook/dto/response/TextbookDetailResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package ditda.backend.domain.commission.category.textbook.dto.response; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import ditda.backend.domain.commission.core.dto.response.CategoryDetailResponse; | ||
| import ditda.backend.domain.commission.core.entity.enums.PageType; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
|
|
||
| @Schema(description = "교재 외지/내지 카테고리 상세") | ||
| public record TextbookDetailResponse( | ||
|
|
||
| @Schema(description = "교재명", example = "수학의 정석") | ||
| String textbookName, | ||
|
|
||
| @Schema(description = "강사명", example = "홍길동") | ||
| String instructorName, | ||
|
|
||
| @Schema(description = "과목", example = "수학") | ||
| String subject, | ||
|
|
||
| @Schema(description = "필요 페이지 정보") | ||
| List<RequiredPage> requiredPages | ||
|
|
||
| ) implements CategoryDetailResponse { | ||
|
|
||
| public record RequiredPage( | ||
|
|
||
| @Schema(description = "페이지 종류", example = "INSTRUCTOR_PROFILE") | ||
| PageType pageType, | ||
|
|
||
| @Schema(description = "페이지 설명", example = "프로필은 깔끔하게") | ||
| String description | ||
| ) { | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
.../ditda/backend/domain/commission/category/textbook/repository/TextbookPageRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,12 @@ | ||
| package ditda.backend.domain.commission.category.textbook.repository; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| import ditda.backend.domain.commission.category.textbook.entity.TextbookPage; | ||
|
|
||
| public interface TextbookPageRepository extends JpaRepository<TextbookPage, Long> { | ||
|
|
||
| List<TextbookPage> findByCommissionId(Long commissionId); | ||
| } |
35 changes: 35 additions & 0 deletions
35
src/main/java/ditda/backend/domain/commission/core/controller/CommissionController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package ditda.backend.domain.commission.core.controller; | ||
|
|
||
| import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| import ditda.backend.domain.commission.core.dto.response.CommissionDetailResponse; | ||
| import ditda.backend.domain.commission.core.facade.CommissionFacade; | ||
| import ditda.backend.global.apipayload.response.ApiResponse; | ||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/v1/commissions") | ||
| @RequiredArgsConstructor | ||
| @Tag(name = "Commission", description = "외주 상세 조회 API") | ||
| public class CommissionController { | ||
|
|
||
| private final CommissionFacade commissionFacade; | ||
|
|
||
| @Operation(summary = "외주 상세 조회", description = "**[외주 조회]** 외주 상세 정보를 조회합니다.") | ||
| @GetMapping("/{commissionId}") | ||
| public ApiResponse<CommissionDetailResponse> getCommissionDetail( | ||
| @AuthenticationPrincipal Long userId, | ||
| @PathVariable Long commissionId | ||
| ) { | ||
|
|
||
| CommissionDetailResponse response = commissionFacade.getCommissionDetail(userId, commissionId); | ||
|
|
||
| return ApiResponse.onSuccess("외주 상세 조회 성공", response); | ||
| } | ||
| } |
19 changes: 19 additions & 0 deletions
19
src/main/java/ditda/backend/domain/commission/core/dto/CommissionDetail.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package ditda.backend.domain.commission.core.dto; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import ditda.backend.domain.commission.core.entity.Commission; | ||
| import ditda.backend.domain.commission.core.entity.CommissionColor; | ||
| import ditda.backend.domain.commission.core.entity.CommissionConcept; | ||
| import ditda.backend.domain.commission.core.entity.CommissionFile; | ||
| import ditda.backend.domain.commission.core.handler.CategoryDetail; | ||
|
|
||
| public record CommissionDetail( | ||
| Commission commission, | ||
| List<CommissionConcept> concepts, | ||
| List<CommissionColor> colors, | ||
| List<CommissionFile> files, | ||
| CategoryDetail categoryDetail | ||
| ) { | ||
|
|
||
| } |
3 changes: 2 additions & 1 deletion
3
...domain/commission/core/dto/PriceInfo.java → ...main/commission/core/dto/PriceDetail.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/ditda/backend/domain/commission/core/dto/response/CategoryDetailResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package ditda.backend.domain.commission.core.dto.response; | ||
|
|
||
| import ditda.backend.domain.commission.category.textbook.dto.response.TextbookDetailResponse; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
|
|
||
| @Schema( | ||
| description = "카테고리별 상세 정보", | ||
| oneOf = {TextbookDetailResponse.class} // 카테고리 추가시 여기에 추가 | ||
| ) | ||
| public interface CategoryDetailResponse { | ||
| } |
114 changes: 114 additions & 0 deletions
114
...main/java/ditda/backend/domain/commission/core/dto/response/CommissionDetailResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| package ditda.backend.domain.commission.core.dto.response; | ||
|
|
||
| import java.time.LocalDate; | ||
| import java.util.List; | ||
|
|
||
| import ditda.backend.domain.commission.core.entity.enums.CategoryType; | ||
| import ditda.backend.domain.commission.core.entity.enums.ColorRole; | ||
| import ditda.backend.domain.commission.core.entity.enums.ColorSelectionMode; | ||
| import ditda.backend.domain.commission.core.entity.enums.CommissionStatus; | ||
| import ditda.backend.domain.commission.core.entity.enums.ConceptTag; | ||
| import ditda.backend.domain.commission.core.entity.enums.FileKind; | ||
| import ditda.backend.domain.commission.core.entity.enums.PageSize; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
|
|
||
| @Schema(description = "외주 상세 정보 응답") | ||
| public record CommissionDetailResponse( | ||
|
|
||
| @Schema(description = "외주 ID", example = "1") | ||
| Long commissionId, | ||
|
|
||
| @Schema(description = "제목", example = "수학의 정석 - 수학") | ||
| String title, | ||
|
|
||
| @Schema(description = "카테고리", example = "FLYER_TEXTBOOK_COVER_INNER") | ||
| CategoryType category, | ||
|
|
||
| @Schema(description = "상태", example = "PENDING") | ||
| CommissionStatus status, | ||
|
|
||
| @Schema(description = "디자인 정보") | ||
| DesignInfo designInfo, | ||
|
|
||
| @Schema(description = "카테고리별 상세 정보") | ||
| CategoryDetailResponse categoryDetail, | ||
|
|
||
| @Schema(description = "첨부 파일 목록") | ||
| List<FileInfo> files, | ||
|
|
||
| @Schema(description = "마감일 정보") | ||
| DateInfo dateInfo, | ||
|
|
||
| @Schema(description = "가격 정보") | ||
| PriceInfo priceInfo | ||
| ) { | ||
| @Schema(description = "디자인 정보") | ||
| public record DesignInfo( | ||
|
|
||
| @Schema(description = "사이즈", example = "A4") | ||
| PageSize pageSize, | ||
|
|
||
| @Schema(description = "컨셉 정보") | ||
| List<ConceptTag> concepts, | ||
|
|
||
| @Schema(description = "추가 컨셉 설명", example = "초등 저학년 대상이라 너무 무겁지 않게") | ||
| String additionalConcept, | ||
|
|
||
| @Schema(description = "색상 선택 모드", example = "USER_SELECTED") | ||
| ColorSelectionMode colorSelectionMode, | ||
|
|
||
| @Schema(description = "색상 정보") | ||
| List<ColorInfo> colors | ||
| ) { | ||
|
|
||
| @Schema(description = "색상 정보") | ||
| public record ColorInfo( | ||
|
|
||
| @Schema(description = "색상 역할", example = "MAIN") | ||
| ColorRole role, | ||
|
|
||
| @Schema(description = "색상 코드(#RRGGBB)", example = "#194D33") | ||
| String colorCode | ||
| ) { | ||
| } | ||
| } | ||
|
|
||
| @Schema(description = "첨부 파일 정보") | ||
| public record FileInfo( | ||
|
|
||
| @Schema(description = "파일 종류", example = "MATERIAL") | ||
| FileKind fileKind, | ||
|
|
||
| @Schema(description = "첨부 파일 URL", example = "https://example.com/commission/file.pdf") | ||
| List<String> fileUrls, | ||
|
|
||
| @Schema(description = "파일 설명", example = "img.04는 강사 프로필 이미지") | ||
| String description | ||
| ) { | ||
| } | ||
|
|
||
| @Schema(description = "마감일 정보") | ||
| public record DateInfo( | ||
|
|
||
| @Schema(description = "지원 마감일", example = "2026-06-08") | ||
| LocalDate applicationDeadline, | ||
|
|
||
| @Schema(description = "1차 시안 마감일", example = "2026-06-15") | ||
| LocalDate firstDraftDeadline, | ||
|
|
||
| @Schema(description = "최종 마감일", example = "2026-06-23") | ||
| LocalDate finalDeadline | ||
| ) { | ||
| } | ||
|
|
||
| @Schema(description = "가격 정보") | ||
| public record PriceInfo( | ||
|
|
||
| @Schema(description = "기본금", example = "60000") | ||
| int baseAmount, | ||
|
|
||
| @Schema(description = "최대 수령액", example = "210000") | ||
| int maxAmount | ||
| ) { | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
src/main/java/ditda/backend/domain/commission/core/entity/enums/CommissionAmountPolicy.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.