Skip to content

Commit

Permalink
Merge pull request #191 from YogitTeam/feat/report
Browse files Browse the repository at this point in the history
#108 #98 Apn 알림 - time, isOpen 컬럼 추가
  • Loading branch information
shinhn authored Apr 19, 2023
2 parents 669a3d8 + fbdccf7 commit 5a25d08
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ public class CreateBoardUserJoinAPNReq {
private String joinUserName;
private Long boardId;
private String boardName;
private String time;
boolean isOpened;

@Builder
public CreateBoardUserJoinAPNReq(String destinationDeviceToken, String joinUserName, Long boardId, String boardName) {
public CreateBoardUserJoinAPNReq(String destinationDeviceToken, String joinUserName, Long boardId, String boardName, String time) {
this.destinationDeviceToken = destinationDeviceToken;
this.joinUserName = joinUserName;
this.boardId = boardId;
this.boardName = boardName;
this.time = time;
this.isOpened = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ public class CreateClipBoardAPNReq {
private String userName;
private Long boardId;
private String boardName;
private String time;
boolean isOpened;

@Builder
public CreateClipBoardAPNReq(String destinationDeviceToken, String userName, Long boardId, String boardName) {
public CreateClipBoardAPNReq(String destinationDeviceToken, String userName, Long boardId, String boardName, String time) {
this.destinationDeviceToken = destinationDeviceToken;
this.userName = userName;
this.boardId = boardId;
this.boardName = boardName;
this.time = time;
this.isOpened = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ public class DelBoardUserJoinAPNReq {
private String delUserName;
private Long boardId;
private String boardName;
private String time;
boolean isOpened;

@Builder
public DelBoardUserJoinAPNReq(String destinationDeviceToken, String delUserName, Long boardId, String boardName) {
public DelBoardUserJoinAPNReq(String destinationDeviceToken, String delUserName, Long boardId, String boardName, String time) {
this.destinationDeviceToken = destinationDeviceToken;
this.delUserName = delUserName;
this.boardId = boardId;
this.boardName = boardName;
this.time = time;
this.isOpened = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
Expand Down Expand Up @@ -85,7 +86,7 @@ public ApplicationResponse<BoardUserRes> joinBoardUser(CreateBoardUserReq dto) {

// 호스트에게 멤버 참여 APN 푸쉬 알림
try {
if(user.getUserStatus().equals(UserStatus.LOGIN) && board.getHost().getDeviceToken() != null) apnService.createBoardUserJoinAPN(new CreateBoardUserJoinAPNReq(board.getHost().getDeviceToken(), user.getName(), board.getId(), board.getTitle()));
if(user.getUserStatus().equals(UserStatus.LOGIN) && board.getHost().getDeviceToken() != null) apnService.createBoardUserJoinAPN(new CreateBoardUserJoinAPNReq(board.getHost().getDeviceToken(), user.getName(), board.getId(), board.getTitle(), LocalDateTime.now().toString()));
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
Expand Down Expand Up @@ -154,7 +155,7 @@ public ApplicationResponse<Void> delBoardUser(CreateBoardUserReq dto){

// 호스트에게 멤버 참여 취소 APN 푸쉬 알림
try {
if(user.getUserStatus().equals(UserStatus.LOGIN) && board.getHost().getDeviceToken() != null) apnService.delBoardUserJoinAPN(new DelBoardUserJoinAPNReq(board.getHost().getDeviceToken(), user.getName(), board.getId(), board.getTitle()));
if(user.getUserStatus().equals(UserStatus.LOGIN) && board.getHost().getDeviceToken() != null) apnService.delBoardUserJoinAPN(new DelBoardUserJoinAPNReq(board.getHost().getDeviceToken(), user.getName(), board.getId(), board.getTitle(), LocalDateTime.now().toString()));
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -82,7 +83,7 @@ public ApplicationResponse<ClipBoardRes> createClipBoard(CreateClipBoardReq dto)
if(boardUsers!=null){
for(BoardUser bu: boardUsers){
try {
if(user.getUserStatus().equals(UserStatus.LOGIN) && !user.equals(bu.getUser()) && bu.getUser().getDeviceToken() != null) apnService.createClipBoardAPN(new CreateClipBoardAPNReq(bu.getUser().getDeviceToken(), user.getName(), board.getId(), board.getTitle()));
if(user.getUserStatus().equals(UserStatus.LOGIN) && !user.equals(bu.getUser()) && bu.getUser().getDeviceToken() != null) apnService.createClipBoardAPN(new CreateClipBoardAPNReq(bu.getUser().getDeviceToken(), user.getName(), board.getId(), board.getTitle(), LocalDateTime.now().toString()));
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
Expand Down

0 comments on commit 5a25d08

Please sign in to comment.