Skip to content

Refactor: 메시지 처리 코드 리팩토링 - #43

Open
ghost wants to merge 1 commit into
developfrom
feature/40
Open

Refactor: 메시지 처리 코드 리팩토링#43
ghost wants to merge 1 commit into
developfrom
feature/40

Conversation

@ghost

@ghost ghost commented Mar 24, 2022

Copy link
Copy Markdown

요약

Issues : #40

1. 메시지 처리 코드 리팩토링

리뷰 가이드

1. 메시지 처리 코드 리팩토링

  • MessageSenderStrategy -> ErrorMessageSenderStrategy 로 변경
  • ErrorMessageSenderStrategyGroup 빈 등록
  • ExceptionResolver에서 ErrorMessageSenderStrategyGroup 주입받아 사용하도록 변경

@ghost
ghost force-pushed the feature/40 branch from ea93f2d to 7df5662 Compare March 31, 2022 12:55
@ghost
ghost requested a review from f-lab-evan March 31, 2022 12:57
@ghost
ghost force-pushed the feature/40 branch 2 times, most recently from 835a395 to bac038b Compare April 3, 2022 08:53

@f-lab-evan f-lab-evan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

동일 이름의 커밋이 중복으로 올라와 있네요. 하나로 합쳐야 할것 같습니다

import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.flab.planb.response.message.MessageLookup;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Configuration;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

단순히 순서만 변경되었네요

messageLookup.getMessage(exceptionType.getLookupKey()),
Map.of("errorCode", exceptionType.getCode()))));
} catch (IOException e) {
log.error("{}", e.getMessage());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reponse에 아무것도 반환되지 않아도 괜찮을까요?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

클라이언트 응답은 ResponseMessage에서 만들고 write로 보내도록 하고 있습니다. 이로 인해 resolveException 메서드에서 ModelAndView를 반환할 필요가 없다고 생각해 null을 반환하도록 했지만, 비어있는 객체를 반환하도록 수정했습니다.

@ghost
ghost force-pushed the feature/40 branch 2 times, most recently from e688928 to 1df3272 Compare April 5, 2022 04:05
- EnumSet 제거 및 Array.stream 사용

Resolves: #40
@ghost
ghost force-pushed the feature/40 branch from 1df3272 to 3963da5 Compare April 5, 2022 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants