From 6c250fde591e5be9981981524502c20ce93af01a Mon Sep 17 00:00:00 2001 From: shinhn Date: Fri, 13 Jan 2023 18:04:02 +0900 Subject: [PATCH] =?UTF-8?q?#98=20#108=20Feat=20:=20=EC=9C=A0=EC=A0=80=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=EB=90=9C=20=EC=83=81=ED=83=9C?= =?UTF-8?q?=EC=9D=BC=20=EB=95=8C=EB=A7=8C=20=ED=91=B8=EC=89=AC=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20=EC=A0=84=EC=86=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/board/service/boarduser/BoardUserServiceImpl.java | 3 ++- .../server/board/service/clipboard/ClipBoardServiceImpl.java | 4 ++-- .../java/com/yogit/server/user/controller/UserController.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/com/yogit/server/board/service/boarduser/BoardUserServiceImpl.java b/server/src/main/java/com/yogit/server/board/service/boarduser/BoardUserServiceImpl.java index 18c3260..124566d 100644 --- a/server/src/main/java/com/yogit/server/board/service/boarduser/BoardUserServiceImpl.java +++ b/server/src/main/java/com/yogit/server/board/service/boarduser/BoardUserServiceImpl.java @@ -15,6 +15,7 @@ import com.yogit.server.global.dto.ApplicationResponse; import com.yogit.server.s3.AwsS3Service; import com.yogit.server.user.entity.User; +import com.yogit.server.user.entity.UserStatus; import com.yogit.server.user.exception.NotFoundUserException; import com.yogit.server.user.repository.UserRepository; import com.yogit.server.user.service.UserService; @@ -80,7 +81,7 @@ public ApplicationResponse joinBoardUser(CreateBoardUserReq dto) { // 호스트에게 참여 APN 푸쉬 알림 try { - apnService.createBoardUserJoinAPN(new CreateBoardUserJoinAPNReq(board.getHost().getDeviceToken(), user.getName(), board.getId(), board.getTitle())); + if(user.getUserStatus().equals(UserStatus.LOGIN)) apnService.createBoardUserJoinAPN(new CreateBoardUserJoinAPNReq(board.getHost().getDeviceToken(), user.getName(), board.getId(), board.getTitle())); } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { diff --git a/server/src/main/java/com/yogit/server/board/service/clipboard/ClipBoardServiceImpl.java b/server/src/main/java/com/yogit/server/board/service/clipboard/ClipBoardServiceImpl.java index 5c4ded3..d103be5 100644 --- a/server/src/main/java/com/yogit/server/board/service/clipboard/ClipBoardServiceImpl.java +++ b/server/src/main/java/com/yogit/server/board/service/clipboard/ClipBoardServiceImpl.java @@ -1,6 +1,5 @@ package com.yogit.server.board.service.clipboard; -import com.yogit.server.apns.dto.req.CreateBoardUserJoinAPNReq; import com.yogit.server.apns.dto.req.CreateClipBoardAPNReq; import com.yogit.server.apns.service.APNService; import com.yogit.server.block.repository.BlockRepository; @@ -22,6 +21,7 @@ import com.yogit.server.global.dto.ApplicationResponse; import com.yogit.server.s3.AwsS3Service; import com.yogit.server.user.entity.User; +import com.yogit.server.user.entity.UserStatus; import com.yogit.server.user.exception.NotFoundUserException; import com.yogit.server.user.repository.UserRepository; import com.yogit.server.user.service.UserService; @@ -79,7 +79,7 @@ public ApplicationResponse createClipBoard(CreateClipBoardReq dto) if(boardUsers!=null){ for(BoardUser bu: boardUsers){ try { - apnService.createClipBoardAPN(new CreateClipBoardAPNReq(bu.getUser().getDeviceToken(), user.getName(), board.getId(), board.getTitle())); + if(user.getUserStatus().equals(UserStatus.LOGIN)) apnService.createClipBoardAPN(new CreateClipBoardAPNReq(bu.getUser().getDeviceToken(), user.getName(), board.getId(), board.getTitle())); } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { diff --git a/server/src/main/java/com/yogit/server/user/controller/UserController.java b/server/src/main/java/com/yogit/server/user/controller/UserController.java index 1cccd83..3673e72 100644 --- a/server/src/main/java/com/yogit/server/user/controller/UserController.java +++ b/server/src/main/java/com/yogit/server/user/controller/UserController.java @@ -255,7 +255,7 @@ public ApplicationResponse addDeviceToken(@ModelAttribute Ad }) @PostMapping(value = "/log-out") @ResponseBody - public ApplicationResponse logInApple(@ModelAttribute LogoutReq logoutReq) { + public ApplicationResponse logOut(@ModelAttribute LogoutReq logoutReq) { return userService.logout(logoutReq); }