Skip to content

Commit

Permalink
MNG-28 feat: 푸시알림 보낼 때 idInfo에 tyep 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
minsu20 committed Aug 11, 2024
1 parent df1681e commit 446e9aa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
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();
}
}

0 comments on commit 446e9aa

Please sign in to comment.