-
Notifications
You must be signed in to change notification settings - Fork 2
/
FcmTokenController.java
27 lines (23 loc) · 1.04 KB
/
FcmTokenController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.amorgakco.backend.fcmtoken.controller;
import com.amorgakco.backend.fcmtoken.dto.FcmTokenSaveRequest;
import com.amorgakco.backend.fcmtoken.service.FcmTokenService;
import com.amorgakco.backend.global.argumentresolver.AuthMemberId;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
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.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequiredArgsConstructor
@RequestMapping("/fcm-tokens")
public class FcmTokenController {
private final FcmTokenService fcmTokenService;
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public void saveToken(
@RequestBody final FcmTokenSaveRequest fcmTokenSaveRequest, @AuthMemberId final Long memberId) {
fcmTokenService.save(fcmTokenSaveRequest.fcmToken(), memberId);
}
}