-
Notifications
You must be signed in to change notification settings - Fork 47
Step2 PR #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Step2 PR #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리팩토링 잘 했네요. 💯
추가 개선을 위한 피드백 남겨 봅니다.
src/main/java/util/IOUtils.java
Outdated
return true; | ||
} | ||
|
||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return matcher.find();
로 구현 가능
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
피드백 반영
@@ -74,7 +75,7 @@ public static void registerGetMethod(Class clazz, Stream<Method> stream) { | |||
List<Method> getMethods = stream.collect(Collectors.toList()); | |||
for (Method getMethod : getMethods) { | |||
GetMapping getMapping = getMethod.getAnnotation(GetMapping.class); | |||
handlerMapper.put(new Mapping(getMapping.value(), "GET") | |||
handlerMapper.put(new Mapping(getMapping.value(), MethodType.GET) | |||
, (body, jSessionId) -> invokeMethod(createAllParameters(body, getMethod, jSessionId), clazz, getMethod)); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GET과 POST mapping하는 부분을 분리해야 하나?
분리하지 않고 구현할 수 없나?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum, Lambda를 이용해서 구현했습니다. 피드백 부탁드립니다!
피드백 반영
} | ||
|
||
@Override | ||
public Class identification() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supportsParameter 메소드를 활용하면 굳이 이 메소드가 필요한가?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존의 identification() 메소드가 supportParameter 와 동일한 역할을 수행하기 때문에 identification() 제거 및 supportParameter() 활용하도로 수정
|
||
public class WebMvcConfig { | ||
|
||
private Map<Class, HandlerMethodArgumentResolver> handlerMethodArgumentResolvers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List<HandlerMethodArgumentResolver> handlerMethodArgumentResolvers
로 구현할 수 있지 않을까?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List 구현 완료
- 질문사항 : Map으로 key 값을 통해 접근하는 것이 List 에서 하나씩 조회하는 것보다 빠르다고 생각을 해서
Map으로 구현을 했는데, 리스트로 구현을 해야하는 이유는 무엇이 있을까요?!
코드가 지저분하고, 복잡하다고 생각이 듭니다. 추가적으로 게선해야할 부분이 무엇있을까요?!