Skip to content

Commit

Permalink
fix: 카카오 전송로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
GitJIHO committed Nov 27, 2024
1 parent 21c2961 commit 3015b73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public record KakaoProperties(
String redirectUri,
String devRedirectUri,
String frontUriWithoutHttp,
String frontUrl
String frontUrl,
String defaultImageUrl
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
public class KakaoMessageService {

private static final String KAKAO_SEND_ME_BASE_URL = "https://kapi.kakao.com/v2/api/talk/memo/default/send";
private static final String DEFAULT_IMAGE_URL = "https://ifh.cc/g/mjb5nn.jpg";

private final KakaoTokenService kakaoTokenService;
private final RestTemplate restTemplate;
Expand All @@ -37,7 +36,7 @@ public void sendRecommendMessage(String email, String senderName, String posterU
headers.setBearerAuth(accessToken);

if (posterUrl.isEmpty()) {
posterUrl = DEFAULT_IMAGE_URL;
posterUrl = kakaoProperties.defaultImageUrl();
}

String templateObject = String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void sendContentRecommend(Long memberId, Long friendRequestId, RecommendC
.reason(recommendContentRequest.reason())
.build());

kakaoMessageService.sendRecommendMessage(member.getEmail(), member.getName(), content.getPosterPath(), content.getTitle(), content.getListedIn(), content.getType(), recommendContentRequest.reason());
kakaoMessageService.sendRecommendMessage(friendMember.getEmail(), member.getName(), content.getPosterPath(), content.getTitle(), content.getListedIn(), content.getType(), recommendContentRequest.reason());
}

@Transactional(readOnly = true)
Expand Down

0 comments on commit 3015b73

Please sign in to comment.