From 0bc7c1cccaa4bcca1db13b5eff99e84e12387126 Mon Sep 17 00:00:00 2001 From: 2hyunjinn Date: Mon, 20 Jan 2025 18:04:32 +0900 Subject: [PATCH] =?UTF-8?q?[chore]=20#148=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=BD=94=EB=93=9C=20=EB=B0=8F=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/controller/CommentController.java | 2 +- .../be/api/comment/facade/CommentFacade.java | 13 +-- .../api/comment/registry/CommentStrategy.java | 14 +-- .../registry/CommentStrategyRegistry.java | 5 +- .../strategy/EveryGroupCommentStrategy.java | 30 ++--- .../strategy/OnceGroupCommentStrategy.java | 35 +++--- .../com/ggang/be/api/common/ApiResponse.java | 4 - .../be/api/common/PracticeController.java | 26 ----- ...estFacade.java => GroupRequestFacade.java} | 8 +- .../api/facade/SearchSchoolMajorFacade.java | 3 +- .../com/ggang/be/api/facade/SignupFacade.java | 8 +- .../ggang/be/api/facade/TimeTableFacade.java | 7 +- ...ava => ActiveCombinedGroupVoPreparer.java} | 5 +- .../be/api/group/GroupStatusUpdater.java | 8 +- .../api/group/controller/GroupController.java | 27 ++--- .../api/group/dto/ActiveGroupsResponse.java | 2 +- .../be/api/group/dto/CombinedGroupVos.java | 1 + .../be/api/group/dto/MyGroupResponse.java | 7 +- .../api/group/dto/NearestGroupResponse.java | 2 +- .../be/api/group/dto/PrepareRegisterInfo.java | 15 ++- .../group/dto/ReadFillMembersResponse.java | 28 +++-- .../group/dto/RegisterGongbaekRequest.java | 103 +++++++++--------- .../group/dto/RegisterGongbaekResponse.java | 8 -- .../api/group/dto/RegisterGroupResponse.java | 8 ++ .../strategy/EveryGroupInfoStrategy.java | 2 +- .../EveryGroupReadFillMemberStrategy.java | 9 +- .../strategy/EveryGroupUserInfoStrategy.java | 2 +- .../strategy/EveryLatestGroupStrategy.java | 2 +- .../strategy/RegisterEveryGroupStrategy.java | 14 +-- .../be/api/group/facade/GroupFacade.java | 29 +++-- .../strategy/OnceGroupInfoStrategy.java | 2 +- .../OnceGroupReadFillMemberStrategy.java | 2 - .../strategy/OnceGroupUserInfoStrategy.java | 2 +- .../strategy/OnceLatestGroupStrategy.java | 2 +- .../strategy/RegisterOnceGroupStrategy.java | 8 +- .../registry/ApplyGroupStrategyRegistry.java | 8 +- .../registry/CancelGroupStrategyRegistry.java | 1 - .../api/group/registry/GroupInfoStrategy.java | 2 +- .../registry/GroupInfoStrategyRegistry.java | 2 +- .../group/registry/GroupUserInfoStrategy.java | 2 +- .../GroupUserInfoStrategyRegistry.java | 2 +- .../group/registry/LatestGroupStrategy.java | 2 +- .../registry/LatestGroupStrategyRegistry.java | 2 +- .../api/group/registry/MyGroupStrategy.java | 2 +- .../registry/MyGroupStrategyRegistry.java | 2 +- .../ReadFillMemberStrategyRegistry.java | 4 +- .../group/registry/RegisterGroupStrategy.java | 4 +- .../RegisterGroupStrategyRegistry.java | 3 +- .../group/strategy/MyApplyGroupStrategy.java | 2 +- .../strategy/MyRegisterGroupStrategy.java | 2 +- .../service/LectureTimeSlotService.java | 1 - .../api/school/dto/SchoolSearchResponse.java | 2 - .../be/api/school/service/SchoolService.java | 2 +- .../be/api/user/dto/ReissueResponse.java | 8 -- .../service/UserOnceGroupService.java | 3 - .../ggang/be/domain/constant/GroupType.java | 17 --- .../ggang/be/domain/constant/WeekDate.java | 20 ++-- .../domain/group/IntroductionValidator.java | 3 - .../be/domain/group/LocationValidator.java | 3 +- .../ggang/be/domain/group/TitleValidator.java | 1 - .../ggang/be/domain/group/dto/ReadGroup.java | 10 -- .../group/everyGroup/EveryGroupEntity.java | 4 +- .../application/EveryGroupServiceImpl.java | 2 - .../infra/EveryGroupRepository.java | 2 - .../vo/ReadEveryGroupCommentCommonVo.java | 4 +- .../group/onceGroup/OnceGroupEntity.java | 26 +---- .../onceGroup/infra/OnceGroupRepository.java | 2 - .../vo/ReadOnceGroupCommentCommonVo.java | 3 +- .../ggang/be/domain/school/SchoolEntity.java | 4 +- .../be/domain/school/application/School.java | 6 +- .../schoolMajor/application/SchoolMajor.java | 6 +- .../application/SchoolMajorServiceImpl.java | 3 +- .../infra/GongbaekTimeSlotRepository.java | 4 - .../infra/LectureTimeSlotRepository.java | 3 +- .../com/ggang/be/domain/user/UserEntity.java | 4 +- .../com/ggang/be/domain/user/dto/UserDto.java | 5 - .../UserEveryGroupServiceImpl.java | 7 +- .../userEveryGroup/dto/NearestEveryGroup.java | 2 +- .../infra/UserEveryGroupRepository.java | 2 +- .../application/UserOnceGroupServiceImpl.java | 5 - .../userOnceGroup/dto/NearestOnceGroup.java | 2 +- .../infra/UserOnceGroupRepository.java | 8 +- .../be/global/schedule/SchedulerConfig.java | 4 +- .../ggang/be/global/util/TimeConverter.java | 2 - 84 files changed, 250 insertions(+), 413 deletions(-) delete mode 100644 src/main/java/com/ggang/be/api/common/PracticeController.java rename src/main/java/com/ggang/be/api/facade/{GongbaekRequestFacade.java => GroupRequestFacade.java} (98%) rename src/main/java/com/ggang/be/api/group/{ActivceCombinedGroupVoPreparer.java => ActiveCombinedGroupVoPreparer.java} (98%) delete mode 100644 src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekResponse.java create mode 100644 src/main/java/com/ggang/be/api/group/dto/RegisterGroupResponse.java delete mode 100644 src/main/java/com/ggang/be/api/user/dto/ReissueResponse.java delete mode 100644 src/main/java/com/ggang/be/domain/group/dto/ReadGroup.java delete mode 100644 src/main/java/com/ggang/be/domain/user/dto/UserDto.java diff --git a/src/main/java/com/ggang/be/api/comment/controller/CommentController.java b/src/main/java/com/ggang/be/api/comment/controller/CommentController.java index 63c5db2..f3bc404 100644 --- a/src/main/java/com/ggang/be/api/comment/controller/CommentController.java +++ b/src/main/java/com/ggang/be/api/comment/controller/CommentController.java @@ -4,9 +4,9 @@ import com.ggang.be.api.comment.dto.ReadCommentResponse; import com.ggang.be.api.comment.dto.WriteCommentRequest; import com.ggang.be.api.comment.dto.WriteCommentResponse; +import com.ggang.be.api.comment.facade.CommentFacade; import com.ggang.be.api.common.ApiResponse; import com.ggang.be.api.common.ResponseBuilder; -import com.ggang.be.api.comment.facade.CommentFacade; import com.ggang.be.global.jwt.JwtService; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/ggang/be/api/comment/facade/CommentFacade.java b/src/main/java/com/ggang/be/api/comment/facade/CommentFacade.java index 9fce774..3da55d5 100644 --- a/src/main/java/com/ggang/be/api/comment/facade/CommentFacade.java +++ b/src/main/java/com/ggang/be/api/comment/facade/CommentFacade.java @@ -1,13 +1,9 @@ package com.ggang.be.api.comment.facade; -import com.ggang.be.api.comment.dto.ReadCommentRequest; -import com.ggang.be.api.comment.dto.ReadCommentResponse; -import com.ggang.be.api.comment.dto.WriteCommentEntityDto; -import com.ggang.be.api.comment.dto.WriteCommentRequest; -import com.ggang.be.api.comment.dto.WriteCommentResponse; -import com.ggang.be.api.comment.service.CommentService; +import com.ggang.be.api.comment.dto.*; import com.ggang.be.api.comment.registry.CommentStrategy; import com.ggang.be.api.comment.registry.CommentStrategyRegistry; +import com.ggang.be.api.comment.service.CommentService; import com.ggang.be.api.user.service.UserService; import com.ggang.be.domain.comment.CommentEntity; import com.ggang.be.domain.user.UserEntity; @@ -35,15 +31,12 @@ public WriteCommentResponse writeComment(final long userId, WriteCommentRequest } - public ReadCommentResponse readComment(Long userId, final boolean isPublic, - ReadCommentRequest dto) { + public ReadCommentResponse readComment(Long userId, final boolean isPublic, ReadCommentRequest dto) { CommentStrategy commentStrategy = commentStrategyRegistry.getCommentGroupStrategy(dto.groupType()); - UserEntity findUserEntity = userService.getUserById(userId); - return commentStrategy.readComment(findUserEntity, isPublic, dto); } diff --git a/src/main/java/com/ggang/be/api/comment/registry/CommentStrategy.java b/src/main/java/com/ggang/be/api/comment/registry/CommentStrategy.java index 32b2424..2336297 100644 --- a/src/main/java/com/ggang/be/api/comment/registry/CommentStrategy.java +++ b/src/main/java/com/ggang/be/api/comment/registry/CommentStrategy.java @@ -1,22 +1,14 @@ package com.ggang.be.api.comment.registry; -import com.ggang.be.api.comment.dto.ReadCommentRequest; -import com.ggang.be.api.comment.dto.ReadCommentResponse; -import com.ggang.be.api.comment.dto.WriteCommentEntityDto; -import com.ggang.be.api.comment.dto.WriteCommentRequest; -import com.ggang.be.api.comment.dto.WriteCommentResponse; +import com.ggang.be.api.comment.dto.*; import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.user.UserEntity; public interface CommentStrategy { - ReadCommentResponse readComment(UserEntity findUserEntity, boolean isPublic, - ReadCommentRequest dto); + ReadCommentResponse readComment(UserEntity findUserEntity, boolean isPublic, ReadCommentRequest dto); boolean supports(GroupType groupType); - WriteCommentResponse writeComment(final long userId, WriteCommentRequest dto, - WriteCommentEntityDto from); - - + WriteCommentResponse writeComment(final long userId, WriteCommentRequest dto, WriteCommentEntityDto from); } diff --git a/src/main/java/com/ggang/be/api/comment/registry/CommentStrategyRegistry.java b/src/main/java/com/ggang/be/api/comment/registry/CommentStrategyRegistry.java index 6dd6b4c..4d4bd38 100644 --- a/src/main/java/com/ggang/be/api/comment/registry/CommentStrategyRegistry.java +++ b/src/main/java/com/ggang/be/api/comment/registry/CommentStrategyRegistry.java @@ -4,9 +4,10 @@ import com.ggang.be.api.exception.GongBaekException; import com.ggang.be.domain.constant.GroupType; import com.ggang.be.global.annotation.Registry; -import java.util.List; import lombok.RequiredArgsConstructor; +import java.util.List; + @Registry @RequiredArgsConstructor public class CommentStrategyRegistry { @@ -19,6 +20,4 @@ public CommentStrategy getCommentGroupStrategy(GroupType groupType) { .findFirst() .orElseThrow(() -> new GongBaekException(ResponseError.BAD_REQUEST)); } - - } diff --git a/src/main/java/com/ggang/be/api/comment/strategy/EveryGroupCommentStrategy.java b/src/main/java/com/ggang/be/api/comment/strategy/EveryGroupCommentStrategy.java index 8f0c284..bb4355e 100644 --- a/src/main/java/com/ggang/be/api/comment/strategy/EveryGroupCommentStrategy.java +++ b/src/main/java/com/ggang/be/api/comment/strategy/EveryGroupCommentStrategy.java @@ -1,10 +1,6 @@ package com.ggang.be.api.comment.strategy; -import com.ggang.be.api.comment.dto.ReadCommentRequest; -import com.ggang.be.api.comment.dto.ReadCommentResponse; -import com.ggang.be.api.comment.dto.WriteCommentEntityDto; -import com.ggang.be.api.comment.dto.WriteCommentRequest; -import com.ggang.be.api.comment.dto.WriteCommentResponse; +import com.ggang.be.api.comment.dto.*; import com.ggang.be.api.comment.registry.CommentStrategy; import com.ggang.be.api.group.everyGroup.service.EveryGroupService; import com.ggang.be.api.userEveryGroup.service.UserEveryGroupService; @@ -25,29 +21,25 @@ public class EveryGroupCommentStrategy implements CommentStrategy { private final UserEveryGroupService userEveryGroupService; @Override - public WriteCommentResponse writeComment(long userId, WriteCommentRequest dto, - WriteCommentEntityDto from) { - + public WriteCommentResponse writeComment(long userId, WriteCommentRequest dto, WriteCommentEntityDto from) { CommentEntity commentEntity = from.commentEntity(); UserEntity findUserEntity = from.userEntity(); - EveryGroupEntity everyGroupEntity = everyGroupService.findEveryGroupEntityByGroupId( - dto.groupId()); + EveryGroupEntity everyGroupEntity = everyGroupService.findEveryGroupEntityByGroupId(dto.groupId()); - sameSchoolValidator.isUserReadMySchoolEveryGroup(findUserEntity, - everyGroupEntity); + sameSchoolValidator.isUserReadMySchoolEveryGroup(findUserEntity, everyGroupEntity); isUserAccessEveryGroupComment(findUserEntity, dto.isPublic(), dto.groupId()); everyGroupService.writeCommentInGroup(commentEntity, dto.groupId()); + return WriteCommentResponse.of(commentEntity.getId()); } @Override - public ReadCommentResponse readComment(UserEntity findUserEntity, boolean isPublic, - ReadCommentRequest dto) { - EveryGroupEntity everyGroupEntity = everyGroupService.findEveryGroupEntityByGroupId( - dto.groupId()); + public ReadCommentResponse readComment(UserEntity findUserEntity, boolean isPublic, ReadCommentRequest dto) { + EveryGroupEntity everyGroupEntity = everyGroupService.findEveryGroupEntityByGroupId(dto.groupId()); sameSchoolValidator.isUserReadMySchoolEveryGroup(findUserEntity, everyGroupEntity); isUserAccessEveryGroupComment(findUserEntity, isPublic, dto.groupId()); + return ReadCommentResponse.of(everyGroupService.readCommentInGroup(findUserEntity, isPublic, dto.groupId())); } @@ -56,9 +48,7 @@ public boolean supports(GroupType groupType) { return groupType.equals(GroupType.WEEKLY); } - private void isUserAccessEveryGroupComment(UserEntity userEntity, boolean isPublic, - long groupId) { - if (!isPublic) - userEveryGroupService.isValidCommentAccess(userEntity, groupId); + private void isUserAccessEveryGroupComment(UserEntity userEntity, boolean isPublic, long groupId) { + if (!isPublic) userEveryGroupService.isValidCommentAccess(userEntity, groupId); } } diff --git a/src/main/java/com/ggang/be/api/comment/strategy/OnceGroupCommentStrategy.java b/src/main/java/com/ggang/be/api/comment/strategy/OnceGroupCommentStrategy.java index a23cbf4..c195f85 100644 --- a/src/main/java/com/ggang/be/api/comment/strategy/OnceGroupCommentStrategy.java +++ b/src/main/java/com/ggang/be/api/comment/strategy/OnceGroupCommentStrategy.java @@ -1,10 +1,6 @@ package com.ggang.be.api.comment.strategy; -import com.ggang.be.api.comment.dto.ReadCommentRequest; -import com.ggang.be.api.comment.dto.ReadCommentResponse; -import com.ggang.be.api.comment.dto.WriteCommentEntityDto; -import com.ggang.be.api.comment.dto.WriteCommentRequest; -import com.ggang.be.api.comment.dto.WriteCommentResponse; +import com.ggang.be.api.comment.dto.*; import com.ggang.be.api.comment.registry.CommentStrategy; import com.ggang.be.api.group.onceGroup.service.OnceGroupService; import com.ggang.be.api.userOnceGroup.service.UserOnceGroupService; @@ -24,23 +20,21 @@ public class OnceGroupCommentStrategy implements CommentStrategy { private final SameSchoolValidator sameSchoolValidator; private final UserOnceGroupService userOnceGroupService; - @Override public boolean supports(GroupType groupType) { return groupType.equals(GroupType.ONCE); } @Override - public WriteCommentResponse writeComment(long userId, WriteCommentRequest dto, - WriteCommentEntityDto entityDto) { + public WriteCommentResponse writeComment( + long userId, WriteCommentRequest dto, WriteCommentEntityDto entityDto + ) { UserEntity findUserEntity = entityDto.userEntity(); CommentEntity commentEntity = entityDto.commentEntity(); - OnceGroupEntity onceGroupEntity = onceGroupService.findOnceGroupEntityByGroupId( - dto.groupId()); + OnceGroupEntity onceGroupEntity = onceGroupService.findOnceGroupEntityByGroupId(dto.groupId()); - sameSchoolValidator.isUserReadMySchoolOnceGroup(commentEntity.getUserEntity(), - onceGroupEntity); + sameSchoolValidator.isUserReadMySchoolOnceGroup(commentEntity.getUserEntity(), onceGroupEntity); isUserAccessOnceGroupComment(findUserEntity, dto.isPublic(), dto.groupId()); onceGroupService.writeCommentInGroup(commentEntity, dto.groupId()); @@ -48,20 +42,17 @@ public WriteCommentResponse writeComment(long userId, WriteCommentRequest dto, } @Override - public ReadCommentResponse readComment(UserEntity findUserEntity, boolean isPublic, - ReadCommentRequest dto) { - OnceGroupEntity onceGroupEntity = onceGroupService.findOnceGroupEntityByGroupId( - dto.groupId()); + public ReadCommentResponse readComment( + UserEntity findUserEntity, boolean isPublic, ReadCommentRequest dto + ) { + OnceGroupEntity onceGroupEntity = onceGroupService.findOnceGroupEntityByGroupId(dto.groupId()); sameSchoolValidator.isUserReadMySchoolOnceGroup(findUserEntity, onceGroupEntity); isUserAccessOnceGroupComment(findUserEntity, isPublic, dto.groupId()); + return ReadCommentResponse.of(onceGroupService.readCommentInGroup(findUserEntity, isPublic, dto.groupId())); } - private void isUserAccessOnceGroupComment(UserEntity userEntity, boolean isPublic, - long groupId) { - if (!isPublic) { - userOnceGroupService.isValidCommentAccess(userEntity, groupId); - } + private void isUserAccessOnceGroupComment(UserEntity userEntity, boolean isPublic, long groupId) { + if (!isPublic) userOnceGroupService.isValidCommentAccess(userEntity, groupId); } - } diff --git a/src/main/java/com/ggang/be/api/common/ApiResponse.java b/src/main/java/com/ggang/be/api/common/ApiResponse.java index 6ce547d..425ca91 100644 --- a/src/main/java/com/ggang/be/api/common/ApiResponse.java +++ b/src/main/java/com/ggang/be/api/common/ApiResponse.java @@ -5,10 +5,6 @@ public static ApiResponse success(ResponseSuccess responseSuccess, T data return new ApiResponse<>(true, responseSuccess.getCode(), responseSuccess.getMessage(), data); } - public static ApiResponse success(ResponseSuccess responseSuccess) { - return new ApiResponse<>(true, responseSuccess.getCode(), responseSuccess.getMessage(), null); - } - public static ApiResponse error(ResponseError responseError) { return new ApiResponse<>(false, responseError.getCode(), responseError.getMessage(), null); } diff --git a/src/main/java/com/ggang/be/api/common/PracticeController.java b/src/main/java/com/ggang/be/api/common/PracticeController.java deleted file mode 100644 index 6b8a778..0000000 --- a/src/main/java/com/ggang/be/api/common/PracticeController.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ggang.be.api.common; - -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; -import static com.ggang.be.api.common.ResponseError.*; - -@RestController -public class PracticeController { - - @GetMapping("/ok") - public ResponseEntity> ok() { - return ResponseBuilder.ok(null); - } - - @GetMapping("/created") - public ResponseEntity> created() { - return ResponseBuilder.created("1"); - } - - @GetMapping("/custom-error") - public ResponseEntity> error() { - return ResponseBuilder.error(INVALID_TOKEN); - } - -} diff --git a/src/main/java/com/ggang/be/api/facade/GongbaekRequestFacade.java b/src/main/java/com/ggang/be/api/facade/GroupRequestFacade.java similarity index 98% rename from src/main/java/com/ggang/be/api/facade/GongbaekRequestFacade.java rename to src/main/java/com/ggang/be/api/facade/GroupRequestFacade.java index 100fc90..f51a280 100644 --- a/src/main/java/com/ggang/be/api/facade/GongbaekRequestFacade.java +++ b/src/main/java/com/ggang/be/api/facade/GroupRequestFacade.java @@ -19,15 +19,13 @@ @Facade @RequiredArgsConstructor @Slf4j -public class GongbaekRequestFacade { +public class GroupRequestFacade { private final LectureTimeSlotService lectureTimeSlotService; private final UserService userService; private final LocationValidator locationValidator; private final TitleValidator titleValidator; private final IntroductionValidator introductionValidator; - - public void validateRegisterRequest(Long userId, RegisterGongbaekRequest dto) { TimeValidator.isTimeValid(dto.startTime(), dto.endTime()); isDateValid(dto); @@ -38,9 +36,7 @@ public void validateRegisterRequest(Long userId, RegisterGongbaekRequest dto) { isValidCoverImg(dto); isValidMaxPeople(dto); - UserEntity findUserEntity = userService.getUserById(userId); - checkLectureTimeSlot(dto, findUserEntity); } @@ -51,7 +47,6 @@ private void isValidMaxPeople(RegisterGongbaekRequest dto) { } } - private void isValidCoverImg(RegisterGongbaekRequest dto) { if(dto.coverImg()<1 || dto.coverImg()>6) { log.error("그룹 coverImg 검증에 실패하였습니다."); @@ -59,7 +54,6 @@ private void isValidCoverImg(RegisterGongbaekRequest dto) { } } - private void isDateValid(RegisterGongbaekRequest dto) { if(dto.groupType() == GroupType.ONCE) { TimeValidator.isDateBeforeNow(dto.weekDate()); diff --git a/src/main/java/com/ggang/be/api/facade/SearchSchoolMajorFacade.java b/src/main/java/com/ggang/be/api/facade/SearchSchoolMajorFacade.java index 9e51816..39f455e 100644 --- a/src/main/java/com/ggang/be/api/facade/SearchSchoolMajorFacade.java +++ b/src/main/java/com/ggang/be/api/facade/SearchSchoolMajorFacade.java @@ -5,9 +5,10 @@ import com.ggang.be.api.schoolMajor.service.SchoolMajorService; import com.ggang.be.domain.school.application.School; import com.ggang.be.global.annotation.Facade; -import java.util.List; import lombok.RequiredArgsConstructor; +import java.util.List; + @Facade @RequiredArgsConstructor public class SearchSchoolMajorFacade { diff --git a/src/main/java/com/ggang/be/api/facade/SignupFacade.java b/src/main/java/com/ggang/be/api/facade/SignupFacade.java index 66514bf..b9a3e9e 100644 --- a/src/main/java/com/ggang/be/api/facade/SignupFacade.java +++ b/src/main/java/com/ggang/be/api/facade/SignupFacade.java @@ -37,11 +37,9 @@ public SignupResponse signup(SignupRequest request) { duplicateUserCheck(request); - SchoolEntity schoolEntityByName = schoolService.findSchoolEntityByName( - request.schoolName()); + SchoolEntity schoolEntityByName = schoolService.findSchoolEntityByName(request.schoolName()); - SaveUserSignUp saveUserSignUp = SignupRequest.toSaveUserSignUp(request, - schoolEntityByName); + SaveUserSignUp saveUserSignUp = SignupRequest.toSaveUserSignUp(request, schoolEntityByName); UserEntity userEntity = userService.saveUserBySignup(saveUserSignUp); @@ -57,7 +55,7 @@ public SignupResponse signup(SignupRequest request) { private void duplicateUserCheck(SignupRequest request) { try{ duplicateCheckNickname(request.nickname()); - }catch (GongBaekException e){ + } catch (GongBaekException e) { throw new GongBaekException(ResponseError.USERNAME_ALREADY_EXISTS); } } diff --git a/src/main/java/com/ggang/be/api/facade/TimeTableFacade.java b/src/main/java/com/ggang/be/api/facade/TimeTableFacade.java index 762d039..61b443c 100644 --- a/src/main/java/com/ggang/be/api/facade/TimeTableFacade.java +++ b/src/main/java/com/ggang/be/api/facade/TimeTableFacade.java @@ -20,9 +20,8 @@ public class TimeTableFacade { public ReadInvalidTimeResponse readMyInvalidTime(final long userId) { UserEntity findUserEntity = userService.getUserById(userId); - List lectureTimeSlotEntities = lectureTimeSlotService.readUserTime( - findUserEntity); - return ReadInvalidTimeResponse.fromVo( - voMaker.convertToCommonResponse(lectureTimeSlotEntities)); + List lectureTimeSlotEntities = lectureTimeSlotService.readUserTime(findUserEntity); + + return ReadInvalidTimeResponse.fromVo(voMaker.convertToCommonResponse(lectureTimeSlotEntities)); } } diff --git a/src/main/java/com/ggang/be/api/group/ActivceCombinedGroupVoPreparer.java b/src/main/java/com/ggang/be/api/group/ActiveCombinedGroupVoPreparer.java similarity index 98% rename from src/main/java/com/ggang/be/api/group/ActivceCombinedGroupVoPreparer.java rename to src/main/java/com/ggang/be/api/group/ActiveCombinedGroupVoPreparer.java index 6a80ea9..19db6f0 100644 --- a/src/main/java/com/ggang/be/api/group/ActivceCombinedGroupVoPreparer.java +++ b/src/main/java/com/ggang/be/api/group/ActiveCombinedGroupVoPreparer.java @@ -10,12 +10,13 @@ import com.ggang.be.domain.group.onceGroup.dto.OnceGroupVo; import com.ggang.be.domain.user.UserEntity; import com.ggang.be.global.annotation.Facade; -import java.util.List; import lombok.RequiredArgsConstructor; +import java.util.List; + @Facade @RequiredArgsConstructor -public class ActivceCombinedGroupVoPreparer { +public class ActiveCombinedGroupVoPreparer { private final EveryGroupService everyGroupService; private final OnceGroupService onceGroupService; diff --git a/src/main/java/com/ggang/be/api/group/GroupStatusUpdater.java b/src/main/java/com/ggang/be/api/group/GroupStatusUpdater.java index 07ebcba..83a9a28 100644 --- a/src/main/java/com/ggang/be/api/group/GroupStatusUpdater.java +++ b/src/main/java/com/ggang/be/api/group/GroupStatusUpdater.java @@ -4,15 +4,14 @@ import com.ggang.be.domain.group.everyGroup.EveryGroupEntity; import com.ggang.be.domain.group.onceGroup.OnceGroupEntity; import com.ggang.be.global.util.TimeConverter; -import java.time.LocalDateTime; -import java.time.LocalTime; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDateTime; +import java.time.LocalTime; + @Component public class GroupStatusUpdater { - - @Transactional public void updateOnceGroup(OnceGroupEntity entity){ double startTime = entity.getGongbaekTimeSlotEntity().getStartTime(); @@ -22,7 +21,6 @@ public void updateOnceGroup(OnceGroupEntity entity){ entity.updateStatus(Status.CLOSED); } - @Transactional public void updateEveryGroup(EveryGroupEntity entity){ LocalTime midNight = LocalTime.of(0, 0); diff --git a/src/main/java/com/ggang/be/api/group/controller/GroupController.java b/src/main/java/com/ggang/be/api/group/controller/GroupController.java index 751bf02..8e12c6b 100644 --- a/src/main/java/com/ggang/be/api/group/controller/GroupController.java +++ b/src/main/java/com/ggang/be/api/group/controller/GroupController.java @@ -5,9 +5,9 @@ import com.ggang.be.api.common.ResponseError; import com.ggang.be.api.common.ResponseSuccess; import com.ggang.be.api.exception.GongBaekException; -import com.ggang.be.api.facade.GongbaekRequestFacade; -import com.ggang.be.api.group.facade.GroupFacade; +import com.ggang.be.api.facade.GroupRequestFacade; import com.ggang.be.api.group.dto.*; +import com.ggang.be.api.group.facade.GroupFacade; import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.FillGroupType; import com.ggang.be.domain.constant.GroupType; @@ -23,7 +23,7 @@ @RequiredArgsConstructor public class GroupController { private final GroupFacade groupFacade; - private final GongbaekRequestFacade gongbaekRequestFacade; + private final GroupRequestFacade groupRequestFacade; private final JwtService jwtService; @GetMapping("/fill/info") @@ -46,28 +46,29 @@ public ResponseEntity> getGroupUserInfo( ){ jwtService.isValidToken(accessToken); - GroupUserInfoResponseDto groupUserInfoResponseDto - = GroupUserInfoResponseDto.of(groupFacade.getGroupUserInfo( - groupRequestDto.groupType(), groupRequestDto.groupId())); + GroupUserInfoResponseDto groupUserInfoResponseDto = GroupUserInfoResponseDto.of( + groupFacade.getGroupUserInfo(groupRequestDto.groupType(), groupRequestDto.groupId())); + return ResponseEntity.ok(ApiResponse.success(ResponseSuccess.OK, groupUserInfoResponseDto)); } // TODO : 테스트 코드 작성 진행해야함! @PostMapping("/gongbaek") - public ResponseEntity> registerGongbaek( - @RequestHeader("Authorization") String token, - @RequestBody final RegisterGongbaekRequest dto + public ResponseEntity> registerGongbaek( + @RequestHeader("Authorization") String token, + @RequestBody final RegisterGongbaekRequest dto ) { Long userId = jwtService.parseTokenAndGetUserId(token); + groupRequestFacade.validateRegisterRequest(userId, dto); - gongbaekRequestFacade.validateRegisterRequest(userId, dto); - - return ResponseBuilder.created(groupFacade.registerGongbaek(userId, dto)); + return ResponseBuilder.created(groupFacade.registerGroup(userId, dto)); } @GetMapping("/fill/members") public ResponseEntity> getGroupMembers( - @RequestHeader("Authorization") String token, @RequestBody ReadFillMembersRequest dto) { + @RequestHeader("Authorization") String token, + @RequestBody ReadFillMembersRequest dto + ) { Long userId = jwtService.parseTokenAndGetUserId(token); return ResponseBuilder.ok(groupFacade.getGroupUsersInfo(userId, dto)); } diff --git a/src/main/java/com/ggang/be/api/group/dto/ActiveGroupsResponse.java b/src/main/java/com/ggang/be/api/group/dto/ActiveGroupsResponse.java index 84fecd2..3788f1f 100644 --- a/src/main/java/com/ggang/be/api/group/dto/ActiveGroupsResponse.java +++ b/src/main/java/com/ggang/be/api/group/dto/ActiveGroupsResponse.java @@ -15,7 +15,7 @@ public record ActiveGroupsResponse( GroupType groupType, String groupTitle, WeekDate weekDate, - LocalDate gropuDate, + LocalDate groupDate, double startTime, double endTime, String location diff --git a/src/main/java/com/ggang/be/api/group/dto/CombinedGroupVos.java b/src/main/java/com/ggang/be/api/group/dto/CombinedGroupVos.java index f4a5117..5e06440 100644 --- a/src/main/java/com/ggang/be/api/group/dto/CombinedGroupVos.java +++ b/src/main/java/com/ggang/be/api/group/dto/CombinedGroupVos.java @@ -2,6 +2,7 @@ import com.ggang.be.domain.group.everyGroup.dto.EveryGroupVo; import com.ggang.be.domain.group.onceGroup.dto.OnceGroupVo; + import java.util.List; public record CombinedGroupVos( diff --git a/src/main/java/com/ggang/be/api/group/dto/MyGroupResponse.java b/src/main/java/com/ggang/be/api/group/dto/MyGroupResponse.java index 904a663..04beefc 100644 --- a/src/main/java/com/ggang/be/api/group/dto/MyGroupResponse.java +++ b/src/main/java/com/ggang/be/api/group/dto/MyGroupResponse.java @@ -8,9 +8,10 @@ import java.time.LocalDate; -public record MyGroupResponse(long groupId, Status status, Category category, int coverImg, GroupType groupType, - String groupTitle, WeekDate weekDay, LocalDate weekDate, double startTime, double endTime, String location) { - +public record MyGroupResponse( + long groupId, Status status, Category category, int coverImg, GroupType groupType, + String groupTitle, WeekDate weekDay, LocalDate weekDate, double startTime, double endTime, String location +) { public static MyGroupResponse fromGroupVo(GroupVo groupVo) { return new MyGroupResponse( groupVo.groupId(), diff --git a/src/main/java/com/ggang/be/api/group/dto/NearestGroupResponse.java b/src/main/java/com/ggang/be/api/group/dto/NearestGroupResponse.java index a60786d..68ef2ff 100644 --- a/src/main/java/com/ggang/be/api/group/dto/NearestGroupResponse.java +++ b/src/main/java/com/ggang/be/api/group/dto/NearestGroupResponse.java @@ -1,7 +1,7 @@ package com.ggang.be.api.group.dto; -import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.Category; +import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.WeekDate; public record NearestGroupResponse( diff --git a/src/main/java/com/ggang/be/api/group/dto/PrepareRegisterInfo.java b/src/main/java/com/ggang/be/api/group/dto/PrepareRegisterInfo.java index c39879d..c2a34a9 100644 --- a/src/main/java/com/ggang/be/api/group/dto/PrepareRegisterInfo.java +++ b/src/main/java/com/ggang/be/api/group/dto/PrepareRegisterInfo.java @@ -4,12 +4,15 @@ import com.ggang.be.domain.timslot.gongbaekTimeSlot.GongbaekTimeSlotEntity; import com.ggang.be.domain.user.UserEntity; -public record PrepareRegisterInfo(UserEntity findUserEntity, - GongbaekTimeSlotEntity gongbaekTimeSlotEntity, - RegisterGroupServiceRequest request) { - - public static PrepareRegisterInfo of(UserEntity findUserEntity, GongbaekTimeSlotEntity gongbaekTimeSlotEntity, - RegisterGroupServiceRequest serviceRequest) { +public record PrepareRegisterInfo( + UserEntity findUserEntity, + GongbaekTimeSlotEntity gongbaekTimeSlotEntity, + RegisterGroupServiceRequest request +) { + public static PrepareRegisterInfo of( + UserEntity findUserEntity, GongbaekTimeSlotEntity gongbaekTimeSlotEntity, + RegisterGroupServiceRequest serviceRequest + ) { return new PrepareRegisterInfo(findUserEntity, gongbaekTimeSlotEntity, serviceRequest); } } diff --git a/src/main/java/com/ggang/be/api/group/dto/ReadFillMembersResponse.java b/src/main/java/com/ggang/be/api/group/dto/ReadFillMembersResponse.java index a53176e..a128847 100644 --- a/src/main/java/com/ggang/be/api/group/dto/ReadFillMembersResponse.java +++ b/src/main/java/com/ggang/be/api/group/dto/ReadFillMembersResponse.java @@ -6,16 +6,26 @@ import java.util.List; -public record ReadFillMembersResponse(int maxPeopleCount, int currentPeopleCount, List members) { - public static ReadFillMembersResponse ofEveryGroup(EveryGroupEntity findEveryGroupEntity, - List everyGroupUsersInfos) { - return new ReadFillMembersResponse(findEveryGroupEntity.getMaxPeopleCount(), - findEveryGroupEntity.getCurrentPeopleCount(), everyGroupUsersInfos); +public record ReadFillMembersResponse( + int maxPeopleCount, int currentPeopleCount, List members +) { + public static ReadFillMembersResponse ofEveryGroup( + EveryGroupEntity findEveryGroupEntity, List everyGroupUsersInfos + ) { + return new ReadFillMembersResponse( + findEveryGroupEntity.getMaxPeopleCount(), + findEveryGroupEntity.getCurrentPeopleCount(), + everyGroupUsersInfos + ); } - public static ReadFillMembersResponse ofOnceGroup(OnceGroupEntity findOnceGroupEntity, - List everyGroupUsersInfos) { - return new ReadFillMembersResponse(findOnceGroupEntity.getMaxPeopleCount(), - findOnceGroupEntity.getCurrentPeopleCount(), everyGroupUsersInfos); + public static ReadFillMembersResponse ofOnceGroup( + OnceGroupEntity findOnceGroupEntity, List everyGroupUsersInfos + ) { + return new ReadFillMembersResponse( + findOnceGroupEntity.getMaxPeopleCount(), + findOnceGroupEntity.getCurrentPeopleCount(), + everyGroupUsersInfos + ); } } diff --git a/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekRequest.java b/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekRequest.java index b7648f6..d624011 100644 --- a/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekRequest.java +++ b/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekRequest.java @@ -13,77 +13,78 @@ import java.util.Objects; public record RegisterGongbaekRequest( - GroupType groupType, - @DateTimeFormat(pattern = "yyyy-MM-dd") - LocalDate weekDate, - WeekDate weekDay, - double startTime, - double endTime, - @DateTimeFormat(pattern = "yyyy-MM-dd") - LocalDate dueDate, - Category category, - int coverImg, - String location, - int maxPeopleCount, - String groupTitle, - String introduction + GroupType groupType, + @DateTimeFormat(pattern = "yyyy-MM-dd") + LocalDate weekDate, + WeekDate weekDay, + double startTime, + double endTime, + @DateTimeFormat(pattern = "yyyy-MM-dd") + LocalDate dueDate, + Category category, + int coverImg, + String location, + int maxPeopleCount, + String groupTitle, + String introduction ) { - public static LectureTimeSlotRequest toLectureTimeSlotRequest(UserEntity userEntity, - RegisterGongbaekRequest request) { + public static LectureTimeSlotRequest toLectureTimeSlotRequest( + UserEntity userEntity, RegisterGongbaekRequest request + ) { if (Objects.isNull(request.weekDay)) return LectureTimeSlotRequest.of( - userEntity, - request.startTime(), - request.endTime(), - WeekDate.fromDayOfWeek(request.weekDate().getDayOfWeek()) + userEntity, + request.startTime(), + request.endTime(), + WeekDate.fromDayOfWeek(request.weekDate().getDayOfWeek()) ); else return LectureTimeSlotRequest.of( - userEntity, - request.startTime(), - request.endTime(), - request.weekDay() + userEntity, + request.startTime(), + request.endTime(), + request.weekDay() ); } - public static GongbaekTimeSlotRequest toGongbaekTimeSlotRequest(UserEntity userEntity, - RegisterGongbaekRequest request) { + public static GongbaekTimeSlotRequest toGongbaekTimeSlotRequest( + UserEntity userEntity, RegisterGongbaekRequest request + ) { if (Objects.isNull(request.weekDay)) { return new GongbaekTimeSlotRequest( - userEntity, - request.startTime(), - request.endTime(), - WeekDate.fromDayOfWeek(request.weekDate().getDayOfWeek()) + userEntity, + request.startTime(), + request.endTime(), + WeekDate.fromDayOfWeek(request.weekDate().getDayOfWeek()) ); } else { return new GongbaekTimeSlotRequest( - userEntity, - request.startTime(), - request.endTime(), - request.weekDay + userEntity, + request.startTime(), + request.endTime(), + request.weekDay ); } - - } - public static RegisterGroupServiceRequest toServiceRequest(UserEntity userEntity, - RegisterGongbaekRequest request) { + public static RegisterGroupServiceRequest toServiceRequest( + UserEntity userEntity, RegisterGongbaekRequest request + ) { return new RegisterGroupServiceRequest( - userEntity, - request.groupType(), - request.weekDate(), - request.weekDay(), - request.startTime(), - request.endTime(), - request.dueDate(), - request.category(), - request.coverImg(), - request.location(), - request.maxPeopleCount(), - request.groupTitle(), - request.introduction() + userEntity, + request.groupType(), + request.weekDate(), + request.weekDay(), + request.startTime(), + request.endTime(), + request.dueDate(), + request.category(), + request.coverImg(), + request.location(), + request.maxPeopleCount(), + request.groupTitle(), + request.introduction() ); } } diff --git a/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekResponse.java b/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekResponse.java deleted file mode 100644 index dc8ec3c..0000000 --- a/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekResponse.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.ggang.be.api.group.dto; - -public record RegisterGongbaekResponse(Long groupId) { - public static RegisterGongbaekResponse of(Long groupId) { - return new RegisterGongbaekResponse(groupId); - } - -} diff --git a/src/main/java/com/ggang/be/api/group/dto/RegisterGroupResponse.java b/src/main/java/com/ggang/be/api/group/dto/RegisterGroupResponse.java new file mode 100644 index 0000000..e110d82 --- /dev/null +++ b/src/main/java/com/ggang/be/api/group/dto/RegisterGroupResponse.java @@ -0,0 +1,8 @@ +package com.ggang.be.api.group.dto; + +public record RegisterGroupResponse(Long groupId) { + public static RegisterGroupResponse of(Long groupId) { + return new RegisterGroupResponse(groupId); + } + +} diff --git a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupInfoStrategy.java b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupInfoStrategy.java index 1f29479..cfe82e1 100644 --- a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupInfoStrategy.java +++ b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupInfoStrategy.java @@ -19,7 +19,7 @@ public class EveryGroupInfoStrategy implements GroupInfoStrategy { private final SameSchoolValidator sameSchoolValidator; @Override - public boolean supports(GroupType groupType) { + public boolean support(GroupType groupType) { return groupType == GroupType.WEEKLY; } diff --git a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupReadFillMemberStrategy.java b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupReadFillMemberStrategy.java index 2baced9..97737ac 100644 --- a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupReadFillMemberStrategy.java +++ b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupReadFillMemberStrategy.java @@ -1,9 +1,9 @@ package com.ggang.be.api.group.everyGroup.strategy; -import com.ggang.be.api.group.registry.ReadFillMemberStrategy; import com.ggang.be.api.group.dto.ReadFillMembersRequest; import com.ggang.be.api.group.dto.ReadFillMembersResponse; import com.ggang.be.api.group.everyGroup.service.EveryGroupService; +import com.ggang.be.api.group.registry.ReadFillMemberStrategy; import com.ggang.be.api.userEveryGroup.service.UserEveryGroupService; import com.ggang.be.domain.common.SameSchoolValidator; import com.ggang.be.domain.constant.GroupType; @@ -11,9 +11,10 @@ import com.ggang.be.domain.user.UserEntity; import com.ggang.be.domain.userEveryGroup.dto.FillMember; import com.ggang.be.global.annotation.Strategy; -import java.util.List; import lombok.RequiredArgsConstructor; +import java.util.List; + @Strategy @RequiredArgsConstructor @@ -30,8 +31,8 @@ public boolean support(GroupType groupType) { @Override public ReadFillMembersResponse getGroupUsersInfo(UserEntity findUserEntity, ReadFillMembersRequest dto) { - EveryGroupEntity findEveryGroupEntity = everyGroupService.findEveryGroupEntityByGroupId( - dto.groupId()); + EveryGroupEntity findEveryGroupEntity + = everyGroupService.findEveryGroupEntityByGroupId(dto.groupId()); userEveryGroupService.isUserInGroup(findUserEntity, findEveryGroupEntity); sameSchoolValidator.isUserReadMySchoolEveryGroup(findUserEntity, findEveryGroupEntity); diff --git a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupUserInfoStrategy.java b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupUserInfoStrategy.java index 24e9e28..b02f070 100644 --- a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupUserInfoStrategy.java +++ b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryGroupUserInfoStrategy.java @@ -13,7 +13,7 @@ public class EveryGroupUserInfoStrategy implements GroupUserInfoStrategy { private final EveryGroupService everyGroupService; @Override - public boolean supports(GroupType groupType) { + public boolean support(GroupType groupType) { return groupType == GroupType.WEEKLY; } diff --git a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryLatestGroupStrategy.java b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryLatestGroupStrategy.java index a903f0d..bedaef2 100644 --- a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryLatestGroupStrategy.java +++ b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/EveryLatestGroupStrategy.java @@ -20,7 +20,7 @@ public class EveryLatestGroupStrategy implements LatestGroupStrategy { private final EveryGroupService everyGroupService; @Override - public boolean supports(GroupType groupType) { + public boolean support(GroupType groupType) { return groupType == GroupType.WEEKLY; } diff --git a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/RegisterEveryGroupStrategy.java b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/RegisterEveryGroupStrategy.java index 54ac9ab..f391ab3 100644 --- a/src/main/java/com/ggang/be/api/group/everyGroup/strategy/RegisterEveryGroupStrategy.java +++ b/src/main/java/com/ggang/be/api/group/everyGroup/strategy/RegisterEveryGroupStrategy.java @@ -1,7 +1,7 @@ package com.ggang.be.api.group.everyGroup.strategy; import com.ggang.be.api.group.dto.PrepareRegisterInfo; -import com.ggang.be.api.group.dto.RegisterGongbaekResponse; +import com.ggang.be.api.group.dto.RegisterGroupResponse; import com.ggang.be.api.group.everyGroup.service.EveryGroupService; import com.ggang.be.api.group.registry.RegisterGroupStrategy; import com.ggang.be.api.userEveryGroup.service.UserEveryGroupService; @@ -20,25 +20,21 @@ public class RegisterEveryGroupStrategy implements RegisterGroupStrategy { private final EveryGroupService everyGroupService; private final UserEveryGroupService userEveryGroupService; - @Override public boolean support(GroupType groupType) { return groupType.equals(GroupType.WEEKLY); } @Override - public RegisterGongbaekResponse registerGroup(PrepareRegisterInfo prepareRegisterInfo) { + public RegisterGroupResponse registerGroup(PrepareRegisterInfo prepareRegisterInfo) { UserEntity findUserEntity = prepareRegisterInfo.findUserEntity(); RegisterGroupServiceRequest serviceRequest = prepareRegisterInfo.request(); GongbaekTimeSlotEntity gongbaekTimeSlotEntity = prepareRegisterInfo.gongbaekTimeSlotEntity(); - - EveryGroupEntity everyGroupEntity = everyGroupService.registerEveryGroup(serviceRequest, - gongbaekTimeSlotEntity); + EveryGroupEntity everyGroupEntity + = everyGroupService.registerEveryGroup(serviceRequest, gongbaekTimeSlotEntity); userEveryGroupService.applyEveryGroup(findUserEntity, everyGroupEntity); - return RegisterGongbaekResponse.of( + return RegisterGroupResponse.of( everyGroupEntity.getId()); } - - } diff --git a/src/main/java/com/ggang/be/api/group/facade/GroupFacade.java b/src/main/java/com/ggang/be/api/group/facade/GroupFacade.java index 623a8d0..a688be5 100644 --- a/src/main/java/com/ggang/be/api/group/facade/GroupFacade.java +++ b/src/main/java/com/ggang/be/api/group/facade/GroupFacade.java @@ -1,6 +1,6 @@ package com.ggang.be.api.group.facade; -import com.ggang.be.api.group.ActivceCombinedGroupVoPreparer; +import com.ggang.be.api.group.ActiveCombinedGroupVoPreparer; import com.ggang.be.api.group.GroupVoAggregator; import com.ggang.be.api.group.dto.*; import com.ggang.be.api.group.registry.*; @@ -17,13 +17,14 @@ import com.ggang.be.domain.userEveryGroup.dto.NearestEveryGroup; import com.ggang.be.domain.userOnceGroup.dto.NearestOnceGroup; import com.ggang.be.global.annotation.Facade; -import java.time.LocalDate; -import java.util.List; -import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDate; +import java.util.List; +import java.util.stream.Collectors; + @Facade @RequiredArgsConstructor @@ -42,12 +43,11 @@ public class GroupFacade { private final PrepareRegisterGongbaekFacade prepareRegisterGongbaekFacade; private final CancelGroupStrategyRegistry cancelGroupStrategyRegistry; private final GroupUserInfoStrategyRegistry groupUserInfoStrategyRegistry; - private final ActivceCombinedGroupVoPreparer activceCombinedGroupVoPreparer; + private final ActiveCombinedGroupVoPreparer activeCombinedGroupVoPreparer; private final MyGroupStrategyRegistry myGroupStrategyRegistry; public GroupResponse getGroupInfo(GroupType groupType, Long groupId, long userId) { UserEntity currentUser = userService.getUserById(userId); - GroupInfoStrategy groupInfoStrategy = groupInfoStrategyRegistry.getGroupInfo(groupType); return groupInfoStrategy.getGroupInfo(groupId, currentUser); @@ -73,21 +73,20 @@ public NearestGroupResponse getNearestGroupInfo(long userId) { } public UserInfo getGroupUserInfo(GroupType groupType, Long groupId) { - GroupUserInfoStrategy groupUserInfoStrategy = groupUserInfoStrategyRegistry.getGroupUserInfo( - groupType); + GroupUserInfoStrategy groupUserInfoStrategy + = groupUserInfoStrategyRegistry.getGroupUserInfo(groupType); return UserInfo.of( userService.getUserById(groupUserInfoStrategy.getGroupUserInfo(groupId))); } @Transactional - public RegisterGongbaekResponse registerGongbaek(Long userId, RegisterGongbaekRequest dto) { + public RegisterGroupResponse registerGroup(Long userId, RegisterGongbaekRequest dto) { - PrepareRegisterInfo prepareRegisterInfo = prepareRegisterGongbaekFacade.prepareInfo(userId, - dto); + PrepareRegisterInfo prepareRegisterInfo = prepareRegisterGongbaekFacade.prepareInfo(userId, dto); - RegisterGroupStrategy registerGroupStrategy = registerGroupStrategyRegistry.getRegisterGroupStrategy( - dto.groupType()); + RegisterGroupStrategy registerGroupStrategy + = registerGroupStrategyRegistry.getRegisterGroupStrategy(dto.groupType()); return registerGroupStrategy.registerGroup(prepareRegisterInfo); } @@ -128,7 +127,7 @@ public List getMyGroups(long userId, FillGroupFilterRequest fil public List getFillGroups(long userId, Category category) { UserEntity currentUser = userService.getUserById(userId); - CombinedGroupVos preparedGroupVo = activceCombinedGroupVoPreparer.prepareGroupVos( + CombinedGroupVos preparedGroupVo = activeCombinedGroupVoPreparer.prepareGroupVos( currentUser, category); List groupVos = GroupVoAggregator.aggregateAndSort( @@ -157,8 +156,6 @@ public List getLatestGroups(long userId, GroupType groupTy .collect(Collectors.toList()); } - - private NearestGroupResponse getNearestGroupFromDates(NearestEveryGroup nearestEveryGroup, NearestOnceGroup nearestOnceGroup) { LocalDate everyGroupDate = nearestEveryGroup.weekDate(); diff --git a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupInfoStrategy.java b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupInfoStrategy.java index 842aa0d..1acdf21 100644 --- a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupInfoStrategy.java +++ b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupInfoStrategy.java @@ -19,7 +19,7 @@ public class OnceGroupInfoStrategy implements GroupInfoStrategy { private final SameSchoolValidator sameSchoolValidator; @Override - public boolean supports(GroupType groupType) { + public boolean support(GroupType groupType) { return groupType == GroupType.ONCE; } diff --git a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupReadFillMemberStrategy.java b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupReadFillMemberStrategy.java index 5e8e82c..6415bbd 100644 --- a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupReadFillMemberStrategy.java +++ b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupReadFillMemberStrategy.java @@ -40,6 +40,4 @@ public ReadFillMembersResponse getGroupUsersInfo(UserEntity findUserEntity, Read ReadFillMembersRequest.toOnceGroupMemberInfo(findOnceGroupEntity)); return ReadFillMembersResponse.ofOnceGroup(findOnceGroupEntity, everyGroupUsersInfos); } - - } diff --git a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupUserInfoStrategy.java b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupUserInfoStrategy.java index 0452037..522a499 100644 --- a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupUserInfoStrategy.java +++ b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceGroupUserInfoStrategy.java @@ -13,7 +13,7 @@ public class OnceGroupUserInfoStrategy implements GroupUserInfoStrategy { private final OnceGroupService onceGroupService; @Override - public boolean supports(GroupType groupType) { + public boolean support(GroupType groupType) { return groupType == GroupType.ONCE; } diff --git a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceLatestGroupStrategy.java b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceLatestGroupStrategy.java index 4f469db..24d9b50 100644 --- a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceLatestGroupStrategy.java +++ b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/OnceLatestGroupStrategy.java @@ -20,7 +20,7 @@ public class OnceLatestGroupStrategy implements LatestGroupStrategy { private final OnceGroupService onceGroupService; @Override - public boolean supports(GroupType groupType) { + public boolean support(GroupType groupType) { return groupType == GroupType.ONCE; } diff --git a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/RegisterOnceGroupStrategy.java b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/RegisterOnceGroupStrategy.java index 3c59e88..050ee44 100644 --- a/src/main/java/com/ggang/be/api/group/onceGroup/strategy/RegisterOnceGroupStrategy.java +++ b/src/main/java/com/ggang/be/api/group/onceGroup/strategy/RegisterOnceGroupStrategy.java @@ -1,7 +1,7 @@ package com.ggang.be.api.group.onceGroup.strategy; import com.ggang.be.api.group.dto.PrepareRegisterInfo; -import com.ggang.be.api.group.dto.RegisterGongbaekResponse; +import com.ggang.be.api.group.dto.RegisterGroupResponse; import com.ggang.be.api.group.onceGroup.service.OnceGroupService; import com.ggang.be.api.group.registry.RegisterGroupStrategy; import com.ggang.be.api.userOnceGroup.service.UserOnceGroupService; @@ -26,7 +26,7 @@ public boolean support(GroupType groupType) { } @Override - public RegisterGongbaekResponse registerGroup(PrepareRegisterInfo prepareRegisterInfo) { + public RegisterGroupResponse registerGroup(PrepareRegisterInfo prepareRegisterInfo) { UserEntity findUserEntity = prepareRegisterInfo.findUserEntity(); RegisterGroupServiceRequest serviceRequest = prepareRegisterInfo.request(); GongbaekTimeSlotEntity gongbaekTimeSlotEntity = prepareRegisterInfo.gongbaekTimeSlotEntity(); @@ -34,8 +34,6 @@ public RegisterGongbaekResponse registerGroup(PrepareRegisterInfo prepareRegiste OnceGroupEntity onceGroupEntity = onceGroupService.registerOnceGroup(serviceRequest, gongbaekTimeSlotEntity); userOnceGroupService.applyOnceGroup(findUserEntity, onceGroupEntity); - return RegisterGongbaekResponse.of(onceGroupEntity.getId()); + return RegisterGroupResponse.of(onceGroupEntity.getId()); } - - } diff --git a/src/main/java/com/ggang/be/api/group/registry/ApplyGroupStrategyRegistry.java b/src/main/java/com/ggang/be/api/group/registry/ApplyGroupStrategyRegistry.java index ef53a26..cb635ee 100644 --- a/src/main/java/com/ggang/be/api/group/registry/ApplyGroupStrategyRegistry.java +++ b/src/main/java/com/ggang/be/api/group/registry/ApplyGroupStrategyRegistry.java @@ -4,24 +4,20 @@ import com.ggang.be.api.exception.GongBaekException; import com.ggang.be.domain.constant.GroupType; import com.ggang.be.global.annotation.Registry; -import java.util.List; import lombok.RequiredArgsConstructor; +import java.util.List; + @Registry @RequiredArgsConstructor public class ApplyGroupStrategyRegistry { private final List applyGroupStrategies; - public ApplyGroupStrategy getApplyGroupStrategy(GroupType groupType){ return applyGroupStrategies.stream() .filter(applyGroupStrategy -> applyGroupStrategy.support(groupType)) .findFirst() .orElseThrow(() -> new GongBaekException(ResponseError.BAD_REQUEST)); } - - - - } diff --git a/src/main/java/com/ggang/be/api/group/registry/CancelGroupStrategyRegistry.java b/src/main/java/com/ggang/be/api/group/registry/CancelGroupStrategyRegistry.java index e615f38..dc3bad1 100644 --- a/src/main/java/com/ggang/be/api/group/registry/CancelGroupStrategyRegistry.java +++ b/src/main/java/com/ggang/be/api/group/registry/CancelGroupStrategyRegistry.java @@ -19,5 +19,4 @@ public CancelGroupStrategy getCancelGroupStrategy(GroupType groupType){ .findFirst() .orElseThrow(() -> new GongBaekException(ResponseError.BAD_REQUEST)); } - } diff --git a/src/main/java/com/ggang/be/api/group/registry/GroupInfoStrategy.java b/src/main/java/com/ggang/be/api/group/registry/GroupInfoStrategy.java index 889dc3a..854eb61 100644 --- a/src/main/java/com/ggang/be/api/group/registry/GroupInfoStrategy.java +++ b/src/main/java/com/ggang/be/api/group/registry/GroupInfoStrategy.java @@ -5,7 +5,7 @@ import com.ggang.be.domain.user.UserEntity; public interface GroupInfoStrategy { - boolean supports(GroupType groupType); + boolean support(GroupType groupType); GroupResponse getGroupInfo(Long groupId, UserEntity userEntity); } diff --git a/src/main/java/com/ggang/be/api/group/registry/GroupInfoStrategyRegistry.java b/src/main/java/com/ggang/be/api/group/registry/GroupInfoStrategyRegistry.java index 6a22200..b75440c 100644 --- a/src/main/java/com/ggang/be/api/group/registry/GroupInfoStrategyRegistry.java +++ b/src/main/java/com/ggang/be/api/group/registry/GroupInfoStrategyRegistry.java @@ -16,7 +16,7 @@ public class GroupInfoStrategyRegistry { public GroupInfoStrategy getGroupInfo(GroupType groupType) { return groupStrategies.stream() - .filter(strategy -> strategy.supports(groupType)) + .filter(strategy -> strategy.support(groupType)) .findFirst() .orElseThrow(() -> new GongBaekException(ResponseError.BAD_REQUEST)); } diff --git a/src/main/java/com/ggang/be/api/group/registry/GroupUserInfoStrategy.java b/src/main/java/com/ggang/be/api/group/registry/GroupUserInfoStrategy.java index 2cd4fe2..d5ac4f4 100644 --- a/src/main/java/com/ggang/be/api/group/registry/GroupUserInfoStrategy.java +++ b/src/main/java/com/ggang/be/api/group/registry/GroupUserInfoStrategy.java @@ -3,7 +3,7 @@ import com.ggang.be.domain.constant.GroupType; public interface GroupUserInfoStrategy { - boolean supports(GroupType groupType); + boolean support(GroupType groupType); long getGroupUserInfo(long groupId); } \ No newline at end of file diff --git a/src/main/java/com/ggang/be/api/group/registry/GroupUserInfoStrategyRegistry.java b/src/main/java/com/ggang/be/api/group/registry/GroupUserInfoStrategyRegistry.java index 2b1318b..9f634cf 100644 --- a/src/main/java/com/ggang/be/api/group/registry/GroupUserInfoStrategyRegistry.java +++ b/src/main/java/com/ggang/be/api/group/registry/GroupUserInfoStrategyRegistry.java @@ -16,7 +16,7 @@ public class GroupUserInfoStrategyRegistry { public GroupUserInfoStrategy getGroupUserInfo(GroupType groupType) { return groupUserInfoStrategies.stream() - .filter(strategy -> strategy.supports(groupType)) + .filter(strategy -> strategy.support(groupType)) .findFirst() .orElseThrow(() -> new GongBaekException(ResponseError.BAD_REQUEST)); } diff --git a/src/main/java/com/ggang/be/api/group/registry/LatestGroupStrategy.java b/src/main/java/com/ggang/be/api/group/registry/LatestGroupStrategy.java index bcb0350..abd3885 100644 --- a/src/main/java/com/ggang/be/api/group/registry/LatestGroupStrategy.java +++ b/src/main/java/com/ggang/be/api/group/registry/LatestGroupStrategy.java @@ -7,7 +7,7 @@ import java.util.List; public interface LatestGroupStrategy { - boolean supports(GroupType groupType); + boolean support(GroupType groupType); List getLatestGroups(UserEntity userEntity); } diff --git a/src/main/java/com/ggang/be/api/group/registry/LatestGroupStrategyRegistry.java b/src/main/java/com/ggang/be/api/group/registry/LatestGroupStrategyRegistry.java index d03fa37..2a17eea 100644 --- a/src/main/java/com/ggang/be/api/group/registry/LatestGroupStrategyRegistry.java +++ b/src/main/java/com/ggang/be/api/group/registry/LatestGroupStrategyRegistry.java @@ -16,7 +16,7 @@ public class LatestGroupStrategyRegistry { public LatestGroupStrategy getGroupStrategy(GroupType groupType) { return groupStrategies.stream() - .filter(strategy -> strategy.supports(groupType)) + .filter(strategy -> strategy.support(groupType)) .findFirst() .orElseThrow(() -> new GongBaekException(ResponseError.BAD_REQUEST)); } diff --git a/src/main/java/com/ggang/be/api/group/registry/MyGroupStrategy.java b/src/main/java/com/ggang/be/api/group/registry/MyGroupStrategy.java index 1873044..6150993 100644 --- a/src/main/java/com/ggang/be/api/group/registry/MyGroupStrategy.java +++ b/src/main/java/com/ggang/be/api/group/registry/MyGroupStrategy.java @@ -7,7 +7,7 @@ import java.util.List; public interface MyGroupStrategy { - boolean supports(FillGroupType category); + boolean support(FillGroupType category); List getGroups(UserEntity userEntity, boolean status); } diff --git a/src/main/java/com/ggang/be/api/group/registry/MyGroupStrategyRegistry.java b/src/main/java/com/ggang/be/api/group/registry/MyGroupStrategyRegistry.java index 5df950e..6aa7a70 100644 --- a/src/main/java/com/ggang/be/api/group/registry/MyGroupStrategyRegistry.java +++ b/src/main/java/com/ggang/be/api/group/registry/MyGroupStrategyRegistry.java @@ -16,7 +16,7 @@ public class MyGroupStrategyRegistry { public MyGroupStrategy getGroupStrategy(FillGroupType category) { return groupStrategies.stream() - .filter(strategy -> strategy.supports(category)) + .filter(strategy -> strategy.support(category)) .findFirst() .orElseThrow(() -> new GongBaekException(ResponseError.BAD_REQUEST)); } diff --git a/src/main/java/com/ggang/be/api/group/registry/ReadFillMemberStrategyRegistry.java b/src/main/java/com/ggang/be/api/group/registry/ReadFillMemberStrategyRegistry.java index 9955975..96e33b5 100644 --- a/src/main/java/com/ggang/be/api/group/registry/ReadFillMemberStrategyRegistry.java +++ b/src/main/java/com/ggang/be/api/group/registry/ReadFillMemberStrategyRegistry.java @@ -4,16 +4,16 @@ import com.ggang.be.api.exception.GongBaekException; import com.ggang.be.domain.constant.GroupType; import com.ggang.be.global.annotation.Registry; -import java.util.List; import lombok.RequiredArgsConstructor; +import java.util.List; + @Registry @RequiredArgsConstructor public class ReadFillMemberStrategyRegistry { private final List strategies; - public ReadFillMemberStrategy getStrategy(GroupType groupType){ return strategies.stream() .filter(strategy -> strategy.support(groupType)) diff --git a/src/main/java/com/ggang/be/api/group/registry/RegisterGroupStrategy.java b/src/main/java/com/ggang/be/api/group/registry/RegisterGroupStrategy.java index df56b4f..439293b 100644 --- a/src/main/java/com/ggang/be/api/group/registry/RegisterGroupStrategy.java +++ b/src/main/java/com/ggang/be/api/group/registry/RegisterGroupStrategy.java @@ -1,12 +1,12 @@ package com.ggang.be.api.group.registry; import com.ggang.be.api.group.dto.PrepareRegisterInfo; -import com.ggang.be.api.group.dto.RegisterGongbaekResponse; +import com.ggang.be.api.group.dto.RegisterGroupResponse; import com.ggang.be.domain.constant.GroupType; public interface RegisterGroupStrategy { boolean support(GroupType groupType); - RegisterGongbaekResponse registerGroup(PrepareRegisterInfo prepareRegisterInfo); + RegisterGroupResponse registerGroup(PrepareRegisterInfo prepareRegisterInfo); } diff --git a/src/main/java/com/ggang/be/api/group/registry/RegisterGroupStrategyRegistry.java b/src/main/java/com/ggang/be/api/group/registry/RegisterGroupStrategyRegistry.java index 6926a90..86100d1 100644 --- a/src/main/java/com/ggang/be/api/group/registry/RegisterGroupStrategyRegistry.java +++ b/src/main/java/com/ggang/be/api/group/registry/RegisterGroupStrategyRegistry.java @@ -4,9 +4,10 @@ import com.ggang.be.api.exception.GongBaekException; import com.ggang.be.domain.constant.GroupType; import com.ggang.be.global.annotation.Registry; -import java.util.List; import lombok.RequiredArgsConstructor; +import java.util.List; + @Registry @RequiredArgsConstructor public class RegisterGroupStrategyRegistry { diff --git a/src/main/java/com/ggang/be/api/group/strategy/MyApplyGroupStrategy.java b/src/main/java/com/ggang/be/api/group/strategy/MyApplyGroupStrategy.java index 348d9cf..4d75460 100644 --- a/src/main/java/com/ggang/be/api/group/strategy/MyApplyGroupStrategy.java +++ b/src/main/java/com/ggang/be/api/group/strategy/MyApplyGroupStrategy.java @@ -22,7 +22,7 @@ public class MyApplyGroupStrategy implements MyGroupStrategy { private final UserOnceGroupService userOnceGroupService; @Override - public boolean supports(FillGroupType category) { + public boolean support(FillGroupType category) { return category == FillGroupType.APPLY; } diff --git a/src/main/java/com/ggang/be/api/group/strategy/MyRegisterGroupStrategy.java b/src/main/java/com/ggang/be/api/group/strategy/MyRegisterGroupStrategy.java index 94e1f91..5688579 100644 --- a/src/main/java/com/ggang/be/api/group/strategy/MyRegisterGroupStrategy.java +++ b/src/main/java/com/ggang/be/api/group/strategy/MyRegisterGroupStrategy.java @@ -22,7 +22,7 @@ public class MyRegisterGroupStrategy implements MyGroupStrategy { private final OnceGroupService onceGroupService; @Override - public boolean supports(FillGroupType category) { + public boolean support(FillGroupType category) { return category == FillGroupType.REGISTER; } diff --git a/src/main/java/com/ggang/be/api/lectureTimeSlot/service/LectureTimeSlotService.java b/src/main/java/com/ggang/be/api/lectureTimeSlot/service/LectureTimeSlotService.java index df0a9e9..0d56456 100644 --- a/src/main/java/com/ggang/be/api/lectureTimeSlot/service/LectureTimeSlotService.java +++ b/src/main/java/com/ggang/be/api/lectureTimeSlot/service/LectureTimeSlotService.java @@ -1,6 +1,5 @@ package com.ggang.be.api.lectureTimeSlot.service; -import com.ggang.be.domain.constant.WeekDate; import com.ggang.be.domain.group.dto.GroupVo; import com.ggang.be.domain.timslot.lectureTimeSlot.LectureTimeSlotEntity; import com.ggang.be.domain.timslot.lectureTimeSlot.dto.LectureTimeSlotRequest; diff --git a/src/main/java/com/ggang/be/api/school/dto/SchoolSearchResponse.java b/src/main/java/com/ggang/be/api/school/dto/SchoolSearchResponse.java index cb71fe8..308eec1 100644 --- a/src/main/java/com/ggang/be/api/school/dto/SchoolSearchResponse.java +++ b/src/main/java/com/ggang/be/api/school/dto/SchoolSearchResponse.java @@ -1,7 +1,5 @@ package com.ggang.be.api.school.dto; -import com.ggang.be.domain.school.dto.SchoolSearchVo; - import java.util.List; public record SchoolSearchResponse(List schoolNames) { diff --git a/src/main/java/com/ggang/be/api/school/service/SchoolService.java b/src/main/java/com/ggang/be/api/school/service/SchoolService.java index 5533b37..6cacc1e 100644 --- a/src/main/java/com/ggang/be/api/school/service/SchoolService.java +++ b/src/main/java/com/ggang/be/api/school/service/SchoolService.java @@ -10,5 +10,5 @@ public interface SchoolService { School findSchoolByName(String schoolName); - SchoolEntity findSchoolEntityByName(String s); + SchoolEntity findSchoolEntityByName(String schoolName); } diff --git a/src/main/java/com/ggang/be/api/user/dto/ReissueResponse.java b/src/main/java/com/ggang/be/api/user/dto/ReissueResponse.java deleted file mode 100644 index 098bca9..0000000 --- a/src/main/java/com/ggang/be/api/user/dto/ReissueResponse.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.ggang.be.api.user.dto; - -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.ggang.be.global.jwt.TokenVo; - -public record ReissueResponse(@JsonUnwrapped TokenVo tokenVo) { - -} diff --git a/src/main/java/com/ggang/be/api/userOnceGroup/service/UserOnceGroupService.java b/src/main/java/com/ggang/be/api/userOnceGroup/service/UserOnceGroupService.java index 5e38116..0bb0321 100644 --- a/src/main/java/com/ggang/be/api/userOnceGroup/service/UserOnceGroupService.java +++ b/src/main/java/com/ggang/be/api/userOnceGroup/service/UserOnceGroupService.java @@ -5,7 +5,6 @@ import com.ggang.be.domain.group.onceGroup.dto.ReadOnceGroup; import com.ggang.be.domain.user.UserEntity; import com.ggang.be.domain.userEveryGroup.dto.FillMember; -import com.ggang.be.domain.userOnceGroup.UserOnceGroupEntity; import com.ggang.be.domain.userOnceGroup.dto.NearestOnceGroup; import java.util.List; @@ -17,8 +16,6 @@ public interface UserOnceGroupService { NearestOnceGroup getMyNearestOnceGroup(UserEntity currentUser); - List readUserTIme(UserEntity findUserEntity); - void applyOnceGroup(UserEntity currentUser, OnceGroupEntity onceGroupEntity); void cancelOnceGroup(UserEntity currentUser, OnceGroupEntity onceGroupEntity); diff --git a/src/main/java/com/ggang/be/domain/constant/GroupType.java b/src/main/java/com/ggang/be/domain/constant/GroupType.java index 5d6d8c9..b926d89 100644 --- a/src/main/java/com/ggang/be/domain/constant/GroupType.java +++ b/src/main/java/com/ggang/be/domain/constant/GroupType.java @@ -1,23 +1,6 @@ package com.ggang.be.domain.constant; -import com.ggang.be.api.common.ResponseError; -import com.ggang.be.api.exception.GongBaekException; - public enum GroupType { WEEKLY, ONCE; - - public static boolean isValid(String type) { - for (GroupType groupType : GroupType.values()) { - if (groupType.name().equalsIgnoreCase(type)) { - return true; - } - } - throw new GongBaekException(ResponseError.BAD_REQUEST); - } - - public static GroupType fromString(String type) { - isValid(type); - return GroupType.valueOf(type.toUpperCase()); - } } diff --git a/src/main/java/com/ggang/be/domain/constant/WeekDate.java b/src/main/java/com/ggang/be/domain/constant/WeekDate.java index 5d89a8b..c8f4a59 100644 --- a/src/main/java/com/ggang/be/domain/constant/WeekDate.java +++ b/src/main/java/com/ggang/be/domain/constant/WeekDate.java @@ -4,19 +4,13 @@ import java.time.LocalDate; public enum WeekDate { - MON("Monday"), - TUE("Tuesday"), - WED("Wednesday"), - THU("Thursday"), - FRI("Friday"), - SAT("Saturday"), - SUN("Sunday"); - - private final String fullName; - - WeekDate(String fullName) { - this.fullName = fullName; - } + MON, + TUE, + WED, + THU, + FRI, + SAT, + SUN; public static WeekDate fromDayOfWeek(DayOfWeek dayOfWeek) { return switch (dayOfWeek) { diff --git a/src/main/java/com/ggang/be/domain/group/IntroductionValidator.java b/src/main/java/com/ggang/be/domain/group/IntroductionValidator.java index 9ebc454..f35ae75 100644 --- a/src/main/java/com/ggang/be/domain/group/IntroductionValidator.java +++ b/src/main/java/com/ggang/be/domain/group/IntroductionValidator.java @@ -3,15 +3,12 @@ import com.ggang.be.api.common.ResponseError; import com.ggang.be.api.exception.GongBaekException; import com.ggang.be.global.util.LengthValidator; -import java.util.regex.Pattern; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @Component @Slf4j public class IntroductionValidator { - - public void isIntroductionValid(String introduction) { log.info("now value is : {}", introduction); if(!LengthValidator.rangelengthCheck(introduction, 20, 100)) { diff --git a/src/main/java/com/ggang/be/domain/group/LocationValidator.java b/src/main/java/com/ggang/be/domain/group/LocationValidator.java index ae4fb97..2c96d7f 100644 --- a/src/main/java/com/ggang/be/domain/group/LocationValidator.java +++ b/src/main/java/com/ggang/be/domain/group/LocationValidator.java @@ -3,10 +3,11 @@ import com.ggang.be.api.common.ResponseError; import com.ggang.be.api.exception.GongBaekException; import com.ggang.be.global.util.LengthValidator; -import java.util.regex.Pattern; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; +import java.util.regex.Pattern; + @Component @Slf4j public class LocationValidator { diff --git a/src/main/java/com/ggang/be/domain/group/TitleValidator.java b/src/main/java/com/ggang/be/domain/group/TitleValidator.java index b3006ff..2205e9d 100644 --- a/src/main/java/com/ggang/be/domain/group/TitleValidator.java +++ b/src/main/java/com/ggang/be/domain/group/TitleValidator.java @@ -10,7 +10,6 @@ @Slf4j public class TitleValidator { - public void isGroupTitleValid(final String title) { log.info("now value is : {}", title); if(title.contains("\n")) { diff --git a/src/main/java/com/ggang/be/domain/group/dto/ReadGroup.java b/src/main/java/com/ggang/be/domain/group/dto/ReadGroup.java deleted file mode 100644 index 9e933f3..0000000 --- a/src/main/java/com/ggang/be/domain/group/dto/ReadGroup.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.ggang.be.domain.group.dto; - -import java.util.List; - -public record ReadGroup(List groups) { - - public static ReadGroup of(List groups) { - return new ReadGroup(groups); - } -} diff --git a/src/main/java/com/ggang/be/domain/group/everyGroup/EveryGroupEntity.java b/src/main/java/com/ggang/be/domain/group/everyGroup/EveryGroupEntity.java index abdf7b4..e319512 100644 --- a/src/main/java/com/ggang/be/domain/group/everyGroup/EveryGroupEntity.java +++ b/src/main/java/com/ggang/be/domain/group/everyGroup/EveryGroupEntity.java @@ -12,12 +12,12 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import org.hibernate.annotations.DynamicUpdate; import java.time.LocalDate; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; -import org.hibernate.annotations.DynamicUpdate; @Getter @Entity(name = "every_group") @@ -123,6 +123,4 @@ private void checkCurrentStatus(long currentPeopleCount, long maxPeopleCount){ public void updateStatus(Status status) { this.status = status; } - - // TODO 동기화 작업 하기 } diff --git a/src/main/java/com/ggang/be/domain/group/everyGroup/application/EveryGroupServiceImpl.java b/src/main/java/com/ggang/be/domain/group/everyGroup/application/EveryGroupServiceImpl.java index d2e1d2f..2977098 100644 --- a/src/main/java/com/ggang/be/domain/group/everyGroup/application/EveryGroupServiceImpl.java +++ b/src/main/java/com/ggang/be/domain/group/everyGroup/application/EveryGroupServiceImpl.java @@ -5,7 +5,6 @@ import com.ggang.be.api.group.GroupStatusUpdater; import com.ggang.be.api.group.everyGroup.service.EveryGroupService; import com.ggang.be.domain.comment.CommentEntity; -import com.ggang.be.domain.common.SameSchoolValidator; import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.Status; import com.ggang.be.domain.group.GroupCommentVoMaker; @@ -38,7 +37,6 @@ public class EveryGroupServiceImpl implements EveryGroupService { private final EveryGroupRepository everyGroupRepository; private final GroupVoMaker groupVoMaker; private final GroupCommentVoMaker groupCommentVoMaker; - private final SameSchoolValidator sameSchoolValidator; private final GroupStatusUpdater groupStatusUpdater; @Override diff --git a/src/main/java/com/ggang/be/domain/group/everyGroup/infra/EveryGroupRepository.java b/src/main/java/com/ggang/be/domain/group/everyGroup/infra/EveryGroupRepository.java index 1d7521d..ac6ea27 100644 --- a/src/main/java/com/ggang/be/domain/group/everyGroup/infra/EveryGroupRepository.java +++ b/src/main/java/com/ggang/be/domain/group/everyGroup/infra/EveryGroupRepository.java @@ -15,8 +15,6 @@ public interface EveryGroupRepository extends JpaRepository { List findByUserEntity_Id(Long userEntityUserId); - List findByParticipantUsers_UserEntity_Id(Long userId); - @Query("SELECT CASE WHEN COUNT(o) > 0 THEN TRUE ELSE FALSE END " + "FROM every_group o " + "WHERE o.userEntity = :userEntity " + diff --git a/src/main/java/com/ggang/be/domain/group/everyGroup/vo/ReadEveryGroupCommentCommonVo.java b/src/main/java/com/ggang/be/domain/group/everyGroup/vo/ReadEveryGroupCommentCommonVo.java index cea7713..d635d5f 100644 --- a/src/main/java/com/ggang/be/domain/group/everyGroup/vo/ReadEveryGroupCommentCommonVo.java +++ b/src/main/java/com/ggang/be/domain/group/everyGroup/vo/ReadEveryGroupCommentCommonVo.java @@ -3,9 +3,7 @@ import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.Status; -public record ReadEveryGroupCommentCommonVo(int commentCount, long groupId, GroupType groupType, - Status status) { - +public record ReadEveryGroupCommentCommonVo(int commentCount, long groupId, GroupType groupType, Status status) { public static ReadEveryGroupCommentCommonVo of(int commentCount, long groupId, Status status) { return new ReadEveryGroupCommentCommonVo(commentCount, groupId, GroupType.WEEKLY, status); diff --git a/src/main/java/com/ggang/be/domain/group/onceGroup/OnceGroupEntity.java b/src/main/java/com/ggang/be/domain/group/onceGroup/OnceGroupEntity.java index bc8dc50..e0522c0 100644 --- a/src/main/java/com/ggang/be/domain/group/onceGroup/OnceGroupEntity.java +++ b/src/main/java/com/ggang/be/domain/group/onceGroup/OnceGroupEntity.java @@ -7,29 +7,18 @@ import com.ggang.be.domain.timslot.gongbaekTimeSlot.GongbaekTimeSlotEntity; import com.ggang.be.domain.user.UserEntity; import com.ggang.be.domain.userOnceGroup.UserOnceGroupEntity; -import jakarta.persistence.CascadeType; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.EnumType; -import jakarta.persistence.Enumerated; -import jakarta.persistence.FetchType; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.OneToMany; -import jakarta.persistence.OneToOne; -import java.time.LocalDate; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; +import jakarta.persistence.*; import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import org.hibernate.annotations.DynamicUpdate; +import java.time.LocalDate; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + @Getter @Entity(name = "once_group") @NoArgsConstructor(access = AccessLevel.PROTECTED) @@ -81,7 +70,6 @@ public class OnceGroupEntity extends BaseTimeEntity { @Column(nullable = false) private String title; - @Builder private OnceGroupEntity(String title, String introduction, int currentPeopleCount, int maxPeopleCount, Status status, String location, int coverImg, Category category, @@ -134,6 +122,4 @@ private void checkCurrentStatus(long currentPeopleCount, long maxPeopleCount){ public void updateStatus(Status status){ this.status=status; } - - // TODO 동기화 작업 하기 } diff --git a/src/main/java/com/ggang/be/domain/group/onceGroup/infra/OnceGroupRepository.java b/src/main/java/com/ggang/be/domain/group/onceGroup/infra/OnceGroupRepository.java index 443fb88..8f2ff68 100644 --- a/src/main/java/com/ggang/be/domain/group/onceGroup/infra/OnceGroupRepository.java +++ b/src/main/java/com/ggang/be/domain/group/onceGroup/infra/OnceGroupRepository.java @@ -15,8 +15,6 @@ public interface OnceGroupRepository extends JpaRepository { List findByUserEntity_Id(Long userEntityUserId); - List findByParticipantUsers_UserEntity_Id(Long userId); - @Query("SELECT CASE WHEN COUNT(o) > 0 THEN TRUE ELSE FALSE END " + "FROM once_group o " + "WHERE o.userEntity = :userEntity " + diff --git a/src/main/java/com/ggang/be/domain/group/onceGroup/vo/ReadOnceGroupCommentCommonVo.java b/src/main/java/com/ggang/be/domain/group/onceGroup/vo/ReadOnceGroupCommentCommonVo.java index 6e9e1f2..7aac32c 100644 --- a/src/main/java/com/ggang/be/domain/group/onceGroup/vo/ReadOnceGroupCommentCommonVo.java +++ b/src/main/java/com/ggang/be/domain/group/onceGroup/vo/ReadOnceGroupCommentCommonVo.java @@ -3,8 +3,7 @@ import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.Status; -public record ReadOnceGroupCommentCommonVo(int commentCount, long groupId, GroupType groupType, - Status status) { +public record ReadOnceGroupCommentCommonVo(int commentCount, long groupId, GroupType groupType, Status status) { public static ReadOnceGroupCommentCommonVo of(int commentCount, long groupId, Status status) { return new ReadOnceGroupCommentCommonVo(commentCount, groupId, GroupType.ONCE, status); diff --git a/src/main/java/com/ggang/be/domain/school/SchoolEntity.java b/src/main/java/com/ggang/be/domain/school/SchoolEntity.java index 9e1abcf..23b30da 100644 --- a/src/main/java/com/ggang/be/domain/school/SchoolEntity.java +++ b/src/main/java/com/ggang/be/domain/school/SchoolEntity.java @@ -13,9 +13,7 @@ @Entity(name = "school") @NoArgsConstructor(access = AccessLevel.PROTECTED) -@Table(indexes = { - @Index(name="school_name_idx", columnList = "schoolName") -}) +@Table(indexes = @Index(name = "school_name_idx", columnList = "schoolName")) @Getter public class SchoolEntity extends BaseTimeEntity { diff --git a/src/main/java/com/ggang/be/domain/school/application/School.java b/src/main/java/com/ggang/be/domain/school/application/School.java index 8a2f0f7..a7a8128 100644 --- a/src/main/java/com/ggang/be/domain/school/application/School.java +++ b/src/main/java/com/ggang/be/domain/school/application/School.java @@ -7,9 +7,9 @@ @Getter public class School { - private Long id; - private String schoolName; - private String schoolDomain; + private final Long id; + private final String schoolName; + private final String schoolDomain; public static School fromEntity(SchoolEntity schoolEntity){ return School.builder() diff --git a/src/main/java/com/ggang/be/domain/schoolMajor/application/SchoolMajor.java b/src/main/java/com/ggang/be/domain/schoolMajor/application/SchoolMajor.java index 6fc5500..e492f1b 100644 --- a/src/main/java/com/ggang/be/domain/schoolMajor/application/SchoolMajor.java +++ b/src/main/java/com/ggang/be/domain/schoolMajor/application/SchoolMajor.java @@ -7,9 +7,9 @@ @Getter public class SchoolMajor { - private Long id; - private School school; - private String majorName; + private final Long id; + private final School school; + private final String majorName; public static SchoolMajor fromEntity(SchoolMajorEntity schoolMajorEntity){ return SchoolMajor.builder() diff --git a/src/main/java/com/ggang/be/domain/schoolMajor/application/SchoolMajorServiceImpl.java b/src/main/java/com/ggang/be/domain/schoolMajor/application/SchoolMajorServiceImpl.java index f122969..1e7e92f 100644 --- a/src/main/java/com/ggang/be/domain/schoolMajor/application/SchoolMajorServiceImpl.java +++ b/src/main/java/com/ggang/be/domain/schoolMajor/application/SchoolMajorServiceImpl.java @@ -3,11 +3,12 @@ import com.ggang.be.api.schoolMajor.service.SchoolMajorService; import com.ggang.be.domain.schoolMajor.SchoolMajorEntity; import com.ggang.be.domain.schoolMajor.infra.SchoolMajorRepository; -import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; + @Service @RequiredArgsConstructor @Transactional(readOnly = true) diff --git a/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/infra/GongbaekTimeSlotRepository.java b/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/infra/GongbaekTimeSlotRepository.java index 8c78f32..466d319 100644 --- a/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/infra/GongbaekTimeSlotRepository.java +++ b/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/infra/GongbaekTimeSlotRepository.java @@ -1,11 +1,7 @@ package com.ggang.be.domain.timslot.gongbaekTimeSlot.infra; -import com.ggang.be.domain.constant.WeekDate; import com.ggang.be.domain.timslot.gongbaekTimeSlot.GongbaekTimeSlotEntity; -import com.ggang.be.domain.user.UserEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface GongbaekTimeSlotRepository extends JpaRepository { - - boolean existsByStartTimeAndEndTimeAndUserEntityAndWeekDate(double startTime, double endTime, UserEntity userEntity, WeekDate weekDate); } diff --git a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/infra/LectureTimeSlotRepository.java b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/infra/LectureTimeSlotRepository.java index 8989eff..76bf23e 100644 --- a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/infra/LectureTimeSlotRepository.java +++ b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/infra/LectureTimeSlotRepository.java @@ -3,10 +3,11 @@ import com.ggang.be.domain.constant.WeekDate; import com.ggang.be.domain.timslot.lectureTimeSlot.LectureTimeSlotEntity; import com.ggang.be.domain.user.UserEntity; -import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import java.util.List; + public interface LectureTimeSlotRepository extends JpaRepository { @Query("SELECT CASE WHEN COUNT(l) > 0 THEN TRUE ELSE FALSE END " + diff --git a/src/main/java/com/ggang/be/domain/user/UserEntity.java b/src/main/java/com/ggang/be/domain/user/UserEntity.java index a80fabe..5b568f0 100644 --- a/src/main/java/com/ggang/be/domain/user/UserEntity.java +++ b/src/main/java/com/ggang/be/domain/user/UserEntity.java @@ -20,9 +20,7 @@ @Getter @Entity(name = "user") @DynamicUpdate -@Table(indexes = { - @Index(name="user_nickname_index", columnList = "nickname") -}) +@Table(indexes = @Index(name = "user_nickname_index", columnList = "nickname")) @NoArgsConstructor(access = AccessLevel.PROTECTED) public class UserEntity extends BaseTimeEntity { diff --git a/src/main/java/com/ggang/be/domain/user/dto/UserDto.java b/src/main/java/com/ggang/be/domain/user/dto/UserDto.java deleted file mode 100644 index f7c88d9..0000000 --- a/src/main/java/com/ggang/be/domain/user/dto/UserDto.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.ggang.be.domain.user.dto; - -public record UserDto() { - -} diff --git a/src/main/java/com/ggang/be/domain/userEveryGroup/application/UserEveryGroupServiceImpl.java b/src/main/java/com/ggang/be/domain/userEveryGroup/application/UserEveryGroupServiceImpl.java index 62b3d27..9e75d41 100644 --- a/src/main/java/com/ggang/be/domain/userEveryGroup/application/UserEveryGroupServiceImpl.java +++ b/src/main/java/com/ggang/be/domain/userEveryGroup/application/UserEveryGroupServiceImpl.java @@ -14,14 +14,15 @@ import com.ggang.be.domain.userEveryGroup.dto.FillMember; import com.ggang.be.domain.userEveryGroup.dto.NearestEveryGroup; import com.ggang.be.domain.userEveryGroup.infra.UserEveryGroupRepository; -import java.util.Comparator; -import java.util.List; -import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + @Service @RequiredArgsConstructor diff --git a/src/main/java/com/ggang/be/domain/userEveryGroup/dto/NearestEveryGroup.java b/src/main/java/com/ggang/be/domain/userEveryGroup/dto/NearestEveryGroup.java index 992ab53..0407fba 100644 --- a/src/main/java/com/ggang/be/domain/userEveryGroup/dto/NearestEveryGroup.java +++ b/src/main/java/com/ggang/be/domain/userEveryGroup/dto/NearestEveryGroup.java @@ -1,7 +1,7 @@ package com.ggang.be.domain.userEveryGroup.dto; -import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.Category; +import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.WeekDate; import com.ggang.be.domain.group.everyGroup.EveryGroupEntity; diff --git a/src/main/java/com/ggang/be/domain/userEveryGroup/infra/UserEveryGroupRepository.java b/src/main/java/com/ggang/be/domain/userEveryGroup/infra/UserEveryGroupRepository.java index d172801..0a4efd9 100644 --- a/src/main/java/com/ggang/be/domain/userEveryGroup/infra/UserEveryGroupRepository.java +++ b/src/main/java/com/ggang/be/domain/userEveryGroup/infra/UserEveryGroupRepository.java @@ -5,10 +5,10 @@ import com.ggang.be.domain.user.UserEntity; import com.ggang.be.domain.userEveryGroup.UserEveryGroupEntity; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; import java.util.List; import java.util.Optional; -import org.springframework.data.jpa.repository.Query; public interface UserEveryGroupRepository extends JpaRepository { List findUserEveryGroupEntityByEveryGroupEntity(EveryGroupEntity entity); diff --git a/src/main/java/com/ggang/be/domain/userOnceGroup/application/UserOnceGroupServiceImpl.java b/src/main/java/com/ggang/be/domain/userOnceGroup/application/UserOnceGroupServiceImpl.java index f62e582..be6bbd7 100644 --- a/src/main/java/com/ggang/be/domain/userOnceGroup/application/UserOnceGroupServiceImpl.java +++ b/src/main/java/com/ggang/be/domain/userOnceGroup/application/UserOnceGroupServiceImpl.java @@ -61,11 +61,6 @@ public NearestOnceGroup getMyNearestOnceGroup(UserEntity currentUser) { return NearestOnceGroup.toDto(nearestGroup); } - @Override - public List readUserTIme(UserEntity findUserEntity) { - return userOnceGroupRepository.findAllByUserEntity(findUserEntity); - } - @Override @Transactional public void applyOnceGroup(UserEntity currentUser, OnceGroupEntity onceGroupEntity){ diff --git a/src/main/java/com/ggang/be/domain/userOnceGroup/dto/NearestOnceGroup.java b/src/main/java/com/ggang/be/domain/userOnceGroup/dto/NearestOnceGroup.java index f213afd..075a149 100644 --- a/src/main/java/com/ggang/be/domain/userOnceGroup/dto/NearestOnceGroup.java +++ b/src/main/java/com/ggang/be/domain/userOnceGroup/dto/NearestOnceGroup.java @@ -1,7 +1,7 @@ package com.ggang.be.domain.userOnceGroup.dto; -import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.Category; +import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.WeekDate; import com.ggang.be.domain.group.onceGroup.OnceGroupEntity; diff --git a/src/main/java/com/ggang/be/domain/userOnceGroup/infra/UserOnceGroupRepository.java b/src/main/java/com/ggang/be/domain/userOnceGroup/infra/UserOnceGroupRepository.java index 8ed4b2a..35d60c6 100644 --- a/src/main/java/com/ggang/be/domain/userOnceGroup/infra/UserOnceGroupRepository.java +++ b/src/main/java/com/ggang/be/domain/userOnceGroup/infra/UserOnceGroupRepository.java @@ -4,10 +4,10 @@ import com.ggang.be.domain.user.UserEntity; import com.ggang.be.domain.userOnceGroup.UserOnceGroupEntity; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; import java.util.List; import java.util.Optional; -import org.springframework.data.jpa.repository.Query; public interface UserOnceGroupRepository extends JpaRepository { @@ -16,9 +16,9 @@ public interface UserOnceGroupRepository extends JpaRepository findByUserEntity_id(Long id); @Query("select u from user_once_group u " - + " join fetch u.userEntity" - + " join fetch u.onceGroupEntity" - + " where u.userEntity = :userEntity") + + " join fetch u.userEntity" + + " join fetch u.onceGroupEntity" + + " where u.userEntity = :userEntity") List findAllByUserEntity(UserEntity userEntity); Optional findByUserEntityAndOnceGroupEntity(UserEntity userEntity, OnceGroupEntity onceGroupEntity); diff --git a/src/main/java/com/ggang/be/global/schedule/SchedulerConfig.java b/src/main/java/com/ggang/be/global/schedule/SchedulerConfig.java index 3f637a6..df48262 100644 --- a/src/main/java/com/ggang/be/global/schedule/SchedulerConfig.java +++ b/src/main/java/com/ggang/be/global/schedule/SchedulerConfig.java @@ -1,14 +1,14 @@ package com.ggang.be.global.schedule; -import java.util.concurrent.Executor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import java.util.concurrent.Executor; + @Configuration public class SchedulerConfig { - @Bean public Executor asyncEveryGroupUpdater() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); diff --git a/src/main/java/com/ggang/be/global/util/TimeConverter.java b/src/main/java/com/ggang/be/global/util/TimeConverter.java index 2912709..2c72ed7 100644 --- a/src/main/java/com/ggang/be/global/util/TimeConverter.java +++ b/src/main/java/com/ggang/be/global/util/TimeConverter.java @@ -3,8 +3,6 @@ import java.time.LocalTime; public class TimeConverter { - - public static LocalTime toLocalTime(double time){ int hour=(int) time; if(time-hour==0.5){