feat: implement reservation MVP backend

This commit is contained in:
bumpsoo 2026-06-09 23:48:38 +09:00
parent 85a6f1fbbc
commit 6fda098137
48 changed files with 1974 additions and 39 deletions

View file

@ -0,0 +1,21 @@
package com.reservation.demo.common.security;
import com.reservation.demo.common.exception.BusinessException;
import com.reservation.demo.common.exception.ErrorCode;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
public final class SecurityUtils {
private SecurityUtils() {
}
public static Long getCurrentUserId() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication == null || authentication.getPrincipal() == null) {
throw new BusinessException(ErrorCode.UNAUTHORIZED);
}
return (Long) authentication.getPrincipal();
}
}