Skip to content

Commit

Permalink
feat FC-Chilli-Bubble#125: 알림 끄기 API 컨트롤러 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonheeJeong committed Oct 4, 2023
1 parent c448394 commit a4859cf
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

@RequiredArgsConstructor
@RequestMapping("/api/notify")
Expand All @@ -29,4 +26,13 @@ public ResponseEntity<?> registerFcmToken(

return new ResponseEntity<>(HttpStatus.CREATED);
}

@DeleteMapping("/fcm-token")
public ResponseEntity<?> unsubscribe(
@AuthenticationPrincipal User user) {

fcmService.unsubscribe(user.getId());

return new ResponseEntity<>(HttpStatus.OK);
}
}

0 comments on commit a4859cf

Please sign in to comment.