feat: 유저 행동 데이터 - 본인인증 추가

This commit is contained in:
Klaus 2025-04-23 14:45:13 +09:00
parent e2daff6463
commit 58d066af0a
2 changed files with 14 additions and 2 deletions

View File

@ -3,6 +3,8 @@ package kr.co.vividnext.sodalive.member.auth
import kr.co.vividnext.sodalive.common.ApiResponse
import kr.co.vividnext.sodalive.common.SodaException
import kr.co.vividnext.sodalive.member.Member
import kr.co.vividnext.sodalive.useraction.ActionType
import kr.co.vividnext.sodalive.useraction.UserActionService
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
@ -11,7 +13,10 @@ import org.springframework.web.bind.annotation.RestController
@RestController
@RequestMapping("/auth")
class AuthController(private val service: AuthService) {
class AuthController(
private val service: AuthService,
private val userActionService: UserActionService
) {
@PostMapping
fun authVerify(
@RequestBody request: AuthVerifyRequest,
@ -26,6 +31,12 @@ class AuthController(private val service: AuthService) {
throw SodaException("운영정책을 위반하여 이용을 제한합니다.")
}
userActionService.recordAction(
memberId = member.id!!,
actionType = ActionType.USER_AUTHENTICATION,
pushToken = member.pushToken
)
ApiResponse.ok(service.authenticate(authenticateData, member.id!!))
}
}

View File

@ -1,5 +1,6 @@
package kr.co.vividnext.sodalive.useraction
enum class ActionType(val displayName: String) {
SIGN_UP("회원가입")
SIGN_UP("회원가입"),
USER_AUTHENTICATION("본인인증")
}