Skip to content

Commit

Permalink
feat : image 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Changha-dev committed Nov 25, 2023
1 parent 9392fb6 commit 27a68a5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/java/com/donggram/back/service/AdminService.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,18 @@ public ResponseDto updateClubDetails(Long clubRequestId, ClubProfileUpdateDto cl

club.updateClubProfile(clubProfileUpdateDto, collegeRepository, divisionRepository);

if (multipartFile != null){
System.out.println("1111111111111111");

ImageClub imageClub = imageClubRepository.findByClubId(club.getId()).orElseThrow(() -> new RuntimeException("해당 동아리이미지 엔티티가 존재하지 않습니다."));


if (!multipartFile.isEmpty() && multipartFile != null){
System.out.println("akdljf,x.cnvklzcjiajgi;e");
String updateImageUrl = uploadImage(multipartFile, clubRequest);
ImageClub imageClub = imageClubRepository.findByClubId(club.getId()).orElseThrow(() -> new RuntimeException("해당 동아리이미지 엔티티가 존재하지 않습니다."));
imageClub.uploadCustomImage(updateImageUrl);
} else {
System.out.println("imageProfile Null");
imageClub.uploadCustomImage(club.getImageClub().getUrl());
}

ClubDetailsDto clubDetailsDto = ClubDetailsDto.builder()
Expand Down

0 comments on commit 27a68a5

Please sign in to comment.