Skip to content

Commit

Permalink
Merge pull request #107 from HowMuchPay/feature101
Browse files Browse the repository at this point in the history
[refactor-105] : fcm 토큰 메시지 전송 acId -> targetUserPhoneNumber
  • Loading branch information
seongHyun-Min authored Oct 10, 2023
2 parents 4d28a4b + eab5b21 commit 15bc808
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
@AllArgsConstructor
@NoArgsConstructor
public class FcmNotificationRequestDto {
private Long acId; // 추가된 acId 필드
private String targetUserPhoneNumber;
private String title;
private String body;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@AllArgsConstructor
@NoArgsConstructor
public class FcmNotificationRequestListDto {
private Long acId;
private List<String> targetUserPhoneNumber;
private String title;
private String body;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public FcmNotificationResponseDto sendNotificationToGroup(FcmNotificationRequest
sendNotification(phoneNumber, requestDto.getTitle(), requestDto.getBody(), validUserPhoneNumber, invalidUserPhoneNumber);
}

return buildResponse(validUserPhoneNumber, invalidUserPhoneNumber, requestDto.getAcId(), requestDto.getTargetUserPhoneNumber());
return buildResponse(validUserPhoneNumber, invalidUserPhoneNumber, requestDto.getTargetUserPhoneNumber());
}

// 1 대 1 으로
Expand Down Expand Up @@ -82,7 +82,7 @@ private void sendNotification(String phoneNumber, String title, String body) {
sendNotification(phoneNumber, title, body, new ArrayList<>(), new ArrayList<>());
}

private FcmNotificationResponseDto buildResponse(List<String> validUserPhoneNumber, List<String> invalidUserPhoneNumber, Long acId, List<String> targetUserPhoneNumber) {
private FcmNotificationResponseDto buildResponse(List<String> validUserPhoneNumber, List<String> invalidUserPhoneNumber, List<String> targetUserPhoneNumber) {
FcmNotificationResponseDto responseDto = new FcmNotificationResponseDto();

if (validUserPhoneNumber.isEmpty()) {
Expand All @@ -93,9 +93,6 @@ private FcmNotificationResponseDto buildResponse(List<String> validUserPhoneNumb
log.info("유효하지 않은 유저 수: {}", invalidUserPhoneNumber.size());
responseDto.setResponseMessage("알림을 성공적으로 전달하였습니다. 유효한 유저 수: " + validUserPhoneNumber.size());
}

responseDto.setAcId(acId); // ACID 설정

return responseDto;
}

Expand Down

0 comments on commit 15bc808

Please sign in to comment.