From c1ad7fae0c4593e04995ffe3ac3b3831da3c2c0a Mon Sep 17 00:00:00 2001 From: "LEE K.S" Date: Wed, 31 Jul 2024 11:41:10 +0900 Subject: [PATCH 1/7] =?UTF-8?q?fix:=20primitive=20type=EC=9D=84=20Wrapper?= =?UTF-8?q?=20class=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/umc/naoman/domain/member/entity/Member.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/umc/naoman/domain/member/entity/Member.java b/src/main/java/com/umc/naoman/domain/member/entity/Member.java index 5e13ce7..572c5f9 100644 --- a/src/main/java/com/umc/naoman/domain/member/entity/Member.java +++ b/src/main/java/com/umc/naoman/domain/member/entity/Member.java @@ -39,7 +39,7 @@ public class Member extends BaseTimeEntity { @Column(name = "social_type", nullable = false) private SocialType socialType; @Column(name = "marketing_agreed") - private boolean marketingAgreed; + private Boolean marketingAgreed; public Member update(String name, String image) { this.name = name; From 39c84f038e066f38e2f1b395d3daf5da93f16776 Mon Sep 17 00:00:00 2001 From: "LEE K.S" Date: Wed, 31 Jul 2024 11:42:26 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20=EB=A7=88=EC=BC=80=ED=8C=85=20?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9=EC=95=BD=EA=B4=80=20=EB=8F=99=EC=9D=98=20?= =?UTF-8?q?=EC=97=AC=EB=B6=80=20=EC=A1=B0=ED=9A=8C=20=EC=84=B1=EA=B3=B5=20?= =?UTF-8?q?resultCode=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/umc/naoman/global/result/code/MemberResultCode.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/umc/naoman/global/result/code/MemberResultCode.java b/src/main/java/com/umc/naoman/global/result/code/MemberResultCode.java index 98d17de..a583b3b 100644 --- a/src/main/java/com/umc/naoman/global/result/code/MemberResultCode.java +++ b/src/main/java/com/umc/naoman/global/result/code/MemberResultCode.java @@ -13,6 +13,7 @@ public enum MemberResultCode implements ResultCode { EDIT_MYPAGE_INFO(200, "SM002", "내 정보를 성공적으로 수정하였습니다."), CHECK_MEMBER_REGISTRATION(200, "SM000", "해당 이메일을 가진 회원의 가입 여부를 성공적으로 조회하였습니다."), MEMBER_INFO (200,"SM005","회원 정보를 성공적으로 조회하였습니다."), + CHECK_MARKETING_AGREED(200,"SM006","마케팅 동의 여부를 성공적으로 조회하였습니다."), ; private final int status; private final String code; From 759866f2594a6935f48dc62756638fabc1972ef9 Mon Sep 17 00:00:00 2001 From: "LEE K.S" Date: Wed, 31 Jul 2024 11:42:48 +0900 Subject: [PATCH 3/7] =?UTF-8?q?feat:=20=EB=A7=88=EC=BC=80=ED=8C=85=20?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9=EC=95=BD=EA=B4=80=20=EB=8F=99=EC=9D=98?= =?UTF-8?q?=EC=97=AC=EB=B6=80=20=EC=A1=B0=ED=9A=8C=20api=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../naoman/domain/member/controller/MemberController.java | 6 ++++++ .../naoman/domain/member/converter/MemberConverter.java | 6 ++++++ .../com/umc/naoman/domain/member/dto/MemberResponse.java | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java b/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java index 8096528..08535c5 100644 --- a/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java +++ b/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java @@ -26,4 +26,10 @@ public ResultResponse getMemberInfo(@PathVariable(nam return ResultResponse.of(MemberResultCode.MEMBER_INFO, MemberConverter.toMemberInfo(member)); } + + @GetMapping("/terms/{memberId}") + public ResultResponse getMarketingAgreed(@PathVariable(name = "memberId") Long memberId) { + Member member = memberService.findMember(memberId); + return ResultResponse.of(MemberResultCode.CHECK_MARKETING_AGREED, MemberConverter.toMarketingAgreed(member)); + } } diff --git a/src/main/java/com/umc/naoman/domain/member/converter/MemberConverter.java b/src/main/java/com/umc/naoman/domain/member/converter/MemberConverter.java index 6aa9976..4907c27 100644 --- a/src/main/java/com/umc/naoman/domain/member/converter/MemberConverter.java +++ b/src/main/java/com/umc/naoman/domain/member/converter/MemberConverter.java @@ -48,4 +48,10 @@ public static MemberResponse.MemberInfo toMemberInfo(Member member) { .build(); } + public static MemberResponse.MarketingAgreed toMarketingAgreed(Member member) { + return MemberResponse.MarketingAgreed.builder() + .marketingAgreed(member.getMarketingAgreed()) + .build(); + } + } diff --git a/src/main/java/com/umc/naoman/domain/member/dto/MemberResponse.java b/src/main/java/com/umc/naoman/domain/member/dto/MemberResponse.java index 35a66c0..ba0f426 100644 --- a/src/main/java/com/umc/naoman/domain/member/dto/MemberResponse.java +++ b/src/main/java/com/umc/naoman/domain/member/dto/MemberResponse.java @@ -34,4 +34,11 @@ public static class MemberInfo { //특정 회원 조회 private String email; private String image; } + + @Builder + @Getter + @AllArgsConstructor + public static class MarketingAgreed { + private Boolean marketingAgreed; + } } From d8eb950d04866a6170cc9bdea830ce1a098a6b31 Mon Sep 17 00:00:00 2001 From: "LEE K.S" Date: Wed, 31 Jul 2024 13:02:26 +0900 Subject: [PATCH 4/7] =?UTF-8?q?feat:=20swagger=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/controller/MemberController.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java b/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java index 08535c5..ca0f46d 100644 --- a/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java +++ b/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java @@ -4,8 +4,14 @@ import com.umc.naoman.domain.member.dto.MemberResponse; import com.umc.naoman.domain.member.entity.Member; import com.umc.naoman.domain.member.service.MemberService; +import com.umc.naoman.global.error.ErrorResponse; import com.umc.naoman.global.result.ResultResponse; import com.umc.naoman.global.result.code.MemberResultCode; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; @@ -20,7 +26,17 @@ public class MemberController { private final MemberService memberService; + @GetMapping("/{memberId}") // memberId를 사용해 특정 회원 정보 조회 + @Operation( summary = "특정 회원 정보 조회 API", description = "PathVariable]\n memberId\nrequest]\n" + + "response]\n uesrname, email, 소셜 프로필 이미지 url") + @ApiResponses({ + @io.swagger.v3.oas.annotations.responses.ApiResponse + (responseCode = "SM005", description = "특정 회원 정보 조회 성공."), + @io.swagger.v3.oas.annotations.responses.ApiResponse + (responseCode = "EM001", description = "해당 memberId를 가진 회원이 존재하지 않습니다.", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + }) public ResultResponse getMemberInfo(@PathVariable(name = "memberId") Long memberId) { Member member = memberService.findMember(memberId); return ResultResponse.of(MemberResultCode.MEMBER_INFO, @@ -28,6 +44,15 @@ public ResultResponse getMemberInfo(@PathVariable(nam } @GetMapping("/terms/{memberId}") + @Operation(summary = "마케팅 약관 동의 여부 조회 API", description = "PathVariable]\n memberId\nrequest]\n" + + "response]\n 마케팅 동의 여부 -> 동의 => true, 비동의 => false") + @ApiResponses({ + @io.swagger.v3.oas.annotations.responses.ApiResponse + (responseCode = "SM006", description = "마케팅 약관 동의 여부 조회 성공."), + @io.swagger.v3.oas.annotations.responses.ApiResponse + (responseCode = "EM001", description = "해당 memberId를 가진 회원이 존재하지 않습니다.", + content = @Content(schema = @Schema(implementation = ErrorResponse.class))), + }) public ResultResponse getMarketingAgreed(@PathVariable(name = "memberId") Long memberId) { Member member = memberService.findMember(memberId); return ResultResponse.of(MemberResultCode.CHECK_MARKETING_AGREED, MemberConverter.toMarketingAgreed(member)); From 854adc1ddf3fab01533c1d0e057b8852e6a81171 Mon Sep 17 00:00:00 2001 From: "LEE K.S" Date: Wed, 31 Jul 2024 17:20:45 +0900 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20import=20=ED=8C=A8=ED=82=A4=EC=A7=80?= =?UTF-8?q?=20=EC=A0=95=EB=A6=AC=20=EB=B0=8F=20Swagger=20=EC=B6=9C?= =?UTF-8?q?=EB=A0=A5=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/member/controller/MemberController.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java b/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java index ca0f46d..7c33ae5 100644 --- a/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java +++ b/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java @@ -10,7 +10,6 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; @@ -28,8 +27,8 @@ public class MemberController { @GetMapping("/{memberId}") // memberId를 사용해 특정 회원 정보 조회 - @Operation( summary = "특정 회원 정보 조회 API", description = "PathVariable]\n memberId\nrequest]\n" + - "response]\n uesrname, email, 소셜 프로필 이미지 url") + @Operation( summary = "특정 회원 정보 조회 API", description = "[PathVariable]\n memberId\n[request]\n" + + "[response]\n uesrname, email, 소셜 프로필 이미지 url") @ApiResponses({ @io.swagger.v3.oas.annotations.responses.ApiResponse (responseCode = "SM005", description = "특정 회원 정보 조회 성공."), @@ -44,8 +43,8 @@ public ResultResponse getMemberInfo(@PathVariable(nam } @GetMapping("/terms/{memberId}") - @Operation(summary = "마케팅 약관 동의 여부 조회 API", description = "PathVariable]\n memberId\nrequest]\n" + - "response]\n 마케팅 동의 여부 -> 동의 => true, 비동의 => false") + @Operation(summary = "마케팅 약관 동의 여부 조회 API", description = "[PathVariable]\n memberId\n[request]\n" + + "[response]\n 마케팅 동의 여부 -> 동의 => true, 비동의 => false") @ApiResponses({ @io.swagger.v3.oas.annotations.responses.ApiResponse (responseCode = "SM006", description = "마케팅 약관 동의 여부 조회 성공."), From a40c9393aff4e2d5f6dea345c753ddfe5d2194dc Mon Sep 17 00:00:00 2001 From: "LEE K.S" Date: Wed, 31 Jul 2024 17:24:37 +0900 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20non-static=20=EB=A9=94=EC=86=8C?= =?UTF-8?q?=EB=93=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20MemberCon?= =?UTF-8?q?verter=EB=A5=BC=20=EA=B0=9D=EC=B2=B4=20=EC=A3=BC=EC=9E=85=20?= =?UTF-8?q?=EB=B0=9B=EC=95=84=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../naoman/domain/member/controller/MemberController.java | 6 +++--- .../umc/naoman/domain/member/converter/MemberConverter.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java b/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java index 7c33ae5..2f67fe0 100644 --- a/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java +++ b/src/main/java/com/umc/naoman/domain/member/controller/MemberController.java @@ -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" + @@ -39,7 +39,7 @@ public class MemberController { public ResultResponse 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}") @@ -54,6 +54,6 @@ public ResultResponse getMemberInfo(@PathVariable(nam }) public ResultResponse 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)); } } diff --git a/src/main/java/com/umc/naoman/domain/member/converter/MemberConverter.java b/src/main/java/com/umc/naoman/domain/member/converter/MemberConverter.java index 4907c27..ac5472b 100644 --- a/src/main/java/com/umc/naoman/domain/member/converter/MemberConverter.java +++ b/src/main/java/com/umc/naoman/domain/member/converter/MemberConverter.java @@ -40,7 +40,7 @@ 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()) @@ -48,7 +48,7 @@ public static MemberResponse.MemberInfo toMemberInfo(Member member) { .build(); } - public static MemberResponse.MarketingAgreed toMarketingAgreed(Member member) { + public MemberResponse.MarketingAgreed toMarketingAgreed(Member member) { return MemberResponse.MarketingAgreed.builder() .marketingAgreed(member.getMarketingAgreed()) .build(); From 274fbf1f9ff692b1fccfd45bcd8544b948b915b0 Mon Sep 17 00:00:00 2001 From: "LEE K.S" Date: Wed, 31 Jul 2024 17:25:35 +0900 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=EA=B0=80=EB=8F=85=EC=84=B1=EC=9D=84?= =?UTF-8?q?=20=EC=9C=84=ED=95=B4=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/umc/naoman/global/result/code/MemberResultCode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/umc/naoman/global/result/code/MemberResultCode.java b/src/main/java/com/umc/naoman/global/result/code/MemberResultCode.java index a583b3b..430d615 100644 --- a/src/main/java/com/umc/naoman/global/result/code/MemberResultCode.java +++ b/src/main/java/com/umc/naoman/global/result/code/MemberResultCode.java @@ -13,7 +13,7 @@ public enum MemberResultCode implements ResultCode { EDIT_MYPAGE_INFO(200, "SM002", "내 정보를 성공적으로 수정하였습니다."), CHECK_MEMBER_REGISTRATION(200, "SM000", "해당 이메일을 가진 회원의 가입 여부를 성공적으로 조회하였습니다."), MEMBER_INFO (200,"SM005","회원 정보를 성공적으로 조회하였습니다."), - CHECK_MARKETING_AGREED(200,"SM006","마케팅 동의 여부를 성공적으로 조회하였습니다."), + CHECK_MARKETING_AGREED(200,"SM006","마케팅동의여부를 성공적으로 조회하였습니다."), ; private final int status; private final String code;