-
Notifications
You must be signed in to change notification settings - Fork 3
feat: 여행 목록/상세 조회 비로그인 접근 허용 및 인증 로직 개선/하드코딩 수정으로 여행자 구분/여행 생성 시 공개 여부 및 비밀번호 설정 로직 제거 #107
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
base: develop
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| package com.retrip.trip.application.in.request.context; | ||
|
|
||
| import io.swagger.v3.oas.annotations.Parameter; | ||
|
|
||
| import java.lang.annotation.ElementType; | ||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.RetentionPolicy; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Target(ElementType.PARAMETER) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Parameter(hidden = true) | ||
| public @interface WithUserContext { | ||
| } | ||
| boolean required() default true; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,8 +98,8 @@ public record TripDetailResponse( | |
| public static TripDetailResponse of(UUID memberId, Trip trip) { | ||
| return TripDetailResponse.builder() | ||
| .id(trip.getId()) | ||
| .isLeader(trip.getTripParticipants().isLeader(memberId)) | ||
| .isParticipant(trip.getTripParticipants().isParticipant(memberId)) | ||
| .isLeader(memberId != null && trip.getTripParticipants().isLeader(memberId)) | ||
| .isParticipant(memberId != null && trip.getTripParticipants().isParticipant(memberId)) | ||
| .title(trip.getTitle().getValue()) | ||
| .createdAt(trip.getCreatedAt()) | ||
| .participantCount(trip.getTripParticipants().getCurrentCount()) | ||
|
|
@@ -158,14 +158,13 @@ public static List<TripParticipantResponse> toList(List<TripParticipant> tripPar | |
| .toList(); | ||
| } | ||
|
|
||
| //TODO: 해당 참가자 정보 auth API 에서 따로 가져오도록 수정해야함 | ||
| private static TripParticipantResponse of(TripParticipant participant) { | ||
| return TripParticipantResponse.builder() | ||
| .participantId(participant.getId()) | ||
| .memberId(participant.getMemberId()) | ||
| .introduction("안녕하세여") | ||
| .nickName("박정수") | ||
| .imageUrl("http://~~~") | ||
| .introduction(null) | ||
|
Contributor
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. 해당 값은 왜 Null로 세팅한 것일까요??
Contributor
Author
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. 현재 Trip 서비스에서 참여자의 상세 프로필 정보(자기소개, 프로필 사진)를 조회하려면 Auth 서비스에서 member 정보와 연동이 필요한데 아직 해당 기능이 구현 전 단계입니다. 기존에는 하드코딩된 값이 내려가고 있어 모든 참가자가 똑같아 보이는 문제가 있었습니다. 우선 프론트엔드에서 null일 경우 기본 이미지,텍스트를 보여주는것으로 말씀드릴 예정이라 null로 변경했습니다. 추후 User 서비스 연동 시 실제 데이터로 교체될 예정입니다!
Contributor
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. @ekfrehd 님 넵! 이해했습니다. |
||
| .nickName("여행자-" + participant.getMemberId().toString().substring(0, 8)) | ||
| .imageUrl(null) | ||
| .role(participant.getRole()) | ||
| .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.
해당 값 임시로 하드 코딩 한것일까요??
나중에는 아예 제거하는 것인지 문의 드려요
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.
네, 맞습니다! 기획 사항이 변경되어 여행 생성 시에는 항상 공개 상태로 시작하고 이후에 비공개로 전환된다고 전달받았습니다. 그래서 Request DTO에서 open 필드를 제거했고 엔티티 생성 시에는 true(공개)를 고정값으로 넘겨주도록 수정했습니다! 비밀번호(password) 필드도 같은 이유로 제거했습니다!