Skip to content

Commit

Permalink
fix: 카카오 로그인 디폴트 수정, 사진 업로드 PATCH 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
daeunkwak committed Sep 9, 2023
1 parent 1a531cb commit db5e26c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ public ResponseEntity<CommonResponse> createCertifyImages(@Parameter(hidden = tr
return ResponseEntity.ok(CommonResponse.from("인증 예시 이미지가 업로드 되었습니다."));
}

@Tag(name = "certify", description = "챌린지 인증 API")
@Operation(summary = "챌린지 인증 이미지 업로드 api", description = "- form-data 형태로 보내주시고, content-type는 따로 지정 안해주셔도 됩니다.\n" +
"- certifyId는 직전에 호출한 챌린지 인증 api response값 보내주시면 됩니다.")
@PatchMapping(value="/images/{certifyId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<CommonResponse> updateCertifyImages(@Parameter(hidden = true) @RequestMemberId Long memberId,
@RequestPart(value = "certifyImages") List<MultipartFile> certifyImages,
@PathVariable("certifyId") Long certifyId) throws IOException {

for(MultipartFile multipartFile : certifyImages){
log.info("contentType ::::::::: " + multipartFile.getContentType());
}

imageService.uploadCertifyImages(certifyImages, certifyId);
return ResponseEntity.ok(CommonResponse.from("인증 예시 이미지가 업로드 되었습니다."));
}

@Tag(name = "home", description = "홈(둘러보기) API")
@Operation(summary = "홈 - 추천 피드 조회 api")
@GetMapping("/home")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,13 @@ public ResponseJwtTokenDto createMemberAndJwt(KakaoAccount memberInfo, SocialTyp
final Optional<Member> foundMember = memberRepository.findByEmail(memberInfo.getEmail());

ResponseJwtTokenDto responseJwtTokenDto = null;

if (foundMember.isEmpty()) { // 기존 회원 아닐 때

log.info("기존 회원 아닐 때 ");
Member newMember = Member.create(memberInfo.getProfile().getNickname(),
memberInfo.getEmail(), memberInfo.getBirthday(), memberInfo.getGender(), socialType);

Member newMember = Member.create("",
memberInfo.getEmail(), "memberInfo.getBirthday()", "memberInfo.getGender()", socialType);
newMember.updateProfileImage();
requestMember = memberRepository.save(newMember);

Expand Down

0 comments on commit db5e26c

Please sign in to comment.