Skip to content

Commit

Permalink
Merge pull request #65 from 0-wook/develop
Browse files Browse the repository at this point in the history
test
  • Loading branch information
0-wook authored Feb 19, 2024
2 parents 46c47fd + ca42a4a commit 43ae12e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 50 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
package kr.co.automl.global.config.web;

import kr.co.automl.domain.user.dto.SessionUser;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpSession;

import org.springframework.core.MethodParameter;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;

import javax.servlet.http.HttpSession;
import kr.co.automl.domain.user.dto.SessionUser;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Component
public class LoginUserArgumentResolver implements HandlerMethodArgumentResolver {

private final HttpSession httpSession;


/**
* 현재 파라미터를 resolver가 지원할지에 대해 판단
* 현재 파라미터를 resolver가 지원할지에 대해 판단
*/
@Override
public boolean supportsParameter(MethodParameter parameter) {
Expand All @@ -33,7 +33,8 @@ public boolean supportsParameter(MethodParameter parameter) {
* 실제 바인딩할 객체 리턴
*/
@Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) {
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) {
return httpSession.getAttribute("user");
}
}

0 comments on commit 43ae12e

Please sign in to comment.