Skip to content
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

Merged
merged 24 commits into from
Aug 4, 2024

Conversation

kimyu0218
Copy link
Collaborator

Issue Number

close: #27
close: #26

작업 개요

  • 구글 로그인 로직 수정
  • 미션 인증 시, 요일 유효성 검사 추가

작업 사항

고민한 점들(필수 X)

스크린샷(필수 X)

@kimyu0218 kimyu0218 self-assigned this Aug 3, 2024
@kimyu0218 kimyu0218 requested a review from songyi00 as a code owner August 3, 2024 11:32
Copy link
Member

@songyi00 songyi00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생했습니닷 🙆🏻‍♀️

Copy link
Collaborator Author

@kimyu0218 kimyu0218 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

언니 바뀐 부분 중점적으로 코멘트 달아봤어...!

테스트를 너무 잘 작성해놔서 참고해서 작성하긴 했는데, 혹시라도 이상한 부분 있으면 말해줘!!

Comment on lines +87 to +108
// 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)
// );
// }
Copy link
Collaborator Author

@kimyu0218 kimyu0218 Aug 4, 2024

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 추후 닉네임, 장기말 타입 검증도 추가
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기는 정렬하는 과정이 없어서 응답 생성하는 데 에러는 안났어!!
나중에 닉네임이랑 장기말 타입도 검증해보려구

@kimyu0218 kimyu0218 requested a review from songyi00 August 4, 2024 06:05
@@ -22,18 +23,18 @@

@RequiredArgsConstructor
@Component
public class ObjectStorageManager {
public class S3Client implements ObjectStorageClient {
Copy link
Member

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 필수값 여부 스키마 주석 추가해주면 좋을 것 같아
코드보니까 date 가 nullable인 것 같아서!

Copy link
Collaborator Author

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();
    ...
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

응응 기본값 오늘 기준으로 인증해줘도 괜찮을 것 같아!
쿼리 dto에 스웨거 스키마 필수값 여부만 추가해줘 ㅎㅎ

Copy link
Member

@songyi00 songyi00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니당 👍

@kimyu0218 kimyu0218 merged commit 92aaf4f into develop Aug 4, 2024
1 check passed
@kimyu0218 kimyu0218 deleted the fix/#27-mission-verification branch August 4, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

미션 인증 시 유효성 검사 추가 구글 토큰 로직 수정
2 participants