Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNG-28 feat: 푸시알림 보낼 때 idInfo에 tyep 추가 - 2 #305

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private String createIdInfo(Long teamId, Long boardId) {
JSONObject jo = new JSONObject();
jo.put("teamId", teamId);
jo.put("boardId", boardId);
jo.put("type", "COMMENT");
jo.put("type", "COMMENT_BOARD");
return jo.toJSONString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void sendFireThrowAlarm(Member throwMember, Member receiveMember, Team te
: getRandomTitle(throwMember.getNickName(), receiveMember.getNickName(), randomNum);
String message = fireThrowReq != null ? fireThrowReq.getMessage()
: getRandomMessage(throwMember.getNickName(), receiveMember.getNickName(), randomNum);
String idInfo = createIdInfo(mission.getType() == MissionType.REPEAT, mission.getTeam().getTeamId(), mission.getId());
String idInfo = createIdInfo(mission.getType() == MissionType.REPEAT, mission.getTeam().getTeamId(), mission.getId(), fireThrowReq == null);

eventPublisher.publishEvent(new SingleFcmEvent(receiveMember, title, message, idInfo, team.getName(), FIRE, MISSION_PATH.getValue(), receiveMember.isFirePush()));
}
Expand All @@ -60,14 +60,20 @@ public String getRandomTitle(String pusher, String receiver, int num) {
return NEW_FIRE_THROW_TITLE1.getMessage();
}

private String createIdInfo(boolean isRepeated, Long teamId, Long missionId) {
private String createIdInfo(boolean isRepeated, Long teamId, Long missionId, boolean isMessageNull) {
JSONObject jo = new JSONObject();
jo.put("isRepeated", isRepeated);
jo.put("teamId", teamId);
jo.put("missionId", missionId);
jo.put("type", "FIRE");
jo.put("type", getType(isMessageNull));
return jo.toJSONString();
}

private String getType(boolean isMessageNull){
if(isMessageNull)
return "FIRE_MESSAGE_NULL";
return "FIRE_MESSAGE_EXIST";
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import static com.moing.backend.domain.missionArchive.application.service.MissionArchiveCreateMessage.CREATOR_CREATE_MISSION_ARCHIVE;
import static com.moing.backend.domain.missionArchive.application.service.MissionArchiveCreateMessage.TEAM_AND_TITLE;
import static com.moing.backend.global.config.fcm.constant.NewMissionTitle.NEW_SINGLE_MISSION_COMING;

@Service
@Transactional
Expand Down Expand Up @@ -54,6 +53,7 @@ private String createIdInfo(Long teamId, Long missionId,MissionType type, Missio
jo.put("teamId", teamId);
jo.put("missionId", missionId);
jo.put("status", status.name());
jo.put("type", "COMPLETE_MISSION");
return jo.toJSONString();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private String createIdInfo(Long teamId, Long missionId, Long missionArchiveId)
jo.put("missionArchiveId", missionArchiveId);
jo.put("teamId", teamId);
jo.put("missionId", missionId);
jo.put("type", "COMMENT_MISSION");
return jo.toJSONString();
}
}
Loading