-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: FRONTEND.md 기반 전체 API 계약 준수 리팩터링 #32
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
Changes from all commits
5b17f6d
19be0ef
d8e5a94
3ce48c4
ff17bfe
8f4b3a1
ef93dba
b1fd2a2
eedfb99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| import java.time.LocalDateTime; | ||
|
|
||
| import backend.feed.entity.FeedApplication; | ||
| import backend.feed.entity.FeedApplicationRole; | ||
| import backend.feed.entity.FeedApplicationStatus; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import lombok.AccessLevel; | ||
|
|
@@ -23,6 +24,8 @@ public class FeedApplicationResponse { | |
| private String userId; | ||
| private String proposal; | ||
| private FeedApplicationStatus status; | ||
| private FeedApplicationRole appliedRole; | ||
| private Integer deposit; | ||
| private LocalDateTime createdAt; | ||
|
|
||
| public static FeedApplicationResponse from(FeedApplication application) { | ||
|
|
@@ -32,6 +35,8 @@ public static FeedApplicationResponse from(FeedApplication application) { | |
| .userId(application.getUserId()) | ||
| .proposal(application.getProposal()) | ||
| .status(application.getStatus()) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Issue] FeedApplicationResponse.from() — appliedRole, deposit 항상 null FEENTEND.md 명세: type FeedApplication = {
appliedRole: FeedApplicationRole; // required
deposit: number; // required
...
};
후속 작업으로 분리해도 되지만, 현재 상태에서는 명세상 required 필드가 null로 내려가므로 프론트 파싱이 깨질 수 있습니다. 엔티티 컬럼 추가 + 마이그레이션 스크립트를 별도 이슈/PR로 트래킹 해주세요. |
||
| .appliedRole(application.getAppliedRole()) | ||
| .deposit(application.getDeposit()) | ||
| .createdAt(application.getCreatedAt()) | ||
| .build(); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| package backend.feed.dto; | ||
|
|
||
| import backend.feed.entity.FeedApplicationRole; | ||
| import backend.feed.entity.FeedApplicationStatus; | ||
| import backend.feed.entity.FeedItem; | ||
| import backend.global.enums.FeedCategory; | ||
|
|
@@ -70,6 +71,15 @@ public class FeedItemResponse { | |
| @Schema(description = "내 신청 상태") | ||
| private FeedApplicationStatus myApplicationStatus; | ||
|
|
||
| @Schema(description = "내 신청 역할 (SUPPORTER | PARTNER)") | ||
| private FeedApplicationRole myApplicationRole; | ||
|
|
||
| @Schema(description = "내 신청 보증금") | ||
| private Integer myApplicationDeposit; | ||
|
|
||
| @Schema(description = "대여 가능 여부", example = "false") | ||
| private Boolean isRentable; | ||
|
|
||
|
Comment on lines
+74
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Populate newly added response fields in
Proposed fix public static FeedItemResponse from(FeedItem feedItem, Long applicantCount, Boolean isBookmarked,
- FeedApplicationStatus myApplicationStatus, FeedAuthorProfile authorProfile) {
+ FeedApplicationStatus myApplicationStatus, FeedApplicationRole myApplicationRole,
+ Integer myApplicationDeposit, Boolean isRentable, FeedAuthorProfile authorProfile) {
return FeedItemResponse.builder()
...
.myApplicationStatus(myApplicationStatus)
+ .myApplicationRole(myApplicationRole)
+ .myApplicationDeposit(myApplicationDeposit)
+ .isRentable(isRentable)
.authorProfile(authorProfile)
...
.build();
}Also applies to: 102-127 🤖 Prompt for AI Agents |
||
| @Schema(description = "작성자 프로필") | ||
| private FeedAuthorProfile authorProfile; | ||
|
|
||
|
|
@@ -109,6 +119,10 @@ public static FeedItemResponse from(FeedItem feedItem, Long applicantCount, Bool | |
| .applicantCount(feedItem.getType() == PostType.REQUEST ? applicantCount : null) | ||
| .isBookmarked(isBookmarked) | ||
| .myApplicationStatus(myApplicationStatus) | ||
| // myApplicationRole/Deposit, isRentable: 현재 인증/대여 모델 미구현으로 null. 별도 PR에서 채움. | ||
| .myApplicationRole(null) | ||
| .myApplicationDeposit(null) | ||
| .isRentable(null) | ||
| .authorProfile(authorProfile) | ||
| .spotId(feedItem.getSpotId()) | ||
| .isAi(feedItem.isAi()) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,19 +21,28 @@ public class SpotChecklistResponse { | |
| private Long id; | ||
|
|
||
| @Schema(description = "항목 내용", example = "돗자리 준비") | ||
| private String content; | ||
| private String text; | ||
|
|
||
| @Schema(description = "완료 여부", example = "false") | ||
| private Boolean isDone; | ||
| private Boolean completed; | ||
|
|
||
| @Schema(description = "담당자 ID (선택)", nullable = true) | ||
| private String assigneeId; | ||
|
|
||
| @Schema(description = "담당자 닉네임 (선택)", nullable = true) | ||
| private String assigneeNickname; | ||
|
Comment on lines
+29
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Map newly added assignee fields in the factory path. Line 29-Line 33 add Proposed fix public static SpotChecklistResponse from(SpotChecklist checklist) {
+ return from(checklist, null, null);
+}
+
+public static SpotChecklistResponse from(SpotChecklist checklist, String assigneeId, String assigneeNickname) {
return SpotChecklistResponse.builder()
.id(checklist.getId())
.text(checklist.getContent())
.completed(checklist.getIsDone())
+ .assigneeId(assigneeId)
+ .assigneeNickname(assigneeNickname)
.createdAt(checklist.getCreatedAt())
.build();
}Also applies to: 38-44 🤖 Prompt for AI Agents |
||
|
|
||
| @Schema(description = "등록 일시") | ||
| private LocalDateTime createdAt; | ||
|
|
||
| public static SpotChecklistResponse from(SpotChecklist checklist) { | ||
| // assigneeId, assigneeNickname: 엔티티 컬럼 추가 후 매핑 예정 (별도 PR) | ||
| return SpotChecklistResponse.builder() | ||
| .id(checklist.getId()) | ||
| .content(checklist.getContent()) | ||
| .isDone(checklist.getIsDone()) | ||
| .text(checklist.getContent()) | ||
| .completed(checklist.getIsDone()) | ||
| .assigneeId(null) | ||
| .assigneeNickname(null) | ||
| .createdAt(checklist.getCreatedAt()) | ||
| .build(); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Issue] cancelApplication 응답 envelope 불일치
FRONTEND.md 명세:
현재
ApiResponse.success()는 body 없이 반환되어 프론트가data.feedId를 읽을 수 없습니다.수정 예시: