Skip to content

Commit

Permalink
fix: non-static 메소드로 변경 및 MemberConverter를 객체 주입 받아 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
KSLEE19 committed Jul 31, 2024
1 parent 854adc1 commit a40c939
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@RequiredArgsConstructor
public class MemberController {
private final MemberService memberService;

private final MemberConverter memberConverter;

@GetMapping("/{memberId}") // memberId를 사용해 특정 회원 정보 조회
@Operation( summary = "특정 회원 정보 조회 API", description = "[PathVariable]\n memberId\n[request]\n" +
Expand All @@ -39,7 +39,7 @@ public class MemberController {
public ResultResponse<MemberResponse.MemberInfo> getMemberInfo(@PathVariable(name = "memberId") Long memberId) {
Member member = memberService.findMember(memberId);
return ResultResponse.of(MemberResultCode.MEMBER_INFO,
MemberConverter.toMemberInfo(member));
memberConverter.toMemberInfo(member));
}

@GetMapping("/terms/{memberId}")
Expand All @@ -54,6 +54,6 @@ public ResultResponse<MemberResponse.MemberInfo> getMemberInfo(@PathVariable(nam
})
public ResultResponse<MemberResponse.MarketingAgreed> getMarketingAgreed(@PathVariable(name = "memberId") Long memberId) {
Member member = memberService.findMember(memberId);
return ResultResponse.of(MemberResultCode.CHECK_MARKETING_AGREED, MemberConverter.toMarketingAgreed(member));
return ResultResponse.of(MemberResultCode.CHECK_MARKETING_AGREED, memberConverter.toMarketingAgreed(member));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ public SignupRequest toSignupRequest(Claims payload, boolean marketingAgreed) {
.build();
}

public static MemberResponse.MemberInfo toMemberInfo(Member member) {
public MemberResponse.MemberInfo toMemberInfo(Member member) {
return MemberResponse.MemberInfo.builder()
.name(member.getName())
.email(member.getEmail())
.image(member.getImage())
.build();
}

public static MemberResponse.MarketingAgreed toMarketingAgreed(Member member) {
public MemberResponse.MarketingAgreed toMarketingAgreed(Member member) {
return MemberResponse.MarketingAgreed.builder()
.marketingAgreed(member.getMarketingAgreed())
.build();
Expand Down

0 comments on commit a40c939

Please sign in to comment.