From f3481ceaa9c1c8655b490a42e2e0d7a3d2b58693 Mon Sep 17 00:00:00 2001 From: "chosw1002@naver.com" Date: Tue, 13 Feb 2024 12:27:06 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=EC=98=A8=EB=B3=B4=EB=94=A9=20?= =?UTF-8?q?=EB=A9=A4=EB=B2=84=20=EC=A1=B0=ED=9A=8C=20dto=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 --- .../dto/response/MemberInfoResponse.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java diff --git a/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java b/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java new file mode 100644 index 000000000..dffb1ed76 --- /dev/null +++ b/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java @@ -0,0 +1,33 @@ +package com.gdschongik.gdsc.domain.member.dto.response; + +import com.gdschongik.gdsc.domain.member.domain.Member; +import com.gdschongik.gdsc.domain.member.domain.MemberRole; +import com.gdschongik.gdsc.domain.member.domain.RequirementStatus; + +import io.swagger.v3.oas.annotations.media.Schema; + +public record MemberInfoResponse(Long memberId, + String studentId, + String name, + String phone, + String department, + String email, + String discordUsername, + String nickname, + @Schema(description = "회비 입금 상태") RequirementStatus paymentStatus, + @Schema(description = "가입 상태") MemberRole role) { + + public static MemberInfoResponse of(Member member) { + return new MemberInfoResponse( + member.getId(), + member.getStudentId(), + member.getName(), + member.getPhone(), + member.getDepartment(), + member.getEmail(), + member.getDiscordUsername(), + member.getNickname(), + member.getRequirement().getPaymentStatus(), + member.getRole()); + } +} From bf43b073af405ff9be2452885cf10269ffd54721 Mon Sep 17 00:00:00 2001 From: "chosw1002@naver.com" Date: Tue, 13 Feb 2024 12:27:42 +0900 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=EC=98=A8=EB=B3=B4=EB=94=A9=20?= =?UTF-8?q?=EB=A9=A4=EB=B2=84=20=EC=A1=B0=ED=9A=8C=20controller=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/member/api/OnboardingMemberController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/gdschongik/gdsc/domain/member/api/OnboardingMemberController.java b/src/main/java/com/gdschongik/gdsc/domain/member/api/OnboardingMemberController.java index 98288479c..c381eba01 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/member/api/OnboardingMemberController.java +++ b/src/main/java/com/gdschongik/gdsc/domain/member/api/OnboardingMemberController.java @@ -2,11 +2,13 @@ import com.gdschongik.gdsc.domain.member.application.OnboardingMemberService; import com.gdschongik.gdsc.domain.member.dto.request.MemberSignupRequest; +import com.gdschongik.gdsc.domain.member.dto.response.MemberInfoResponse; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -26,4 +28,11 @@ public ResponseEntity signupMember(@Valid @RequestBody MemberSignupRequest onboardingMemberService.signupMember(request); return ResponseEntity.ok().build(); } + + @Operation(summary = "회원 정보 조회", description = "회원 정보를 조회합니다.") + @GetMapping + public ResponseEntity getMemberInfo() { + MemberInfoResponse response = onboardingMemberService.getMemberInfo(); + return ResponseEntity.ok().body(response); + } } From 8559eff99dc659a6d59e445b1ed5d75c116772a8 Mon Sep 17 00:00:00 2001 From: "chosw1002@naver.com" Date: Tue, 13 Feb 2024 12:28:03 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=EC=98=A8=EB=B3=B4=EB=94=A9=20?= =?UTF-8?q?=EB=A9=A4=EB=B2=84=20=EC=A1=B0=ED=9A=8C=20service=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 --- .../domain/member/application/OnboardingMemberService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/gdschongik/gdsc/domain/member/application/OnboardingMemberService.java b/src/main/java/com/gdschongik/gdsc/domain/member/application/OnboardingMemberService.java index 70cf07efc..790e66eb8 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/member/application/OnboardingMemberService.java +++ b/src/main/java/com/gdschongik/gdsc/domain/member/application/OnboardingMemberService.java @@ -2,6 +2,7 @@ import com.gdschongik.gdsc.domain.member.domain.Member; import com.gdschongik.gdsc.domain.member.dto.request.MemberSignupRequest; +import com.gdschongik.gdsc.domain.member.dto.response.MemberInfoResponse; import com.gdschongik.gdsc.global.util.MemberUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -20,4 +21,9 @@ public void signupMember(MemberSignupRequest request) { currentMember.signup( request.studentId(), request.name(), request.phone(), request.department(), request.email()); } + + public MemberInfoResponse getMemberInfo() { + Member currentMember = memberUtil.getCurrentMember(); + return MemberInfoResponse.of(currentMember); + } } From edfd75df731988af22ca306af17a43b543213c43 Mon Sep 17 00:00:00 2001 From: "chosw1002@naver.com" Date: Tue, 13 Feb 2024 12:28:34 +0900 Subject: [PATCH 4/6] style: spotless apply --- .../dto/response/MemberInfoResponse.java | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java b/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java index dffb1ed76..b8e34be9a 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java +++ b/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java @@ -3,31 +3,31 @@ import com.gdschongik.gdsc.domain.member.domain.Member; import com.gdschongik.gdsc.domain.member.domain.MemberRole; import com.gdschongik.gdsc.domain.member.domain.RequirementStatus; - import io.swagger.v3.oas.annotations.media.Schema; -public record MemberInfoResponse(Long memberId, - String studentId, - String name, - String phone, - String department, - String email, - String discordUsername, - String nickname, - @Schema(description = "회비 입금 상태") RequirementStatus paymentStatus, - @Schema(description = "가입 상태") MemberRole role) { +public record MemberInfoResponse( + Long memberId, + String studentId, + String name, + String phone, + String department, + String email, + String discordUsername, + String nickname, + @Schema(description = "회비 입금 상태") RequirementStatus paymentStatus, + @Schema(description = "가입 상태") MemberRole role) { - public static MemberInfoResponse of(Member member) { - return new MemberInfoResponse( - member.getId(), - member.getStudentId(), - member.getName(), - member.getPhone(), - member.getDepartment(), - member.getEmail(), - member.getDiscordUsername(), - member.getNickname(), - member.getRequirement().getPaymentStatus(), - member.getRole()); - } + public static MemberInfoResponse of(Member member) { + return new MemberInfoResponse( + member.getId(), + member.getStudentId(), + member.getName(), + member.getPhone(), + member.getDepartment(), + member.getEmail(), + member.getDiscordUsername(), + member.getNickname(), + member.getRequirement().getPaymentStatus(), + member.getRole()); + } } From 4e62ec41866de9be4d53ef9f6379dbfdeb20d376 Mon Sep 17 00:00:00 2001 From: "chosw1002@naver.com" Date: Tue, 13 Feb 2024 15:01:34 +0900 Subject: [PATCH 5/6] =?UTF-8?q?refactor:=20endpoint=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gdsc/domain/member/api/OnboardingMemberController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gdschongik/gdsc/domain/member/api/OnboardingMemberController.java b/src/main/java/com/gdschongik/gdsc/domain/member/api/OnboardingMemberController.java index c381eba01..86eedaf0c 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/member/api/OnboardingMemberController.java +++ b/src/main/java/com/gdschongik/gdsc/domain/member/api/OnboardingMemberController.java @@ -30,7 +30,7 @@ public ResponseEntity signupMember(@Valid @RequestBody MemberSignupRequest } @Operation(summary = "회원 정보 조회", description = "회원 정보를 조회합니다.") - @GetMapping + @GetMapping("/me") public ResponseEntity getMemberInfo() { MemberInfoResponse response = onboardingMemberService.getMemberInfo(); return ResponseEntity.ok().body(response); From 4d5bb5cb5280965a7162173f22dcb83c4599c298 Mon Sep 17 00:00:00 2001 From: "chosw1002@naver.com" Date: Wed, 14 Feb 2024 00:15:14 +0900 Subject: [PATCH 6/6] =?UTF-8?q?refactor:=20response=EC=97=90=20=EB=94=94?= =?UTF-8?q?=EC=8A=A4=EC=BD=94=EB=93=9C=20=EC=97=B0=EB=8F=99=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gdsc/domain/member/dto/response/MemberInfoResponse.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java b/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java index b8e34be9a..f33fed0b5 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java +++ b/src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberInfoResponse.java @@ -15,6 +15,7 @@ public record MemberInfoResponse( String discordUsername, String nickname, @Schema(description = "회비 입금 상태") RequirementStatus paymentStatus, + @Schema(description = "디스코드 연동 상태") RequirementStatus discordStatus, @Schema(description = "가입 상태") MemberRole role) { public static MemberInfoResponse of(Member member) { @@ -28,6 +29,7 @@ public static MemberInfoResponse of(Member member) { member.getDiscordUsername(), member.getNickname(), member.getRequirement().getPaymentStatus(), + member.getRequirement().getDiscordStatus(), member.getRole()); } }