-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/kotlin/co/yappuworld/user/presentation/UserSystemApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package co.yappuworld.user.presentation | ||
|
||
import co.yappuworld.global.security.SecurityUser | ||
import co.yappuworld.user.presentation.dto.request.UpdateFcmTokenApiRequestDto | ||
import io.swagger.v3.oas.annotations.Operation | ||
import io.swagger.v3.oas.annotations.media.Content | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses | ||
import io.swagger.v3.oas.annotations.tags.Tag | ||
import jakarta.validation.Valid | ||
import org.springframework.http.ResponseEntity | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal | ||
import org.springframework.web.bind.annotation.PutMapping | ||
import org.springframework.web.bind.annotation.RequestBody | ||
|
||
@Tag(name = "유저 시스템 설정 관련 API", description = "FCM, 기기 정보 등..") | ||
interface UserSystemApi { | ||
|
||
@Operation(summary = "FCM 토큰 수정") | ||
@ApiResponses( | ||
value = [ | ||
ApiResponse( | ||
description = "FCM 토큰 수정 성공", | ||
responseCode = "204", | ||
content = [Content(examples = emptyArray())] | ||
) | ||
] | ||
) | ||
@PutMapping("/v1/users/fcm") | ||
fun updateFcmToken( | ||
@AuthenticationPrincipal securityUser: SecurityUser, | ||
@Valid @RequestBody request: UpdateFcmTokenApiRequestDto | ||
): ResponseEntity<Unit> | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/co/yappuworld/user/presentation/UserSystemController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package co.yappuworld.user.presentation | ||
|
||
import co.yappuworld.global.security.SecurityUser | ||
import co.yappuworld.user.application.UserAlarmService | ||
import co.yappuworld.user.presentation.dto.request.UpdateFcmTokenApiRequestDto | ||
import org.springframework.http.ResponseEntity | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
@RestController | ||
class UserSystemController( | ||
private val userAlarmService: UserAlarmService | ||
) : UserSystemApi { | ||
|
||
override fun updateFcmToken( | ||
securityUser: SecurityUser, | ||
request: UpdateFcmTokenApiRequestDto | ||
): ResponseEntity<Unit> { | ||
userAlarmService.updateFcmToken(securityUser.userId, request.fcmToken) | ||
return ResponseEntity.noContent().build() | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/kotlin/co/yappuworld/user/presentation/dto/request/UpdateFcmTokenApiRequestDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package co.yappuworld.user.presentation.dto.request | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
import jakarta.validation.constraints.NotNull | ||
|
||
data class UpdateFcmTokenApiRequestDto( | ||
@Schema(description = "FCM 토큰") | ||
@field:NotNull(message = "FCM TOKEN 값으로 NULL은 허용되지 않습니다.") | ||
val fcmToken: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters