-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/fcm' of https://github.com/Orange-Co/DDANZI_Server
- Loading branch information
Showing
9 changed files
with
105 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 2 additions & 6 deletions
8
src/main/java/co/orange/ddanzi/dto/payment/PortOneTokenRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
package co.orange.ddanzi.dto.payment; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Builder | ||
@Getter | ||
public class PortOneTokenRequestDto { | ||
@JsonProperty("imp_key") | ||
private String impKey; // 필드 이름을 camelCase로 수정 | ||
|
||
@JsonProperty("imp_secret") | ||
private String impSecret; | ||
private String imp_key; | ||
private String imp_secret; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,18 +85,27 @@ public boolean sendMessageToUser(User user, FcmCase fcmCase, Order order) { | |
return true; | ||
} | ||
|
||
public boolean sendMessageToAdmin(FcmCase fcmCase) { | ||
log.info("Sending FCM message to admin: {}", fcmCase.getTitle()); | ||
public boolean sendMessageToAdmin(User user, String title, String body) { | ||
PushAlarm pushAlarm = pushAlarmRepository.findByUser(user).orElse(null); | ||
if(pushAlarm == null) | ||
return false; | ||
String fcmToken = pushAlarm.getFcmToken(); | ||
firebaseUtils.sendAdminMessage(fcmToken, title, body); | ||
alarmService.createAlarm(user, FcmCase.C1, null); | ||
return true; | ||
} | ||
|
||
public boolean sendMessageToAdmins(String title, String body) { | ||
log.info("Sending FCM message to admins: {}", title); | ||
User sj = userRepository.findByEmail("[email protected]").orElse(null); | ||
User jh = userRepository.findByEmail("[email protected]").orElse(null); | ||
User sh = userRepository.findByEmail("[email protected]").orElse(null); | ||
User ys = userRepository.findByEmail("[email protected]").orElse(null); | ||
|
||
sendMessageToUser(sj, fcmCase, null); | ||
sendMessageToUser(jh, fcmCase, null); | ||
sendMessageToUser(sh, fcmCase, null); | ||
sendMessageToUser(ys, fcmCase, null); | ||
sendMessageToAdmin(sj, title, body); | ||
sendMessageToAdmin(jh, title, body); | ||
sendMessageToAdmin(sh, title, body); | ||
sendMessageToAdmin(ys, title, body); | ||
return true; | ||
} | ||
|
||
} |