diff --git a/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/application/MemberCommandUseCase.java b/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/application/MemberCommandUseCase.java index 509aa96..da6ab86 100644 --- a/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/application/MemberCommandUseCase.java +++ b/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/application/MemberCommandUseCase.java @@ -90,18 +90,6 @@ public Response status(String id, ActiveStatus status) { return Response.ok("멤버 상태변경 성공"); } - @CacheEvict(value = "members-cache", key = "'activeMembers'") - public Response active(String id) { - updateStatus(id, ActiveStatus.ACTIVE); - return Response.ok("멤버 활성화 성공"); - } - - @CacheEvict(value = "members-cache", key = "'activeMembers'") - public Response deactivate(String id) { - updateStatus(id, ActiveStatus.DEACTIVATE); - return Response.ok("멤버 비활성화 성공"); - } - @CacheEvict(value = "members-cache", key = "'activeMembers'") public Response deactivate() { Member member = memberAuthenticationHolder.current(); @@ -110,11 +98,6 @@ public Response deactivate() { return Response.ok("멤버 비활성화 성공"); } - private void updateStatus(String id, ActiveStatus status) { - Member member = memberRepository.getById(id); - member.updateStatus(status); - } - public Response updatePassword(UpdatePasswordReq req) { Member member = memberAuthenticationHolder.current(); member.updatePw(Sha512PasswordEncoder.encode(req.password())); diff --git a/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/application/MemberQueryUseCase.java b/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/application/MemberQueryUseCase.java index 28f486b..a4d8560 100644 --- a/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/application/MemberQueryUseCase.java +++ b/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/application/MemberQueryUseCase.java @@ -45,33 +45,12 @@ public ResponseData> searchByName(String name) { } public ResponseData> getMembersByStatus(ActiveStatus status) { - return ResponseData.ok("상태변 멤버 조회 성공", memberRepository.findByStatusOrderByStudent(status) + return ResponseData.ok("상태별 멤버 조회 성공", memberRepository.findByStatusOrderByStudent(status) .parallelStream() .map(this::getMemberInfo) .toList()); } - public ResponseData> getDeactivateMembers() { - return ResponseData.ok("비활성화된 멤버 조회 성공", memberRepository.findByStatusOrderByStudent(ActiveStatus.DEACTIVATE) - .parallelStream() - .map(this::getMemberInfo) - .toList()); - } - - public ResponseData> getPendingMembers(){ - return ResponseData.ok("대기중인 멤버 조회 성공", memberRepository.findByStatusOrderByStudent(ActiveStatus.PENDING) - .parallelStream() - .map(this::getMemberInfo) - .toList()); - } - - @Cacheable(value = "members-cache", key = "'activeMembers'") - public List getAll() { - return memberRepository.findByStatusOrderByStudent(ActiveStatus.ACTIVE).parallelStream() - .map(this::getMemberInfo) - .toList(); - } - private MemberInfoRes getMemberInfo(Member member) { Student student = studentRepository.findByMember(member) .orElse(null); diff --git a/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/presentation/MemberController.java b/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/presentation/MemberController.java index 9703480..cea347e 100644 --- a/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/presentation/MemberController.java +++ b/dodam-application/dodam-rest-api/src/main/java/b1nd/dodam/restapi/member/presentation/MemberController.java @@ -46,21 +46,11 @@ public Response updateStatus(@PathVariable String id, @RequestParam ActiveStatus return commandUseCase.status(id, status); } - @PatchMapping("/active/{id}") - public Response active(@PathVariable("id") String id) { - return commandUseCase.active(id); - } - @PatchMapping("/deactivate") public Response deactivate() { return commandUseCase.deactivate(); } - @PatchMapping("/deactivate/{id}") - public Response deactivate(@PathVariable("id") String id) { - return commandUseCase.deactivate(id); - } - @PatchMapping("/password") public Response updatePassword(@RequestBody @Valid UpdatePasswordReq req) { return commandUseCase.updatePassword(req); @@ -106,21 +96,6 @@ public ResponseData> getMembersByStatus(@RequestParam Active return queryUseCase.getMembersByStatus(status); } - @GetMapping("/deactivate") - public ResponseData> getDeactivateMembers() { - return queryUseCase.getDeactivateMembers(); - } - - @GetMapping("/pending") - public ResponseData> getPendingMembers(){ - return queryUseCase.getPendingMembers(); - } - - @GetMapping("/all") - public ResponseData> getAll() { - return ResponseData.ok("모든 멤버 정보 조회 성공", queryUseCase.getAll()); - } - @GetMapping("/check/broadcast-club-member") public ResponseData checkBroadcastClubMember() { return queryUseCase.checkBroadcastClubMember(); diff --git a/dodam-system-domain/dodam-domain-rds/src/main/java/b1nd/dodam/domain/rds/member/enumeration/ActiveStatus.java b/dodam-system-domain/dodam-domain-rds/src/main/java/b1nd/dodam/domain/rds/member/enumeration/ActiveStatus.java index e329629..d2c81db 100644 --- a/dodam-system-domain/dodam-domain-rds/src/main/java/b1nd/dodam/domain/rds/member/enumeration/ActiveStatus.java +++ b/dodam-system-domain/dodam-domain-rds/src/main/java/b1nd/dodam/domain/rds/member/enumeration/ActiveStatus.java @@ -2,6 +2,6 @@ public enum ActiveStatus { - ACTIVE, DEACTIVATE, PENDING, DEACTIVATED + ACTIVE, PENDING, DEACTIVATED }