-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: 미션 인증 유효성 검사 추가 #30
Conversation
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.
고생했습니닷 🙆🏻♀️
src/main/java/com/nexters/goalpanzi/application/mission/MissionVerificationService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/nexters/goalpanzi/application/mission/MissionVerificationService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/nexters/goalpanzi/application/mission/MissionVerificationService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/nexters/goalpanzi/application/mission/MissionVerificationService.java
Outdated
Show resolved
Hide resolved
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.
언니 바뀐 부분 중점적으로 코멘트 달아봤어...!
테스트를 너무 잘 작성해놔서 참고해서 작성하긴 했는데, 혹시라도 이상한 부분 있으면 말해줘!!
src/main/java/com/nexters/goalpanzi/domain/mission/DayOfWeek.java
Outdated
Show resolved
Hide resolved
// TODO 프로필 생성 후 확인 필요 | ||
// @Test | ||
// void 특정_일자의_미션_인증_현황을_조회한다() { | ||
// when(objectStorageClient.uploadFile(any(MultipartFile.class))).thenReturn(UPLOADED_IMAGE_URL); | ||
// | ||
// LoginResponse login1 = 구글_로그인(new GoogleLoginCommand(EMAIL)).as(LoginResponse.class); | ||
// | ||
// CreateMissionRequest missionRequest = new CreateMissionRequest(DESCRIPTION, LocalDateTime.now(), LocalDateTime.now().plusDays(1), TimeOfDay.EVERYDAY, WEEK, 1); | ||
// MissionDetailResponse mission = 미션_생성(missionRequest, login1.accessToken()).as(MissionDetailResponse.class); | ||
// 미션_참여(mission.invitationCode(), login1.accessToken()); | ||
// 미션_인증(IMAGE_FILE, mission.missionId(), login1.accessToken()); | ||
// | ||
// LoginResponse login2 = 구글_로그인(new GoogleLoginCommand(EMAIL2)).as(LoginResponse.class); | ||
// 미션_참여(mission.invitationCode(), login2.accessToken()); | ||
// 미션_인증(IMAGE_FILE, mission.missionId(), login2.accessToken()); | ||
// | ||
// List<MissionVerificationResponse> verifications = 일자별_미션_인증_조회(mission.missionId(), LocalDate.now(), login1.accessToken()).as(List.class); | ||
// | ||
// assertAll( | ||
// () -> assertThat(verifications.size()).isEqualTo(2) | ||
// ); | ||
// } |
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.
프로필_생성
부분이 없어서 에러 나서 주석 처리했어!! (닉네임, 장기말 타입 생성)
MissionVerificationResponse
를 생성하는 과정에서 요청을 보낸 사람을 0번째 인덱스에 오도록 만드는데
그 때 사용하는 게 유니크한 닉네임이라서 그런 것 같아
나중에 프로필_생성
생기면 다시 주석 풀고 해볼게!!
MissionVerificationResponse verification = 내_미션_인증_조회(1, mission.missionId(), login.accessToken()).as(MissionVerificationResponse.class); | ||
|
||
assertAll( | ||
// TODO 추후 닉네임, 장기말 타입 검증도 추가 |
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.
여기는 정렬하는 과정이 없어서 응답 생성하는 데 에러는 안났어!!
나중에 닉네임이랑 장기말 타입도 검증해보려구
@@ -22,18 +23,18 @@ | |||
|
|||
@RequiredArgsConstructor | |||
@Component | |||
public class ObjectStorageManager { | |||
public class S3Client implements ObjectStorageClient { |
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.
이름 바뀐거 좋다 👍
@@ -2,7 +2,7 @@ | |||
|
|||
import java.time.LocalDate; | |||
|
|||
public record MissionVerificationCommand( | |||
public record MissionVerificationQuery( | |||
Long memberId, |
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.
여기 필수값 여부 스키마 주석 추가해주면 좋을 것 같아
코드보니까 date 가 nullable인 것 같아서!
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.
아! 이 부분 null
허용해줬어
date
안 보내면 그냥 오늘 기준으로 인증 정보 조회하도록 만들었는데 그냥 무조건 보내도록 만들까?? (딱히 이유가 있는 건 아니야!! 기본값 느낌으로..)
@Transactional(readOnly = true)
public List<MissionVerificationResponse> getVerifications(final MissionVerificationQuery query) {
LocalDate date = query.date() != null ? query.date() : LocalDate.now();
...
}
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.
응응 기본값 오늘 기준으로 인증해줘도 괜찮을 것 같아!
쿼리 dto에 스웨거 스키마 필수값 여부만 추가해줘 ㅎㅎ
src/main/java/com/nexters/goalpanzi/application/mission/MissionVerificationService.java
Outdated
Show resolved
Hide resolved
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 Number
close: #27
close: #26
작업 개요
작업 사항
고민한 점들(필수 X)
스크린샷(필수 X)