Skip to content

Commit

Permalink
Merge pull request #9 from Team-Wable/feat/#8
Browse files Browse the repository at this point in the history
Feat/#8
  • Loading branch information
Hong0329 authored Aug 15, 2024
2 parents 3bf5b0b + 5782f11 commit 7d97a53
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
@RequiredArgsConstructor
public class AuthServiceImpl implements AuthService {

@Value("${aws-property.s3-default-image-url}")
private String GHOST_IMAGE_S3;
// @Value("${aws-property.s3-default-image-url}")
// private String GHOST_IMAGE_S3;
private final static String DEFAULT_NICKNAME="";

private final JwtTokenProvider jwtTokenProvider;
Expand All @@ -57,7 +57,7 @@ public AuthResponseDto socialLogin(String socialAccessToken, AuthRequestDto auth
.nickname(DEFAULT_NICKNAME)//.nickname(socialData.getNickname())
.socialPlatform(socialPlatform)
.socialId(socialData.getId())
.profileUrl(GHOST_IMAGE_S3)
.profileUrl("")
.memberEmail(socialData.getEmail())
.socialNickname(socialData.getNickname())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public record ProfilePatchRequestDto (
Boolean isPushAlarmAllowed,
String fcmToken,
String memberFanTeam,
Integer memberLckYears
Integer memberLckYears,
String memberDefaultProfileImage
){
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ public class MemberCommandService {
private final CommentLikedRepository commentLikedRepository;
private final ContentLikedRepository contentLikedRepository;
private final S3Service s3Service;
private final static String GHOST_IMAGE = "https://github.com/TeamDon-tBe/SERVER/assets/97835512/fb3ea04c-661e-4221-a837-854d66cdb77e";

@Value("${aws-property.s3-default-image-url}")
private String GHOST_IMAGE_S3;
@Value("${aws-property.s3-system-image-url}")
private String SYSTEM_IMAGE_S3;

@Value("${aws-property.s3-domain}")
private String S3_URL;
Expand All @@ -53,7 +52,7 @@ public void withdrawalMember(Long memberId, MemberWithdrawalPatchRequestDto memb
List<Ghost> ghosts = ghostRepository.findByGhostTargetMember(member);

member.updateNickname("탈퇴한 회원");
member.updateProfileUrl(GHOST_IMAGE_S3);
member.updateProfileUrl(SYSTEM_IMAGE_S3);
member.updateDeletedReason(memberWithdrawalPatchRequestDto.deleted_reason());

// notificationRepository.deleteBynotificationTargetMember(member);
Expand Down Expand Up @@ -163,10 +162,9 @@ public void updateMemberProfile2(Long memberId, MultipartFile multipartFile, Pro
try {
String s3ImageUrl = s3Service.uploadImage(memberId.toString(), multipartFile);

if(!existedImage.equals(GHOST_IMAGE)&&!existedImage.equals(GHOST_IMAGE_S3)) {
String existedKey = removeBaseUrl(existedImage, S3_URL);
s3Service.deleteImage(existedKey);
}
String existedKey = removeBaseUrl(existedImage, S3_URL);

s3Service.deleteImage(existedKey);

existingMember.updateProfileUrl(s3ImageUrl);
} catch (IOException e) {
Expand All @@ -188,6 +186,9 @@ public void updateMemberProfile2(Long memberId, MultipartFile multipartFile, Pro
if (profilePatchRequestDto.memberLckYears() != null) {
existingMember.updateMemberLckYears(profilePatchRequestDto.memberLckYears());
}
if (profilePatchRequestDto.memberDefaultProfileImage() != null) {
existingMember.updateProfileUrl(profilePatchRequestDto.memberDefaultProfileImage());
}
memberRepository.save(existingMember);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public class NotificationQueryService {

@Value("${aws-property.s3-system-image-url}")
private String SYSTEM_IMAGE_S3;

@Value("${aws-property.s3-popular-image-url}")
private String POPULAR_IMAGE_S3;
private final int NOTIFICATION_DEFAULT_PAGE_SIZE = 15;

public NotificaitonCountResponseDto countUnreadNotification(Long memberId) {
Expand Down Expand Up @@ -127,6 +130,9 @@ private String profileUrl(Long notificationId, String triggerType){
Notification notification = notificationRepository.findNotificationById(notificationId);
Member triggerMember = memberRepository.findMemberByIdOrThrow(notification.getNotificationTriggerMemberId());
return triggerMember.getProfileUrl();
}
if(triggerType.equals("popularWriter")||triggerType.equals("popularContent")) {
return POPULAR_IMAGE_S3;
}else{
return SYSTEM_IMAGE_S3;
}
Expand Down

0 comments on commit 7d97a53

Please sign in to comment.