From 88afbb555a3e91bb975da3d8cbab6d0f3f700dc0 Mon Sep 17 00:00:00 2001 From: Hyunkyu Lee <88573971+wken5577@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:23:29 +0900 Subject: [PATCH 01/12] [FEAT] #657 recruit entity (#670) --- .github/workflows/checkstyle-validation.yml | 2 +- .github/workflows/test-code-validation.yml | 2 +- .../admin/repo/game/GameAdminRepository.java | 8 +- .../repo/game/PChangeAdminRepository.java | 2 +- .../game/PChangeAdminRepositoryCustom.java | 2 +- .../PChangeAdminRepositoryCustomImpl.java | 2 +- .../admin/repo/game/TeamAdminRepository.java | 4 +- .../repo/game/TeamUserAdminRepository.java | 2 +- .../gg/admin/repo/game/out/GameTeamUser.java | 4 +- .../AdminSlotManagementsRepository.java | 2 +- .../repo/season/SeasonAdminRepository.java | 2 +- .../repo/store/CoinPolicyAdminRepository.java | 2 +- .../admin/repo/store/ItemAdminRepository.java | 2 +- .../repo/store/MegaphoneAdminRepository.java | 2 +- .../repo/store/ReceiptAdminRepository.java | 2 +- .../store/ReceiptAdminRepositorySearch.java | 2 +- .../src/main/java/gg/data/party/UserRoom.java | 1 - .../gg/data/{ => pingpong}/game/Game.java | 8 +- .../gg/data/{ => pingpong}/game/PChange.java | 2 +- .../gg/data/{ => pingpong}/game/Team.java | 2 +- .../gg/data/{ => pingpong}/game/TeamUser.java | 2 +- .../data/{ => pingpong}/game/type/Mode.java | 2 +- .../{ => pingpong}/game/type/StatusType.java | 2 +- .../{ => pingpong}/manage/SlotManagement.java | 2 +- .../{ => pingpong}/match/RedisMatchTime.java | 4 +- .../{ => pingpong}/match/RedisMatchUser.java | 4 +- .../{ => pingpong}/match/type/MatchKey.java | 2 +- .../{ => pingpong}/match/type/Option.java | 2 +- .../{ => pingpong}/match/type/SlotStatus.java | 2 +- .../match/type/TournamentMatchStatus.java | 2 +- .../gg/data/{ => pingpong}/rank/Rank.java | 4 +- .../gg/data/{ => pingpong}/rank/Tier.java | 2 +- .../{ => pingpong}/rank/redis/RankRedis.java | 4 +- .../gg/data/{ => pingpong}/season/Season.java | 2 +- .../{ => pingpong}/store/CoinHistory.java | 2 +- .../data/{ => pingpong}/store/CoinPolicy.java | 2 +- .../gg/data/{ => pingpong}/store/Item.java | 4 +- .../data/{ => pingpong}/store/Megaphone.java | 2 +- .../gg/data/{ => pingpong}/store/Receipt.java | 4 +- .../store/redis/MegaphoneRedis.java | 2 +- .../store/type/HistoryType.java | 2 +- .../{ => pingpong}/store/type/ItemStatus.java | 2 +- .../{ => pingpong}/store/type/ItemType.java | 2 +- .../{ => pingpong}/tournament/Tournament.java | 6 +- .../tournament/TournamentGame.java | 6 +- .../tournament/TournamentUser.java | 2 +- .../tournament/type/RoundNumber.java | 2 +- .../tournament/type/TournamentRound.java | 4 +- .../tournament/type/TournamentStatus.java | 2 +- .../tournament/type/TournamentType.java | 2 +- .../tournament/type/TournamentUserStatus.java | 2 +- .../data/recruit/application/Application.java | 42 +++++++ .../application/ApplicationAnswer.java | 31 +++++ .../ApplicationAnswerCheckList.java | 29 +++++ .../application/ApplicationAnswerText.java | 28 +++++ .../recruit/application/RecruitStatus.java | 30 +++++ .../application/enums/ApplicationStatus.java | 15 +++ .../gg/data/recruit/manage/ResultMessage.java | 32 +++++ .../recruit/manage/enums/MessageType.java | 14 +++ .../data/recruit/recruitment/CheckList.java | 30 +++++ .../gg/data/recruit/recruitment/Question.java | 39 ++++++ .../recruit/recruitment/Recruitments.java | 39 ++++++ .../recruit/recruitment/enums/InputType.java | 12 ++ .../tournament/TournamentUnitTest.java | 6 +- .../api/admin/game/dto/GameLogAdminDto.java | 2 +- .../admin/game/service/GameAdminService.java | 14 +-- .../api/admin/manage/dto/SlotAdminDto.java | 2 +- .../manage/service/SlotAdminService.java | 2 +- .../admin/rank/service/RankAdminService.java | 6 +- .../rank/service/RankRedisAdminService.java | 4 +- .../request/SeasonCreateRequestDto.java | 2 +- .../api/admin/season/dto/SeasonAdminDto.java | 2 +- .../season/service/SeasonAdminService.java | 2 +- .../request/ItemUpdateRequestDto.java | 4 +- .../response/CoinPolicyAdminResponseDto.java | 2 +- .../response/ItemHistoryResponseDto.java | 2 +- .../response/MegaphoneAdminResponseDto.java | 2 +- .../response/ReceiptResponseDto.java | 6 +- .../admin/store/service/CoinAdminService.java | 2 +- .../store/service/CoinPolicyAdminService.java | 2 +- .../admin/store/service/ItemAdminService.java | 2 +- .../store/service/ReceiptAdminService.java | 2 +- .../TournamentAdminCreateRequestDto.java | 2 +- .../TournamentAdminUpdateRequestDto.java | 2 +- .../service/TournamentAdminService.java | 24 ++-- .../response/UserDetailAdminResponseDto.java | 2 +- .../admin/user/service/UserAdminService.java | 6 +- .../service/CustomOAuth2UserService.java | 6 +- .../api/global/utils/ItemImageHandler.java | 2 +- .../utils/aws/AsyncNewItemImageUploader.java | 2 +- .../user/game/controller/GameController.java | 2 +- .../controller/request/GameListReqDto.java | 2 +- .../controller/response/GameResultResDto.java | 2 +- .../api/user/game/dto/GameTeamInfo.java | 4 +- .../user/game/service/GameFindService.java | 6 +- .../api/user/game/service/GameService.java | 18 +-- .../user/game/service/GameStatusService.java | 6 +- .../api/user/game/service/PChangeService.java | 4 +- .../match/controller/MatchController.java | 2 +- .../controller/request/MatchRequestDto.java | 2 +- .../api/user/match/dto/GameAddDto.java | 8 +- .../api/user/match/dto/MatchStatusDto.java | 8 +- .../api/user/match/dto/SlotStatusDto.java | 2 +- .../user/match/service/GameUpdateService.java | 8 +- .../user/match/service/MatchFindService.java | 18 +-- .../api/user/match/service/MatchService.java | 20 ++-- .../match/service/MatchTournamentService.java | 32 ++--- .../api/user/match/utils/MatchCalculator.java | 6 +- .../api/user/match/utils/SlotGenerator.java | 18 +-- .../pingpong/api/user/rank/dto/RankDto.java | 2 +- .../api/user/rank/redis/RankRedisService.java | 12 +- .../user/rank/redis/RedisUploadService.java | 2 +- .../user/rank/service/RankFindService.java | 2 +- .../api/user/rank/service/RankService.java | 4 +- .../api/user/rank/service/TierService.java | 6 +- .../controller/response/SeasonResDto.java | 2 +- .../api/user/season/dto/CurSeason.java | 2 +- .../season/service/SeasonFindService.java | 4 +- .../response/ItemStoreResponseDto.java | 4 +- .../response/MegaphoneDetailResponseDto.java | 2 +- .../MegaphoneTodayListResponseDto.java | 2 +- .../response/UserItemResponseDto.java | 8 +- .../store/redis/MegaphoneRedisRepository.java | 2 +- .../store/service/CoinHistoryService.java | 6 +- .../api/user/store/service/ItemService.java | 8 +- .../user/store/service/MegaphoneService.java | 10 +- .../store/service/UserCoinChangeService.java | 6 +- .../request/TournamentFilterRequestDto.java | 4 +- .../response/TournamentGameResDto.java | 4 +- .../response/TournamentResponseDto.java | 8 +- .../TournamentUserListResponseDto.java | 2 +- ...TournamentUserRegistrationResponseDto.java | 2 +- .../response/TournamentUserResponseDto.java | 2 +- .../tournament/service/TournamentService.java | 16 +-- .../user/user/controller/UserController.java | 2 +- .../response/CoinHistoryResponseDto.java | 2 +- .../response/UserDetailResponseDto.java | 2 +- .../response/UserLiveResponseDto.java | 2 +- .../api/user/user/dto/UserHistoryData.java | 2 +- .../user/user/service/UserCoinService.java | 2 +- .../user/user/service/UserFindService.java | 4 +- .../api/user/user/service/UserService.java | 20 ++-- .../resources/db/migration/V2__recruit.sql | 112 ++++++++++++++++++ .../CoinPolicyAdminControllerTest.java | 2 +- .../coin/service/CoinAdminServiceTest.java | 2 +- .../controller/GameAdminControllerTest.java | 8 +- .../controller/ItemAdminControllerTest.java | 4 +- .../service/ItemAdminServiceUnitTest.java | 2 +- .../ReceiptAdminControllerTest.java | 4 +- .../service/ReceiptAdminServiceUnitTest.java | 2 +- .../controller/SeasonAdminControllerTest.java | 4 +- .../service/SeasonAdminServiceUnitTest.java | 2 +- .../SlotAdminControllerFailTest.java | 2 +- .../controller/SlotAdminControllerTest.java | 2 +- .../service/SlotAdminServiceUnitTest.java | 2 +- .../TournamentAdminControllerTest.java | 16 +-- .../TournamentAdminUserControllerTest.java | 2 +- .../service/TournamentAdminServiceTest.java | 16 +-- .../pingpong/api/data/game/GameUnitTest.java | 4 +- .../api/data/game/PChangeDataTest.java | 2 +- .../pingpong/api/data/game/TeamUnitTest.java | 4 +- .../api/data/game/TournamentGameUnitTest.java | 10 +- .../api/data/game/TournamentUserUnitTest.java | 8 +- .../pingpong/api/data/store/ItemUnitTest.java | 2 +- .../coin/service/CoinHistoryServiceTest.java | 4 +- .../service/UserCoinChangeServiceTest.java | 12 +- .../api/user/game/GameControllerTest.java | 24 ++-- .../api/user/game/service/GameDBTest.java | 10 +- .../game/service/GameFindServiceTest.java | 12 +- .../user/game/service/GameServiceTest.java | 18 +-- .../game/service/GameStatusServiceTest.java | 14 +-- .../ItemStoreListControllerTest.java | 2 +- .../item/service/ItemServiceUnitTest.java | 8 +- .../match/dto/MatchStatusDtoUnitTest.java | 6 +- .../match/service/MatchBothServiceTest.java | 8 +- .../service/MatchFindServiceUnitTest.java | 16 +-- .../user/match/service/MatchServiceTest.java | 26 ++-- .../service/MatchTournamentServiceTest.java | 18 +-- .../MatchTournamentServiceUnitTest.java | 26 ++-- .../api/user/match/utils/GameTestUtils.java | 12 +- .../utils/MatchIntegrationTestUtils.java | 16 +-- .../match/utils/TournamentGameTestUtils.java | 20 ++-- .../user/match/utils/TournamentTestUtils.java | 12 +- .../controller/MegaphoneControllerTest.java | 10 +- .../service/MegaphoneServiceUnitTest.java | 10 +- .../pchange/service/PChangeServiceTest.java | 4 +- .../rank/controller/RankControllerTest.java | 2 +- .../rank/redis/RankRedisRepositoryTest.java | 2 +- .../user/rank/service/RankServiceTest.java | 2 +- .../api/user/season/SeasonTestController.java | 2 +- .../api/user/season/SeasonTriggerTest.java | 4 +- .../season/service/SeasonServiceUnitTest.java | 2 +- .../tier/service/TierServiceUnitTest.java | 6 +- .../TournamentFindControllerTest.java | 8 +- .../TournamentGameControllerTest.java | 12 +- .../controller/TournamentSchedulerTest.java | 8 +- .../service/TournamentServiceUnitTest.java | 18 +-- .../user/controller/UserControllerTest.java | 22 ++-- .../java/gg/repo/game/GameRepository.java | 6 +- .../gg/repo/game/GameRepositoryCustom.java | 2 +- .../java/gg/repo/game/GameRepositoryImpl.java | 4 +- .../java/gg/repo/game/PChangeRepository.java | 4 +- .../gg/repo/game/PChangeRepositoryCustom.java | 2 +- .../gg/repo/game/PChangeRepositoryImpl.java | 2 +- .../java/gg/repo/game/TeamRepository.java | 2 +- .../java/gg/repo/game/TeamUserRepository.java | 2 +- .../java/gg/repo/game/out/GameTeamUser.java | 4 +- .../gg/repo/game/out/GameTeamUserInfo.java | 4 +- .../repo/manage/SlotManagementRepository.java | 2 +- .../repo/match/RedisMatchTimeRepository.java | 4 +- .../repo/match/RedisMatchUserRepository.java | 6 +- .../java/gg/repo/rank/RankRepository.java | 2 +- .../java/gg/repo/rank/TierRepository.java | 2 +- .../repo/rank/redis/RankRedisRepository.java | 2 +- .../java/gg/repo/season/SeasonRepository.java | 2 +- .../gg/repo/store/CoinHistoryRepository.java | 2 +- .../gg/repo/store/CoinPolicyRepository.java | 2 +- .../java/gg/repo/store/ItemRepository.java | 2 +- .../gg/repo/store/MegaphoneRepository.java | 6 +- .../java/gg/repo/store/ReceiptRepository.java | 2 +- .../gg/repo/store/UserItemRepository.java | 2 +- .../tournarment/TournamentGameRepository.java | 4 +- .../tournarment/TournamentRepository.java | 6 +- .../tournarment/TournamentUserRepository.java | 4 +- .../java/gg/utils/ItemTestUtils.java | 8 +- .../java/gg/utils/TestDataUtils.java | 36 +++--- 226 files changed, 1042 insertions(+), 590 deletions(-) rename gg-data/src/main/java/gg/data/{ => pingpong}/game/Game.java (94%) rename gg-data/src/main/java/gg/data/{ => pingpong}/game/PChange.java (98%) rename gg-data/src/main/java/gg/data/{ => pingpong}/game/Team.java (98%) rename gg-data/src/main/java/gg/data/{ => pingpong}/game/TeamUser.java (97%) rename gg-data/src/main/java/gg/data/{ => pingpong}/game/type/Mode.java (94%) rename gg-data/src/main/java/gg/data/{ => pingpong}/game/type/StatusType.java (95%) rename gg-data/src/main/java/gg/data/{ => pingpong}/manage/SlotManagement.java (98%) rename gg-data/src/main/java/gg/data/{ => pingpong}/match/RedisMatchTime.java (92%) rename gg-data/src/main/java/gg/data/{ => pingpong}/match/RedisMatchUser.java (87%) rename gg-data/src/main/java/gg/data/{ => pingpong}/match/type/MatchKey.java (94%) rename gg-data/src/main/java/gg/data/{ => pingpong}/match/type/Option.java (95%) rename gg-data/src/main/java/gg/data/{ => pingpong}/match/type/SlotStatus.java (94%) rename gg-data/src/main/java/gg/data/{ => pingpong}/match/type/TournamentMatchStatus.java (91%) rename gg-data/src/main/java/gg/data/{ => pingpong}/rank/Rank.java (97%) rename gg-data/src/main/java/gg/data/{ => pingpong}/rank/Tier.java (95%) rename gg-data/src/main/java/gg/data/{ => pingpong}/rank/redis/RankRedis.java (96%) rename gg-data/src/main/java/gg/data/{ => pingpong}/season/Season.java (97%) rename gg-data/src/main/java/gg/data/{ => pingpong}/store/CoinHistory.java (97%) rename gg-data/src/main/java/gg/data/{ => pingpong}/store/CoinPolicy.java (98%) rename gg-data/src/main/java/gg/data/{ => pingpong}/store/Item.java (96%) rename gg-data/src/main/java/gg/data/{ => pingpong}/store/Megaphone.java (97%) rename gg-data/src/main/java/gg/data/{ => pingpong}/store/Receipt.java (95%) rename gg-data/src/main/java/gg/data/{ => pingpong}/store/redis/MegaphoneRedis.java (95%) rename gg-data/src/main/java/gg/data/{ => pingpong}/store/type/HistoryType.java (88%) rename gg-data/src/main/java/gg/data/{ => pingpong}/store/type/ItemStatus.java (88%) rename gg-data/src/main/java/gg/data/{ => pingpong}/store/type/ItemType.java (80%) rename gg-data/src/main/java/gg/data/{ => pingpong}/tournament/Tournament.java (96%) rename gg-data/src/main/java/gg/data/{ => pingpong}/tournament/TournamentGame.java (92%) rename gg-data/src/main/java/gg/data/{ => pingpong}/tournament/TournamentUser.java (97%) rename gg-data/src/main/java/gg/data/{ => pingpong}/tournament/type/RoundNumber.java (85%) rename gg-data/src/main/java/gg/data/{ => pingpong}/tournament/type/TournamentRound.java (93%) rename gg-data/src/main/java/gg/data/{ => pingpong}/tournament/type/TournamentStatus.java (94%) rename gg-data/src/main/java/gg/data/{ => pingpong}/tournament/type/TournamentType.java (94%) rename gg-data/src/main/java/gg/data/{ => pingpong}/tournament/type/TournamentUserStatus.java (88%) create mode 100644 gg-data/src/main/java/gg/data/recruit/application/Application.java create mode 100644 gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java create mode 100644 gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java create mode 100644 gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java create mode 100644 gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java create mode 100644 gg-data/src/main/java/gg/data/recruit/application/enums/ApplicationStatus.java create mode 100644 gg-data/src/main/java/gg/data/recruit/manage/ResultMessage.java create mode 100644 gg-data/src/main/java/gg/data/recruit/manage/enums/MessageType.java create mode 100644 gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java create mode 100644 gg-data/src/main/java/gg/data/recruit/recruitment/Question.java create mode 100644 gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java create mode 100644 gg-data/src/main/java/gg/data/recruit/recruitment/enums/InputType.java rename gg-data/src/test/java/gg/data/{ => pingpong}/tournament/TournamentUnitTest.java (98%) create mode 100644 gg-pingpong-api/src/main/resources/db/migration/V2__recruit.sql diff --git a/.github/workflows/checkstyle-validation.yml b/.github/workflows/checkstyle-validation.yml index 86277c01f..8b8fc328c 100644 --- a/.github/workflows/checkstyle-validation.yml +++ b/.github/workflows/checkstyle-validation.yml @@ -2,7 +2,7 @@ name: ๐Ÿ‘ฎCheckstyle validation on: pull_request: - branches: [ main, dev ] + branches: [ main, dev , recruit-dev] jobs: checkstyle: diff --git a/.github/workflows/test-code-validation.yml b/.github/workflows/test-code-validation.yml index 2d4b0468d..958027d64 100644 --- a/.github/workflows/test-code-validation.yml +++ b/.github/workflows/test-code-validation.yml @@ -2,7 +2,7 @@ name: ๐Ÿ’ป Test code validation on: pull_request: - branches: [ main, dev ] + branches: [ main, dev, recruit-dev] jobs: test: diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/game/GameAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/game/GameAdminRepository.java index 18efb7a17..259d2faa1 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/game/GameAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/game/GameAdminRepository.java @@ -10,10 +10,10 @@ import org.springframework.data.repository.query.Param; import gg.admin.repo.game.out.GameTeamUser; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.season.Season; public interface GameAdminRepository extends JpaRepository { diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepository.java index fb7e4b362..e2cac85e4 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepository.java @@ -2,7 +2,7 @@ import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.game.PChange; +import gg.data.pingpong.game.PChange; public interface PChangeAdminRepository extends JpaRepository, PChangeAdminRepositoryCustom { } diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepositoryCustom.java b/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepositoryCustom.java index afaed7f3b..f1367a479 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepositoryCustom.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepositoryCustom.java @@ -2,7 +2,7 @@ import java.util.List; -import gg.data.game.PChange; +import gg.data.pingpong.game.PChange; public interface PChangeAdminRepositoryCustom { List findByTeamUser(Long userId); diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepositoryCustomImpl.java b/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepositoryCustomImpl.java index a9702a353..eb5fb8dff 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepositoryCustomImpl.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/game/PChangeAdminRepositoryCustomImpl.java @@ -5,7 +5,7 @@ import javax.persistence.EntityManager; import javax.persistence.LockModeType; -import gg.data.game.PChange; +import gg.data.pingpong.game.PChange; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/game/TeamAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/game/TeamAdminRepository.java index da465572f..9407a7d35 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/game/TeamAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/game/TeamAdminRepository.java @@ -4,8 +4,8 @@ import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.game.Game; -import gg.data.game.Team; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; public interface TeamAdminRepository extends JpaRepository { List findAllByGame(Game game); diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/game/TeamUserAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/game/TeamUserAdminRepository.java index 7b4750dda..6c1c7e7f5 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/game/TeamUserAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/game/TeamUserAdminRepository.java @@ -6,7 +6,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.game.TeamUser; +import gg.data.pingpong.game.TeamUser; import gg.data.user.User; public interface TeamUserAdminRepository extends JpaRepository { diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/game/out/GameTeamUser.java b/gg-admin-repo/src/main/java/gg/admin/repo/game/out/GameTeamUser.java index 60cb599f2..8246eac27 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/game/out/GameTeamUser.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/game/out/GameTeamUser.java @@ -2,8 +2,8 @@ import java.time.LocalDateTime; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; public interface GameTeamUser { Long getGameId(); diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/manage/AdminSlotManagementsRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/manage/AdminSlotManagementsRepository.java index ebcf52842..96b0d3c50 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/manage/AdminSlotManagementsRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/manage/AdminSlotManagementsRepository.java @@ -8,7 +8,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.manage.SlotManagement; +import gg.data.pingpong.manage.SlotManagement; public interface AdminSlotManagementsRepository extends JpaRepository { @Query("select slot from SlotManagement slot " diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/season/SeasonAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/season/SeasonAdminRepository.java index 7c7a61365..a43dd399a 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/season/SeasonAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/season/SeasonAdminRepository.java @@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; public interface SeasonAdminRepository extends JpaRepository { /* ์ž…๋ ฅ์‹œ๊ฐ„๊ณผ ๋ชจ๋“œ๋กœ ์ž…๋ ฅ์‹œ๊ฐ„ ์ดํ›„ ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ์‹œ์ฆŒ ๊ฐ€์ ธ์˜ค๊ธฐ */ diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/store/CoinPolicyAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/store/CoinPolicyAdminRepository.java index 72fd33f20..a7e04149b 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/store/CoinPolicyAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/store/CoinPolicyAdminRepository.java @@ -4,7 +4,7 @@ import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.store.CoinPolicy; +import gg.data.pingpong.store.CoinPolicy; public interface CoinPolicyAdminRepository extends JpaRepository { Optional findFirstByOrderByIdDesc(); diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/store/ItemAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/store/ItemAdminRepository.java index 007cf8f02..1263179aa 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/store/ItemAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/store/ItemAdminRepository.java @@ -4,7 +4,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.store.Item; +import gg.data.pingpong.store.Item; public interface ItemAdminRepository extends JpaRepository { Page findAll(Pageable pageable); diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/store/MegaphoneAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/store/MegaphoneAdminRepository.java index 133b024b0..f000494cd 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/store/MegaphoneAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/store/MegaphoneAdminRepository.java @@ -4,7 +4,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.store.Megaphone; +import gg.data.pingpong.store.Megaphone; public interface MegaphoneAdminRepository extends JpaRepository { Page findMegaphonesByUserIntraId(String intraId, Pageable pageable); diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/store/ReceiptAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/store/ReceiptAdminRepository.java index d121c17ae..13fd25551 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/store/ReceiptAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/store/ReceiptAdminRepository.java @@ -4,7 +4,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.store.Receipt; +import gg.data.pingpong.store.Receipt; public interface ReceiptAdminRepository extends JpaRepository, ReceiptAdminRepositorySearch { Page findAll(Pageable pageable); diff --git a/gg-admin-repo/src/main/java/gg/admin/repo/store/ReceiptAdminRepositorySearch.java b/gg-admin-repo/src/main/java/gg/admin/repo/store/ReceiptAdminRepositorySearch.java index 7d24f901e..59f4eec7b 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/store/ReceiptAdminRepositorySearch.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/store/ReceiptAdminRepositorySearch.java @@ -5,7 +5,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.store.Receipt; +import gg.data.pingpong.store.Receipt; public interface ReceiptAdminRepositorySearch { @Query(value = "select re from Receipt re where re.purchaserIntraId = :intraId or re.ownerIntraId = :intraId") diff --git a/gg-data/src/main/java/gg/data/party/UserRoom.java b/gg-data/src/main/java/gg/data/party/UserRoom.java index a14b9a425..82e1627b4 100644 --- a/gg-data/src/main/java/gg/data/party/UserRoom.java +++ b/gg-data/src/main/java/gg/data/party/UserRoom.java @@ -12,7 +12,6 @@ import javax.persistence.ManyToOne; import gg.data.BaseTimeEntity; -import gg.data.tournament.Tournament; import gg.data.user.User; import lombok.AccessLevel; import lombok.Builder; diff --git a/gg-data/src/main/java/gg/data/game/Game.java b/gg-data/src/main/java/gg/data/pingpong/game/Game.java similarity index 94% rename from gg-data/src/main/java/gg/data/game/Game.java rename to gg-data/src/main/java/gg/data/pingpong/game/Game.java index 2799d9d40..b72071b4e 100644 --- a/gg-data/src/main/java/gg/data/game/Game.java +++ b/gg-data/src/main/java/gg/data/pingpong/game/Game.java @@ -1,4 +1,4 @@ -package gg.data.game; +package gg.data.pingpong.game; import java.time.LocalDateTime; import java.util.ArrayList; @@ -20,9 +20,9 @@ import org.hibernate.annotations.DynamicUpdate; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.season.Season; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.season.Season; import gg.utils.exception.BusinessChecker; import gg.utils.exception.ErrorCode; import lombok.AllArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/game/PChange.java b/gg-data/src/main/java/gg/data/pingpong/game/PChange.java similarity index 98% rename from gg-data/src/main/java/gg/data/game/PChange.java rename to gg-data/src/main/java/gg/data/pingpong/game/PChange.java index e1de0dda3..8dfd650fd 100644 --- a/gg-data/src/main/java/gg/data/game/PChange.java +++ b/gg-data/src/main/java/gg/data/pingpong/game/PChange.java @@ -1,4 +1,4 @@ -package gg.data.game; +package gg.data.pingpong.game; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/gg-data/src/main/java/gg/data/game/Team.java b/gg-data/src/main/java/gg/data/pingpong/game/Team.java similarity index 98% rename from gg-data/src/main/java/gg/data/game/Team.java rename to gg-data/src/main/java/gg/data/pingpong/game/Team.java index 454f0ade7..d3b1c90f1 100644 --- a/gg-data/src/main/java/gg/data/game/Team.java +++ b/gg-data/src/main/java/gg/data/pingpong/game/Team.java @@ -1,4 +1,4 @@ -package gg.data.game; +package gg.data.pingpong.game; import java.util.ArrayList; import java.util.List; diff --git a/gg-data/src/main/java/gg/data/game/TeamUser.java b/gg-data/src/main/java/gg/data/pingpong/game/TeamUser.java similarity index 97% rename from gg-data/src/main/java/gg/data/game/TeamUser.java rename to gg-data/src/main/java/gg/data/pingpong/game/TeamUser.java index 525e39351..4987b0e84 100644 --- a/gg-data/src/main/java/gg/data/game/TeamUser.java +++ b/gg-data/src/main/java/gg/data/pingpong/game/TeamUser.java @@ -1,4 +1,4 @@ -package gg.data.game; +package gg.data.pingpong.game; import javax.persistence.Entity; import javax.persistence.FetchType; diff --git a/gg-data/src/main/java/gg/data/game/type/Mode.java b/gg-data/src/main/java/gg/data/pingpong/game/type/Mode.java similarity index 94% rename from gg-data/src/main/java/gg/data/game/type/Mode.java rename to gg-data/src/main/java/gg/data/pingpong/game/type/Mode.java index bd0b05954..0e5138b36 100644 --- a/gg-data/src/main/java/gg/data/game/type/Mode.java +++ b/gg-data/src/main/java/gg/data/pingpong/game/type/Mode.java @@ -1,4 +1,4 @@ -package gg.data.game.type; +package gg.data.pingpong.game.type; import java.util.Locale; diff --git a/gg-data/src/main/java/gg/data/game/type/StatusType.java b/gg-data/src/main/java/gg/data/pingpong/game/type/StatusType.java similarity index 95% rename from gg-data/src/main/java/gg/data/game/type/StatusType.java rename to gg-data/src/main/java/gg/data/pingpong/game/type/StatusType.java index 78bef3fd9..266758ee9 100644 --- a/gg-data/src/main/java/gg/data/game/type/StatusType.java +++ b/gg-data/src/main/java/gg/data/pingpong/game/type/StatusType.java @@ -1,4 +1,4 @@ -package gg.data.game.type; +package gg.data.pingpong.game.type; import java.util.Locale; diff --git a/gg-data/src/main/java/gg/data/manage/SlotManagement.java b/gg-data/src/main/java/gg/data/pingpong/manage/SlotManagement.java similarity index 98% rename from gg-data/src/main/java/gg/data/manage/SlotManagement.java rename to gg-data/src/main/java/gg/data/pingpong/manage/SlotManagement.java index 2ac1382ff..79783706e 100644 --- a/gg-data/src/main/java/gg/data/manage/SlotManagement.java +++ b/gg-data/src/main/java/gg/data/pingpong/manage/SlotManagement.java @@ -1,4 +1,4 @@ -package gg.data.manage; +package gg.data.pingpong.manage; import java.time.LocalDateTime; diff --git a/gg-data/src/main/java/gg/data/match/RedisMatchTime.java b/gg-data/src/main/java/gg/data/pingpong/match/RedisMatchTime.java similarity index 92% rename from gg-data/src/main/java/gg/data/match/RedisMatchTime.java rename to gg-data/src/main/java/gg/data/pingpong/match/RedisMatchTime.java index 10e8a5a03..742656a3d 100644 --- a/gg-data/src/main/java/gg/data/match/RedisMatchTime.java +++ b/gg-data/src/main/java/gg/data/pingpong/match/RedisMatchTime.java @@ -1,4 +1,4 @@ -package gg.data.match; +package gg.data.pingpong.match; import java.io.Serializable; import java.time.LocalDateTime; @@ -12,7 +12,7 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; -import gg.data.match.type.Option; +import gg.data.pingpong.match.type.Option; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/match/RedisMatchUser.java b/gg-data/src/main/java/gg/data/pingpong/match/RedisMatchUser.java similarity index 87% rename from gg-data/src/main/java/gg/data/match/RedisMatchUser.java rename to gg-data/src/main/java/gg/data/pingpong/match/RedisMatchUser.java index b76350975..15cb8f676 100644 --- a/gg-data/src/main/java/gg/data/match/RedisMatchUser.java +++ b/gg-data/src/main/java/gg/data/pingpong/match/RedisMatchUser.java @@ -1,4 +1,4 @@ -package gg.data.match; +package gg.data.pingpong.match; import java.io.Serializable; @@ -6,7 +6,7 @@ import org.springframework.data.redis.core.RedisHash; -import gg.data.match.type.Option; +import gg.data.pingpong.match.type.Option; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/match/type/MatchKey.java b/gg-data/src/main/java/gg/data/pingpong/match/type/MatchKey.java similarity index 94% rename from gg-data/src/main/java/gg/data/match/type/MatchKey.java rename to gg-data/src/main/java/gg/data/pingpong/match/type/MatchKey.java index 78f3fbd0f..017f4f614 100644 --- a/gg-data/src/main/java/gg/data/match/type/MatchKey.java +++ b/gg-data/src/main/java/gg/data/pingpong/match/type/MatchKey.java @@ -1,4 +1,4 @@ -package gg.data.match.type; +package gg.data.pingpong.match.type; import java.time.LocalDateTime; diff --git a/gg-data/src/main/java/gg/data/match/type/Option.java b/gg-data/src/main/java/gg/data/pingpong/match/type/Option.java similarity index 95% rename from gg-data/src/main/java/gg/data/match/type/Option.java rename to gg-data/src/main/java/gg/data/pingpong/match/type/Option.java index a5f6225f0..3ef858ce7 100644 --- a/gg-data/src/main/java/gg/data/match/type/Option.java +++ b/gg-data/src/main/java/gg/data/pingpong/match/type/Option.java @@ -1,4 +1,4 @@ -package gg.data.match.type; +package gg.data.pingpong.match.type; import java.util.Locale; diff --git a/gg-data/src/main/java/gg/data/match/type/SlotStatus.java b/gg-data/src/main/java/gg/data/pingpong/match/type/SlotStatus.java similarity index 94% rename from gg-data/src/main/java/gg/data/match/type/SlotStatus.java rename to gg-data/src/main/java/gg/data/pingpong/match/type/SlotStatus.java index e2aca1604..7d3126668 100644 --- a/gg-data/src/main/java/gg/data/match/type/SlotStatus.java +++ b/gg-data/src/main/java/gg/data/pingpong/match/type/SlotStatus.java @@ -1,4 +1,4 @@ -package gg.data.match.type; +package gg.data.pingpong.match.type; import java.util.Locale; diff --git a/gg-data/src/main/java/gg/data/match/type/TournamentMatchStatus.java b/gg-data/src/main/java/gg/data/pingpong/match/type/TournamentMatchStatus.java similarity index 91% rename from gg-data/src/main/java/gg/data/match/type/TournamentMatchStatus.java rename to gg-data/src/main/java/gg/data/pingpong/match/type/TournamentMatchStatus.java index 24602a660..3e3f2651d 100644 --- a/gg-data/src/main/java/gg/data/match/type/TournamentMatchStatus.java +++ b/gg-data/src/main/java/gg/data/pingpong/match/type/TournamentMatchStatus.java @@ -1,4 +1,4 @@ -package gg.data.match.type; +package gg.data.pingpong.match.type; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/rank/Rank.java b/gg-data/src/main/java/gg/data/pingpong/rank/Rank.java similarity index 97% rename from gg-data/src/main/java/gg/data/rank/Rank.java rename to gg-data/src/main/java/gg/data/pingpong/rank/Rank.java index 6dc0ed4a4..19dbae8f2 100644 --- a/gg-data/src/main/java/gg/data/rank/Rank.java +++ b/gg-data/src/main/java/gg/data/pingpong/rank/Rank.java @@ -1,4 +1,4 @@ -package gg.data.rank; +package gg.data.pingpong.rank; import java.io.Serializable; @@ -16,7 +16,7 @@ import org.hibernate.annotations.DynamicUpdate; import gg.data.BaseTimeEntity; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import gg.data.user.User; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/gg-data/src/main/java/gg/data/rank/Tier.java b/gg-data/src/main/java/gg/data/pingpong/rank/Tier.java similarity index 95% rename from gg-data/src/main/java/gg/data/rank/Tier.java rename to gg-data/src/main/java/gg/data/pingpong/rank/Tier.java index ea26be3b9..49f93cfd5 100644 --- a/gg-data/src/main/java/gg/data/rank/Tier.java +++ b/gg-data/src/main/java/gg/data/pingpong/rank/Tier.java @@ -1,4 +1,4 @@ -package gg.data.rank; +package gg.data.pingpong.rank; import java.io.Serializable; diff --git a/gg-data/src/main/java/gg/data/rank/redis/RankRedis.java b/gg-data/src/main/java/gg/data/pingpong/rank/redis/RankRedis.java similarity index 96% rename from gg-data/src/main/java/gg/data/rank/redis/RankRedis.java rename to gg-data/src/main/java/gg/data/pingpong/rank/redis/RankRedis.java index 29fbfb5fa..117dcbe7c 100644 --- a/gg-data/src/main/java/gg/data/rank/redis/RankRedis.java +++ b/gg-data/src/main/java/gg/data/pingpong/rank/redis/RankRedis.java @@ -1,10 +1,10 @@ -package gg.data.rank.redis; +package gg.data.pingpong.rank.redis; import java.io.Serializable; import org.springframework.data.redis.core.RedisHash; -import gg.data.rank.Rank; +import gg.data.pingpong.rank.Rank; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/gg-data/src/main/java/gg/data/season/Season.java b/gg-data/src/main/java/gg/data/pingpong/season/Season.java similarity index 97% rename from gg-data/src/main/java/gg/data/season/Season.java rename to gg-data/src/main/java/gg/data/pingpong/season/Season.java index ceffb0d78..eab18fb89 100644 --- a/gg-data/src/main/java/gg/data/season/Season.java +++ b/gg-data/src/main/java/gg/data/pingpong/season/Season.java @@ -1,4 +1,4 @@ -package gg.data.season; +package gg.data.pingpong.season; import java.time.LocalDateTime; diff --git a/gg-data/src/main/java/gg/data/store/CoinHistory.java b/gg-data/src/main/java/gg/data/pingpong/store/CoinHistory.java similarity index 97% rename from gg-data/src/main/java/gg/data/store/CoinHistory.java rename to gg-data/src/main/java/gg/data/pingpong/store/CoinHistory.java index b1e3b731c..5c5f2317e 100644 --- a/gg-data/src/main/java/gg/data/store/CoinHistory.java +++ b/gg-data/src/main/java/gg/data/pingpong/store/CoinHistory.java @@ -1,4 +1,4 @@ -package gg.data.store; +package gg.data.pingpong.store; import java.time.LocalDateTime; diff --git a/gg-data/src/main/java/gg/data/store/CoinPolicy.java b/gg-data/src/main/java/gg/data/pingpong/store/CoinPolicy.java similarity index 98% rename from gg-data/src/main/java/gg/data/store/CoinPolicy.java rename to gg-data/src/main/java/gg/data/pingpong/store/CoinPolicy.java index 57bb6a20d..6f871bba0 100644 --- a/gg-data/src/main/java/gg/data/store/CoinPolicy.java +++ b/gg-data/src/main/java/gg/data/pingpong/store/CoinPolicy.java @@ -1,4 +1,4 @@ -package gg.data.store; +package gg.data.pingpong.store; import java.time.LocalDateTime; diff --git a/gg-data/src/main/java/gg/data/store/Item.java b/gg-data/src/main/java/gg/data/pingpong/store/Item.java similarity index 96% rename from gg-data/src/main/java/gg/data/store/Item.java rename to gg-data/src/main/java/gg/data/pingpong/store/Item.java index 4220eefa7..de159f830 100644 --- a/gg-data/src/main/java/gg/data/store/Item.java +++ b/gg-data/src/main/java/gg/data/pingpong/store/Item.java @@ -1,4 +1,4 @@ -package gg.data.store; +package gg.data.pingpong.store; import java.time.LocalDateTime; @@ -11,7 +11,7 @@ import javax.persistence.Id; import javax.validation.constraints.NotNull; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.type.ItemType; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/store/Megaphone.java b/gg-data/src/main/java/gg/data/pingpong/store/Megaphone.java similarity index 97% rename from gg-data/src/main/java/gg/data/store/Megaphone.java rename to gg-data/src/main/java/gg/data/pingpong/store/Megaphone.java index 6d2a82de3..251e13f2f 100644 --- a/gg-data/src/main/java/gg/data/store/Megaphone.java +++ b/gg-data/src/main/java/gg/data/pingpong/store/Megaphone.java @@ -1,4 +1,4 @@ -package gg.data.store; +package gg.data.pingpong.store; import java.time.LocalDate; diff --git a/gg-data/src/main/java/gg/data/store/Receipt.java b/gg-data/src/main/java/gg/data/pingpong/store/Receipt.java similarity index 95% rename from gg-data/src/main/java/gg/data/store/Receipt.java rename to gg-data/src/main/java/gg/data/pingpong/store/Receipt.java index d5d40cdad..7b6400758 100644 --- a/gg-data/src/main/java/gg/data/store/Receipt.java +++ b/gg-data/src/main/java/gg/data/pingpong/store/Receipt.java @@ -1,4 +1,4 @@ -package gg.data.store; +package gg.data.pingpong.store; import java.time.LocalDateTime; @@ -14,7 +14,7 @@ import javax.persistence.ManyToOne; import javax.validation.constraints.NotNull; -import gg.data.store.type.ItemStatus; +import gg.data.pingpong.store.type.ItemStatus; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/store/redis/MegaphoneRedis.java b/gg-data/src/main/java/gg/data/pingpong/store/redis/MegaphoneRedis.java similarity index 95% rename from gg-data/src/main/java/gg/data/store/redis/MegaphoneRedis.java rename to gg-data/src/main/java/gg/data/pingpong/store/redis/MegaphoneRedis.java index 36c922012..8a7f0e190 100644 --- a/gg-data/src/main/java/gg/data/store/redis/MegaphoneRedis.java +++ b/gg-data/src/main/java/gg/data/pingpong/store/redis/MegaphoneRedis.java @@ -1,4 +1,4 @@ -package gg.data.store.redis; +package gg.data.pingpong.store.redis; import java.time.LocalDateTime; diff --git a/gg-data/src/main/java/gg/data/store/type/HistoryType.java b/gg-data/src/main/java/gg/data/pingpong/store/type/HistoryType.java similarity index 88% rename from gg-data/src/main/java/gg/data/store/type/HistoryType.java rename to gg-data/src/main/java/gg/data/pingpong/store/type/HistoryType.java index 9a1ba6c83..206afe016 100644 --- a/gg-data/src/main/java/gg/data/store/type/HistoryType.java +++ b/gg-data/src/main/java/gg/data/pingpong/store/type/HistoryType.java @@ -1,4 +1,4 @@ -package gg.data.store.type; +package gg.data.pingpong.store.type; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/store/type/ItemStatus.java b/gg-data/src/main/java/gg/data/pingpong/store/type/ItemStatus.java similarity index 88% rename from gg-data/src/main/java/gg/data/store/type/ItemStatus.java rename to gg-data/src/main/java/gg/data/pingpong/store/type/ItemStatus.java index 31c47a1b7..1d7e00e4b 100644 --- a/gg-data/src/main/java/gg/data/store/type/ItemStatus.java +++ b/gg-data/src/main/java/gg/data/pingpong/store/type/ItemStatus.java @@ -1,4 +1,4 @@ -package gg.data.store.type; +package gg.data.pingpong.store.type; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/store/type/ItemType.java b/gg-data/src/main/java/gg/data/pingpong/store/type/ItemType.java similarity index 80% rename from gg-data/src/main/java/gg/data/store/type/ItemType.java rename to gg-data/src/main/java/gg/data/pingpong/store/type/ItemType.java index 920ab5d3a..ae156950f 100644 --- a/gg-data/src/main/java/gg/data/store/type/ItemType.java +++ b/gg-data/src/main/java/gg/data/pingpong/store/type/ItemType.java @@ -1,4 +1,4 @@ -package gg.data.store.type; +package gg.data.pingpong.store.type; import lombok.RequiredArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/tournament/Tournament.java b/gg-data/src/main/java/gg/data/pingpong/tournament/Tournament.java similarity index 96% rename from gg-data/src/main/java/gg/data/tournament/Tournament.java rename to gg-data/src/main/java/gg/data/pingpong/tournament/Tournament.java index 38b976fdb..80809bc92 100644 --- a/gg-data/src/main/java/gg/data/tournament/Tournament.java +++ b/gg-data/src/main/java/gg/data/pingpong/tournament/Tournament.java @@ -1,4 +1,4 @@ -package gg.data.tournament; +package gg.data.pingpong.tournament; import static gg.utils.exception.BusinessChecker.*; import static gg.utils.exception.ErrorCode.*; @@ -23,8 +23,8 @@ import javax.validation.constraints.NotNull; import gg.data.BaseTimeEntity; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.data.user.User; import lombok.AccessLevel; import lombok.Builder; diff --git a/gg-data/src/main/java/gg/data/tournament/TournamentGame.java b/gg-data/src/main/java/gg/data/pingpong/tournament/TournamentGame.java similarity index 92% rename from gg-data/src/main/java/gg/data/tournament/TournamentGame.java rename to gg-data/src/main/java/gg/data/pingpong/tournament/TournamentGame.java index c2d2166e5..4dd4ef495 100644 --- a/gg-data/src/main/java/gg/data/tournament/TournamentGame.java +++ b/gg-data/src/main/java/gg/data/pingpong/tournament/TournamentGame.java @@ -1,4 +1,4 @@ -package gg.data.tournament; +package gg.data.pingpong.tournament; import javax.persistence.Column; import javax.persistence.Entity; @@ -14,8 +14,8 @@ import javax.validation.constraints.NotNull; import gg.data.BaseTimeEntity; -import gg.data.game.Game; -import gg.data.tournament.type.TournamentRound; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.tournament.type.TournamentRound; import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; diff --git a/gg-data/src/main/java/gg/data/tournament/TournamentUser.java b/gg-data/src/main/java/gg/data/pingpong/tournament/TournamentUser.java similarity index 97% rename from gg-data/src/main/java/gg/data/tournament/TournamentUser.java rename to gg-data/src/main/java/gg/data/pingpong/tournament/TournamentUser.java index 2e7a7ef27..93df607f5 100644 --- a/gg-data/src/main/java/gg/data/tournament/TournamentUser.java +++ b/gg-data/src/main/java/gg/data/pingpong/tournament/TournamentUser.java @@ -1,4 +1,4 @@ -package gg.data.tournament; +package gg.data.pingpong.tournament; import java.time.LocalDateTime; diff --git a/gg-data/src/main/java/gg/data/tournament/type/RoundNumber.java b/gg-data/src/main/java/gg/data/pingpong/tournament/type/RoundNumber.java similarity index 85% rename from gg-data/src/main/java/gg/data/tournament/type/RoundNumber.java rename to gg-data/src/main/java/gg/data/pingpong/tournament/type/RoundNumber.java index ecbd44897..0d638dbfc 100644 --- a/gg-data/src/main/java/gg/data/tournament/type/RoundNumber.java +++ b/gg-data/src/main/java/gg/data/pingpong/tournament/type/RoundNumber.java @@ -1,4 +1,4 @@ -package gg.data.tournament.type; +package gg.data.pingpong.tournament.type; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/tournament/type/TournamentRound.java b/gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentRound.java similarity index 93% rename from gg-data/src/main/java/gg/data/tournament/type/TournamentRound.java rename to gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentRound.java index 8b868cb00..4c367996a 100644 --- a/gg-data/src/main/java/gg/data/tournament/type/TournamentRound.java +++ b/gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentRound.java @@ -1,6 +1,6 @@ -package gg.data.tournament.type; +package gg.data.pingpong.tournament.type; -import static gg.data.tournament.type.RoundNumber.*; +import static gg.data.pingpong.tournament.type.RoundNumber.*; import java.util.ArrayList; import java.util.List; diff --git a/gg-data/src/main/java/gg/data/tournament/type/TournamentStatus.java b/gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentStatus.java similarity index 94% rename from gg-data/src/main/java/gg/data/tournament/type/TournamentStatus.java rename to gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentStatus.java index 02ba48893..6722984f0 100644 --- a/gg-data/src/main/java/gg/data/tournament/type/TournamentStatus.java +++ b/gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentStatus.java @@ -1,4 +1,4 @@ -package gg.data.tournament.type; +package gg.data.pingpong.tournament.type; import java.util.Locale; diff --git a/gg-data/src/main/java/gg/data/tournament/type/TournamentType.java b/gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentType.java similarity index 94% rename from gg-data/src/main/java/gg/data/tournament/type/TournamentType.java rename to gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentType.java index 276830c5d..650c6ba57 100644 --- a/gg-data/src/main/java/gg/data/tournament/type/TournamentType.java +++ b/gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentType.java @@ -1,4 +1,4 @@ -package gg.data.tournament.type; +package gg.data.pingpong.tournament.type; import java.util.Locale; diff --git a/gg-data/src/main/java/gg/data/tournament/type/TournamentUserStatus.java b/gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentUserStatus.java similarity index 88% rename from gg-data/src/main/java/gg/data/tournament/type/TournamentUserStatus.java rename to gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentUserStatus.java index 2ef930740..64fb9a1b7 100644 --- a/gg-data/src/main/java/gg/data/tournament/type/TournamentUserStatus.java +++ b/gg-data/src/main/java/gg/data/pingpong/tournament/type/TournamentUserStatus.java @@ -1,4 +1,4 @@ -package gg.data.tournament.type; +package gg.data.pingpong.tournament.type; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/gg-data/src/main/java/gg/data/recruit/application/Application.java b/gg-data/src/main/java/gg/data/recruit/application/Application.java new file mode 100644 index 000000000..58624b88c --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/Application.java @@ -0,0 +1,42 @@ +package gg.data.recruit.application; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import gg.data.BaseTimeEntity; +import gg.data.recruit.application.enums.ApplicationStatus; +import gg.data.recruit.recruitment.Recruitments; +import gg.data.user.User; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Application extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id", nullable = false) + private User user; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "recruit_id", nullable = false) + private Recruitments recruitId; + + private Boolean isDeleted; + + @Enumerated(EnumType.STRING) + @Column(length = 15, nullable = false) + private ApplicationStatus status; +} diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java new file mode 100644 index 000000000..5f3279089 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java @@ -0,0 +1,31 @@ +package gg.data.recruit.application; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import gg.data.BaseTimeEntity; +import gg.data.recruit.recruitment.Question; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class ApplicationAnswer extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "question_id", nullable = false) + private Question questionId; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "application_id", nullable = false) + private Application applicationId; +} diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java new file mode 100644 index 000000000..58594f2c1 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java @@ -0,0 +1,29 @@ +package gg.data.recruit.application; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import gg.data.BaseTimeEntity; +import gg.data.recruit.recruitment.CheckList; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED) +public class ApplicationAnswerCheckList extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "application_answer_id", nullable = false) + private ApplicationAnswer applicationAnswerId; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "check_list_id", nullable = false) + private CheckList checkListId; +} diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java new file mode 100644 index 000000000..3da2b03d8 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java @@ -0,0 +1,28 @@ +package gg.data.recruit.application; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import gg.data.BaseTimeEntity; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED) +public class ApplicationAnswerText extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "application_answer_id", nullable = false) + private ApplicationAnswer applicationAnswerId; + + @Column(length = 1000) + private String answer; +} diff --git a/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java b/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java new file mode 100644 index 000000000..27c413246 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java @@ -0,0 +1,30 @@ +package gg.data.recruit.application; + +import java.time.LocalDateTime; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import gg.data.BaseTimeEntity; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class RecruitStatus extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "application_id", nullable = false) + private Application applicationId; + + private LocalDateTime interviewDate; +} diff --git a/gg-data/src/main/java/gg/data/recruit/application/enums/ApplicationStatus.java b/gg-data/src/main/java/gg/data/recruit/application/enums/ApplicationStatus.java new file mode 100644 index 000000000..f13f812e5 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/enums/ApplicationStatus.java @@ -0,0 +1,15 @@ +package gg.data.recruit.application.enums; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public enum ApplicationStatus { + + PROGRESS_DOCS("progress", "์„œ๋ฅ˜ ์ง„ํ–‰์ค‘"), + PROGRESS_INTERVIEW("progress", "๋ฉด์ ‘ ์ง„ํ–‰์ค‘"), + PASS("pass", "ํ•ฉ๊ฒฉ"), + FAIL("fail", "๋ถˆํ•ฉ๊ฒฉ"); + + private final String status; + private final String desc; +} diff --git a/gg-data/src/main/java/gg/data/recruit/manage/ResultMessage.java b/gg-data/src/main/java/gg/data/recruit/manage/ResultMessage.java new file mode 100644 index 000000000..723994ff5 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/manage/ResultMessage.java @@ -0,0 +1,32 @@ +package gg.data.recruit.manage; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +import gg.data.BaseTimeEntity; +import gg.data.recruit.manage.enums.MessageType; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class ResultMessage extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(length = 100) + private String content; + + @Column(length = 15, nullable = false) + @Enumerated(EnumType.STRING) + private MessageType messageType; + + private Boolean isUse; +} diff --git a/gg-data/src/main/java/gg/data/recruit/manage/enums/MessageType.java b/gg-data/src/main/java/gg/data/recruit/manage/enums/MessageType.java new file mode 100644 index 000000000..96241d696 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/manage/enums/MessageType.java @@ -0,0 +1,14 @@ +package gg.data.recruit.manage.enums; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public enum MessageType { + + INTERVIEW("interview", "๋ฉด์ ‘ ์•ˆ๋‚ด"), + PASS("pass", "ํ•ฉ๊ฒฉ ์•ˆ๋‚ด"), + FAIL("fail", "๋ถˆํ•ฉ๊ฒฉ ์•ˆ๋‚ด"); + + private final String messageType; + private final String desc; +} diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java b/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java new file mode 100644 index 000000000..844fa183f --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java @@ -0,0 +1,30 @@ +package gg.data.recruit.recruitment; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import gg.data.BaseTimeEntity; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class CheckList extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "question_id", nullable = false) + private Question questionId; + + @Column(length = 100) + private String content; +} diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java new file mode 100644 index 000000000..67f0824a8 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java @@ -0,0 +1,39 @@ +package gg.data.recruit.recruitment; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import gg.data.BaseTimeEntity; +import gg.data.recruit.recruitment.enums.InputType; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Question extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "recruit_id", nullable = false) + private Recruitments recruitId; + + @Enumerated(EnumType.STRING) + @Column(length = 20, nullable = false) + private InputType inputType; + + @Column(length = 300) + private String question; + + private int sortNum; + +} diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java new file mode 100644 index 000000000..1e6f5c48b --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java @@ -0,0 +1,39 @@ +package gg.data.recruit.recruitment; + +import java.time.LocalDateTime; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +import gg.data.BaseTimeEntity; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Recruitments extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String title; + + @Column(length = 3000) + private String contents; + + @Column(length = 50) + private String generation; + + private Boolean isFinish; + + private Boolean isDeleted; + + @Column(nullable = false) + private LocalDateTime startTime; + @Column(nullable = false) + + private LocalDateTime endTime; +} diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/enums/InputType.java b/gg-data/src/main/java/gg/data/recruit/recruitment/enums/InputType.java new file mode 100644 index 000000000..4ede99473 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/enums/InputType.java @@ -0,0 +1,12 @@ +package gg.data.recruit.recruitment.enums; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public enum InputType { + + TEXT("text", "ํ…์ŠคํŠธ"), + CHECK_LIST("checkList", "์ฒดํฌ๋ฆฌ์ŠคํŠธ"); + private final String type; + private final String desc; +} diff --git a/gg-data/src/test/java/gg/data/tournament/TournamentUnitTest.java b/gg-data/src/test/java/gg/data/pingpong/tournament/TournamentUnitTest.java similarity index 98% rename from gg-data/src/test/java/gg/data/tournament/TournamentUnitTest.java rename to gg-data/src/test/java/gg/data/pingpong/tournament/TournamentUnitTest.java index 555bc1bde..911b4c7b9 100644 --- a/gg-data/src/test/java/gg/data/tournament/TournamentUnitTest.java +++ b/gg-data/src/test/java/gg/data/pingpong/tournament/TournamentUnitTest.java @@ -1,4 +1,4 @@ -package gg.data.tournament; +package gg.data.pingpong.tournament; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; @@ -16,8 +16,8 @@ import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.data.user.User; import gg.utils.annotation.UnitTest; import gg.utils.exception.ErrorCode; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/dto/GameLogAdminDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/dto/GameLogAdminDto.java index 52f622d4c..d70f105fe 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/dto/GameLogAdminDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/dto/GameLogAdminDto.java @@ -4,7 +4,7 @@ import java.time.LocalDateTime; import gg.admin.repo.game.out.GameTeamUser; -import gg.data.game.type.StatusType; +import gg.data.pingpong.game.type.StatusType; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/service/GameAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/service/GameAdminService.java index 26e581a1d..477a1637f 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/service/GameAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/service/GameAdminService.java @@ -20,13 +20,13 @@ import gg.admin.repo.game.out.GameTeamUser; import gg.admin.repo.season.SeasonAdminRepository; import gg.admin.repo.user.UserAdminRepository; -import gg.data.game.Game; -import gg.data.game.PChange; -import gg.data.game.TeamUser; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.PChange; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.admin.game.controller.response.GameLogListAdminResponseDto; import gg.pingpong.api.admin.game.dto.GameLogAdminDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/dto/SlotAdminDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/dto/SlotAdminDto.java index 2fbc5ad5b..3e16e0046 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/dto/SlotAdminDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/dto/SlotAdminDto.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import gg.data.manage.SlotManagement; +import gg.data.pingpong.manage.SlotManagement; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/service/SlotAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/service/SlotAdminService.java index fbb735a00..7896d1a95 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/service/SlotAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/service/SlotAdminService.java @@ -8,7 +8,7 @@ import org.springframework.transaction.annotation.Transactional; import gg.admin.repo.manage.AdminSlotManagementsRepository; -import gg.data.manage.SlotManagement; +import gg.data.pingpong.manage.SlotManagement; import gg.pingpong.api.admin.manage.controller.request.SlotCreateRequestDto; import gg.pingpong.api.admin.manage.controller.response.SlotListAdminResponseDto; import gg.pingpong.api.admin.manage.dto.SlotAdminDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/rank/service/RankAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/rank/service/RankAdminService.java index eef02cdc5..e015a440c 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/rank/service/RankAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/rank/service/RankAdminService.java @@ -10,9 +10,9 @@ import org.springframework.transaction.annotation.Transactional; import gg.admin.repo.user.UserAdminRepository; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.season.Season; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.admin.season.dto.SeasonAdminDto; import gg.repo.rank.RankRepository; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/rank/service/RankRedisAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/rank/service/RankRedisAdminService.java index 1c903d6ad..9d35e80de 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/rank/service/RankRedisAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/rank/service/RankRedisAdminService.java @@ -7,8 +7,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; import gg.data.user.User; import gg.pingpong.api.admin.season.dto.SeasonAdminDto; import gg.repo.rank.TierRepository; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/controller/request/SeasonCreateRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/controller/request/SeasonCreateRequestDto.java index 484f5a65d..c89f9ef23 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/controller/request/SeasonCreateRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/controller/request/SeasonCreateRequestDto.java @@ -7,7 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/dto/SeasonAdminDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/dto/SeasonAdminDto.java index b65c3070d..5d1f21c16 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/dto/SeasonAdminDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/dto/SeasonAdminDto.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import gg.pingpong.api.admin.season.type.SeasonStatus; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/service/SeasonAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/service/SeasonAdminService.java index 639439fe2..24f6fcffe 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/service/SeasonAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/season/service/SeasonAdminService.java @@ -8,7 +8,7 @@ import org.springframework.transaction.annotation.Transactional; import gg.admin.repo.season.SeasonAdminRepository; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import gg.pingpong.api.admin.rank.service.RankAdminService; import gg.pingpong.api.admin.rank.service.RankRedisAdminService; import gg.pingpong.api.admin.season.controller.request.SeasonCreateRequestDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/request/ItemUpdateRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/request/ItemUpdateRequestDto.java index 8b48862db..8b6acb88e 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/request/ItemUpdateRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/request/ItemUpdateRequestDto.java @@ -4,8 +4,8 @@ import javax.validation.constraints.NotNull; -import gg.data.store.Item; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.type.ItemType; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/CoinPolicyAdminResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/CoinPolicyAdminResponseDto.java index c6370a3b2..9203e0ca8 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/CoinPolicyAdminResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/CoinPolicyAdminResponseDto.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import gg.data.store.CoinPolicy; +import gg.data.pingpong.store.CoinPolicy; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/ItemHistoryResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/ItemHistoryResponseDto.java index 5855e6766..89dd7ac8c 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/ItemHistoryResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/ItemHistoryResponseDto.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import gg.data.store.Item; +import gg.data.pingpong.store.Item; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/MegaphoneAdminResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/MegaphoneAdminResponseDto.java index e09f2633a..536466abd 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/MegaphoneAdminResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/MegaphoneAdminResponseDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.admin.store.controller.response; -import gg.data.store.Megaphone; +import gg.data.pingpong.store.Megaphone; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/ReceiptResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/ReceiptResponseDto.java index 026f4f448..0ffecc3df 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/ReceiptResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/response/ReceiptResponseDto.java @@ -2,9 +2,9 @@ import java.time.LocalDateTime; -import gg.data.store.Item; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/CoinAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/CoinAdminService.java index 6a52d9781..8f9c67094 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/CoinAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/CoinAdminService.java @@ -3,7 +3,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.store.CoinHistory; +import gg.data.pingpong.store.CoinHistory; import gg.data.user.User; import gg.pingpong.api.admin.store.controller.request.CoinUpdateRequestDto; import gg.pingpong.api.user.store.service.CoinHistoryService; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/CoinPolicyAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/CoinPolicyAdminService.java index b0644ae52..a8e824187 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/CoinPolicyAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/CoinPolicyAdminService.java @@ -7,7 +7,7 @@ import gg.admin.repo.store.CoinPolicyAdminRepository; import gg.admin.repo.user.UserAdminRepository; -import gg.data.store.CoinPolicy; +import gg.data.pingpong.store.CoinPolicy; import gg.data.user.User; import gg.pingpong.api.admin.store.controller.response.CoinPolicyAdminListResponseDto; import gg.pingpong.api.admin.store.controller.response.CoinPolicyAdminResponseDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/ItemAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/ItemAdminService.java index 363aded6b..17aaf8415 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/ItemAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/ItemAdminService.java @@ -9,7 +9,7 @@ import org.springframework.web.multipart.MultipartFile; import gg.admin.repo.store.ItemAdminRepository; -import gg.data.store.Item; +import gg.data.pingpong.store.Item; import gg.pingpong.api.admin.store.controller.request.ItemUpdateRequestDto; import gg.pingpong.api.admin.store.controller.response.ItemHistoryResponseDto; import gg.pingpong.api.admin.store.controller.response.ItemListResponseDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/ReceiptAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/ReceiptAdminService.java index 560a3510c..8b7a76c2d 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/ReceiptAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/service/ReceiptAdminService.java @@ -6,7 +6,7 @@ import org.springframework.transaction.annotation.Transactional; import gg.admin.repo.store.ReceiptAdminRepository; -import gg.data.store.Receipt; +import gg.data.pingpong.store.Receipt; import gg.pingpong.api.admin.store.controller.response.ReceiptListResponseDto; import gg.pingpong.api.admin.store.controller.response.ReceiptResponseDto; import lombok.RequiredArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/controller/request/TournamentAdminCreateRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/controller/request/TournamentAdminCreateRequestDto.java index f31951cbc..9fdc726ea 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/controller/request/TournamentAdminCreateRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/controller/request/TournamentAdminCreateRequestDto.java @@ -7,7 +7,7 @@ import org.hibernate.validator.constraints.Length; import org.springframework.format.annotation.DateTimeFormat; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.type.TournamentType; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/controller/request/TournamentAdminUpdateRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/controller/request/TournamentAdminUpdateRequestDto.java index 6121e4722..58c9777c2 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/controller/request/TournamentAdminUpdateRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/controller/request/TournamentAdminUpdateRequestDto.java @@ -8,7 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat.ISO; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.type.TournamentType; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/service/TournamentAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/service/TournamentAdminService.java index 09385a366..d7467a8d4 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/service/TournamentAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/tournament/service/TournamentAdminService.java @@ -1,6 +1,6 @@ package gg.pingpong.api.admin.tournament.service; -import static gg.data.match.type.TournamentMatchStatus.*; +import static gg.data.pingpong.match.type.TournamentMatchStatus.*; import java.time.LocalDate; import java.time.LocalDateTime; @@ -10,17 +10,17 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.game.type.StatusType; -import gg.data.manage.SlotManagement; -import gg.data.match.type.TournamentMatchStatus; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.type.TournamentMatchStatus; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; import gg.data.user.User; import gg.pingpong.api.admin.tournament.controller.request.TournamentAdminAddUserRequestDto; import gg.pingpong.api.admin.tournament.controller.request.TournamentAdminCreateRequestDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/response/UserDetailAdminResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/response/UserDetailAdminResponseDto.java index 09a1ead42..007c8b280 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/response/UserDetailAdminResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/response/UserDetailAdminResponseDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.admin.user.controller.response; -import gg.data.rank.redis.RankRedis; +import gg.data.pingpong.rank.redis.RankRedis; import gg.data.user.User; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/service/UserAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/service/UserAdminService.java index f56d50271..7362c8ec1 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/service/UserAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/service/UserAdminService.java @@ -14,9 +14,9 @@ import gg.admin.repo.season.SeasonAdminRepository; import gg.admin.repo.user.UserAdminRepository; import gg.admin.repo.user.UserImageAdminRepository; -import gg.data.rank.Rank; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.data.user.UserImage; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/security/service/CustomOAuth2UserService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/security/service/CustomOAuth2UserService.java index 3976762b5..288d049d4 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/security/service/CustomOAuth2UserService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/security/service/CustomOAuth2UserService.java @@ -12,9 +12,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.SnsType; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/utils/ItemImageHandler.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/utils/ItemImageHandler.java index 5b87aacc4..cd61914f0 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/utils/ItemImageHandler.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/utils/ItemImageHandler.java @@ -13,7 +13,7 @@ import com.amazonaws.services.s3.model.ObjectMetadata; import com.amazonaws.services.s3.model.PutObjectRequest; -import gg.data.store.Item; +import gg.data.pingpong.store.Item; @Component public class ItemImageHandler { diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/utils/aws/AsyncNewItemImageUploader.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/utils/aws/AsyncNewItemImageUploader.java index fafc55d89..341643928 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/utils/aws/AsyncNewItemImageUploader.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/utils/aws/AsyncNewItemImageUploader.java @@ -7,7 +7,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import gg.data.store.Item; +import gg.data.pingpong.store.Item; import gg.pingpong.api.global.utils.ItemImageHandler; @Component diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/GameController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/GameController.java index b8138959c..920ee1d04 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/GameController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/GameController.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import gg.data.game.type.Mode; +import gg.data.pingpong.game.type.Mode; import gg.pingpong.api.global.utils.argumentresolver.Login; import gg.pingpong.api.user.game.controller.request.GameListReqDto; import gg.pingpong.api.user.game.controller.request.NormalGameListReqDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/request/GameListReqDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/request/GameListReqDto.java index 0ec4e79aa..b1a5a5cdf 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/request/GameListReqDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/request/GameListReqDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.game.controller.request; -import gg.data.game.type.StatusType; +import gg.data.pingpong.game.type.StatusType; import lombok.Getter; @Getter diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/response/GameResultResDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/response/GameResultResDto.java index 77e51ae73..1235d9176 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/response/GameResultResDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/response/GameResultResDto.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; -import gg.data.game.type.Mode; +import gg.data.pingpong.game.type.Mode; import gg.pingpong.api.user.game.dto.TeamUserInfoDto; import gg.pingpong.api.user.game.dto.TeamUserListDto; import gg.repo.game.out.GameTeamUser; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/dto/GameTeamInfo.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/dto/GameTeamInfo.java index e0016a67d..50f2f2255 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/dto/GameTeamInfo.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/dto/GameTeamInfo.java @@ -3,8 +3,8 @@ import java.time.LocalDateTime; import java.util.List; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; import gg.repo.game.out.GameTeamUserInfo; import gg.utils.exception.game.GameDataConsistencyException; import lombok.Getter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameFindService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameFindService.java index caaf78c60..d2a920fc4 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameFindService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameFindService.java @@ -10,9 +10,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; import gg.pingpong.api.user.game.controller.response.GameListResDto; import gg.pingpong.api.user.game.controller.response.GameResultResDto; import gg.repo.game.GameRepository; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameService.java index 9f9fba0ab..e3434c3d9 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameService.java @@ -8,15 +8,15 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.PChange; -import gg.data.game.TeamUser; -import gg.data.game.type.StatusType; -import gg.data.match.type.TournamentMatchStatus; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.RoundNumber; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.PChange; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.match.type.TournamentMatchStatus; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.RoundNumber; import gg.pingpong.api.global.utils.ExpLevelCalculator; import gg.pingpong.api.user.game.controller.request.NormalResultReqDto; import gg.pingpong.api.user.game.controller.request.RankResultReqDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameStatusService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameStatusService.java index 987541416..4ed79f92c 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameStatusService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/GameStatusService.java @@ -8,11 +8,11 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.type.StatusType; -import gg.data.manage.SlotManagement; import gg.data.noti.Noti; import gg.data.noti.type.NotiType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.manage.SlotManagement; import gg.pingpong.api.user.noti.dto.UserNotiDto; import gg.pingpong.api.user.noti.service.NotiService; import gg.pingpong.api.user.noti.service.SnsNotiService; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/PChangeService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/PChangeService.java index 53150d946..3f01c1398 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/PChangeService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/service/PChangeService.java @@ -5,8 +5,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.PChange; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.PChange; import gg.data.user.User; import gg.repo.game.PChangeRepository; import gg.utils.exception.pchange.PChangeNotExistException; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/controller/MatchController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/controller/MatchController.java index f515312ba..10d0336e2 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/controller/MatchController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/controller/MatchController.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import gg.data.match.type.Option; +import gg.data.pingpong.match.type.Option; import gg.pingpong.api.global.utils.argumentresolver.Login; import gg.pingpong.api.user.match.controller.request.MatchRequestDto; import gg.pingpong.api.user.match.controller.response.MatchStatusResponseListDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/controller/request/MatchRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/controller/request/MatchRequestDto.java index 46f588629..1802e316c 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/controller/request/MatchRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/controller/request/MatchRequestDto.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; -import gg.data.match.type.Option; +import gg.data.pingpong.match.type.Option; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/GameAddDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/GameAddDto.java index 2938b7b14..369e222ae 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/GameAddDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/GameAddDto.java @@ -3,10 +3,10 @@ import java.time.LocalDateTime; import java.util.List; -import gg.data.game.type.Mode; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.Option; -import gg.data.season.Season; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.Option; +import gg.data.pingpong.season.Season; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/MatchStatusDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/MatchStatusDto.java index 62f813079..fff3a5b6d 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/MatchStatusDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/MatchStatusDto.java @@ -5,10 +5,10 @@ import com.fasterxml.jackson.annotation.JsonFormat; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.manage.SlotManagement; -import gg.data.match.RedisMatchTime; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.RedisMatchTime; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/SlotStatusDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/SlotStatusDto.java index dbab08775..c831b42d7 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/SlotStatusDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/dto/SlotStatusDto.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; -import gg.data.match.type.SlotStatus; +import gg.data.pingpong.match.type.SlotStatus; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/GameUpdateService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/GameUpdateService.java index 90753d0ab..1c3002a06 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/GameUpdateService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/GameUpdateService.java @@ -5,11 +5,11 @@ import org.springframework.stereotype.Service; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.manage.SlotManagement; import gg.data.noti.Noti; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.manage.SlotManagement; import gg.data.user.User; import gg.pingpong.api.user.match.dto.GameAddDto; import gg.pingpong.api.user.noti.service.NotiService; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchFindService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchFindService.java index 0b928053b..3a1567bd8 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchFindService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchFindService.java @@ -10,15 +10,15 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.type.StatusType; -import gg.data.manage.SlotManagement; -import gg.data.match.RedisMatchTime; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.Option; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.RedisMatchTime; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.Option; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.data.user.type.RoleType; import gg.pingpong.api.user.match.controller.response.MatchStatusResponseListDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchService.java index 42993ffcb..456d15227 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchService.java @@ -9,16 +9,16 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.match.RedisMatchTime; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.Option; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.type.TournamentStatus; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.match.RedisMatchTime; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.Option; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.type.TournamentStatus; import gg.data.user.User; import gg.pingpong.api.user.manage.service.PenaltyService; import gg.pingpong.api.user.match.dto.GameAddDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchTournamentService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchTournamentService.java index 1b03f19b5..5afbf150b 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchTournamentService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/service/MatchTournamentService.java @@ -1,7 +1,7 @@ package gg.pingpong.api.user.match.service; -import static gg.data.match.type.TournamentMatchStatus.*; -import static gg.data.tournament.type.RoundNumber.*; +import static gg.data.pingpong.match.type.TournamentMatchStatus.*; +import static gg.data.pingpong.tournament.type.RoundNumber.*; import java.time.LocalDateTime; import java.util.ArrayList; @@ -16,21 +16,21 @@ import org.springframework.stereotype.Service; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.manage.SlotManagement; -import gg.data.match.type.TournamentMatchStatus; import gg.data.noti.type.NotiType; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.RoundNumber; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.type.TournamentMatchStatus; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.RoundNumber; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; import gg.data.user.User; import gg.pingpong.api.admin.noti.controller.request.SendNotiAdminRequestDto; import gg.pingpong.api.admin.noti.service.NotiAdminService; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/utils/MatchCalculator.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/utils/MatchCalculator.java index 413bb987e..e34dbb94a 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/utils/MatchCalculator.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/utils/MatchCalculator.java @@ -3,9 +3,9 @@ import java.util.List; import java.util.Optional; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.Option; -import gg.data.match.type.SlotStatus; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.Option; +import gg.data.pingpong.match.type.SlotStatus; public class MatchCalculator { private final Integer pppGap; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/utils/SlotGenerator.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/utils/SlotGenerator.java index da68bcb16..0622b4ebe 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/utils/SlotGenerator.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/match/utils/SlotGenerator.java @@ -6,15 +6,15 @@ import java.util.List; import java.util.Set; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.manage.SlotManagement; -import gg.data.match.RedisMatchTime; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.Option; -import gg.data.match.type.SlotStatus; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.RedisMatchTime; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.Option; +import gg.data.pingpong.match.type.SlotStatus; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.pingpong.api.user.match.controller.response.SlotStatusResponseListDto; import gg.pingpong.api.user.match.dto.SlotStatusDto; import lombok.Getter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/dto/RankDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/dto/RankDto.java index ca045c620..854c4b1a2 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/dto/RankDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/dto/RankDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.rank.dto; -import gg.data.rank.redis.RankRedis; +import gg.data.pingpong.rank.redis.RankRedis; import gg.data.user.User; import gg.repo.rank.RankV2Dto; import lombok.AllArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/redis/RankRedisService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/redis/RankRedisService.java index 945a9d3e4..56768c8ff 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/redis/RankRedisService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/redis/RankRedisService.java @@ -8,12 +8,12 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.TeamUser; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.pingpong.api.global.utils.EloRating; import gg.pingpong.api.user.game.service.PChangeService; import gg.pingpong.api.user.season.service.SeasonFindService; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/redis/RedisUploadService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/redis/RedisUploadService.java index e494a6255..a16fbd540 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/redis/RedisUploadService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/redis/RedisUploadService.java @@ -11,7 +11,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.rank.redis.RankRedis; +import gg.data.pingpong.rank.redis.RankRedis; import gg.repo.rank.RankRepository; import gg.repo.rank.redis.RankRedisRepository; import gg.repo.season.SeasonRepository; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/RankFindService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/RankFindService.java index 5ad1053dd..f339eadc4 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/RankFindService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/RankFindService.java @@ -2,7 +2,7 @@ import org.springframework.stereotype.Service; -import gg.data.rank.Rank; +import gg.data.pingpong.rank.Rank; import gg.repo.rank.RankRepository; import gg.utils.exception.rank.RankNotFoundException; import lombok.RequiredArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/RankService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/RankService.java index affb950d5..0add526c8 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/RankService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/RankService.java @@ -11,8 +11,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.user.rank.controller.response.ExpRankPageResponseDto; import gg.pingpong.api.user.rank.controller.response.RankPageResponseDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/TierService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/TierService.java index f692dd0cb..9253e3af0 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/TierService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/service/TierService.java @@ -6,9 +6,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.season.Season; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.season.Season; import gg.repo.rank.RankRepository; import gg.repo.rank.TierRepository; import lombok.RequiredArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/controller/response/SeasonResDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/controller/response/SeasonResDto.java index 9b86af272..aee16d5aa 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/controller/response/SeasonResDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/controller/response/SeasonResDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.season.controller.response; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/dto/CurSeason.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/dto/CurSeason.java index e171e925b..44c3dddf9 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/dto/CurSeason.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/dto/CurSeason.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import lombok.Getter; @Getter diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/service/SeasonFindService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/service/SeasonFindService.java index 766376a37..3f20659df 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/service/SeasonFindService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/season/service/SeasonFindService.java @@ -5,8 +5,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.season.Season; import gg.repo.game.GameRepository; import gg.repo.season.SeasonRepository; import gg.utils.exception.game.GameNotExistException; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/ItemStoreResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/ItemStoreResponseDto.java index 619125bc3..645635b0a 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/ItemStoreResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/ItemStoreResponseDto.java @@ -1,7 +1,7 @@ package gg.pingpong.api.user.store.controller.response; -import gg.data.store.Item; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.type.ItemType; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/MegaphoneDetailResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/MegaphoneDetailResponseDto.java index 4b9d4b0b9..5d47f0e7c 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/MegaphoneDetailResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/MegaphoneDetailResponseDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.store.controller.response; -import gg.data.store.Megaphone; +import gg.data.pingpong.store.Megaphone; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/MegaphoneTodayListResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/MegaphoneTodayListResponseDto.java index 6cc63351a..2c213eb78 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/MegaphoneTodayListResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/MegaphoneTodayListResponseDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.store.controller.response; -import gg.data.store.redis.MegaphoneRedis; +import gg.data.pingpong.store.redis.MegaphoneRedis; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/UserItemResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/UserItemResponseDto.java index 43a4a31ca..84597a665 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/UserItemResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/response/UserItemResponseDto.java @@ -1,9 +1,9 @@ package gg.pingpong.api.user.store.controller.response; -import gg.data.store.Item; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; +import gg.data.pingpong.store.type.ItemType; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/redis/MegaphoneRedisRepository.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/redis/MegaphoneRedisRepository.java index 564cd7848..7d06098fd 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/redis/MegaphoneRedisRepository.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/redis/MegaphoneRedisRepository.java @@ -6,7 +6,7 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Repository; -import gg.data.store.redis.MegaphoneRedis; +import gg.data.pingpong.store.redis.MegaphoneRedis; import lombok.RequiredArgsConstructor; @Repository diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/CoinHistoryService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/CoinHistoryService.java index 530ad372c..ce28f84ae 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/CoinHistoryService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/CoinHistoryService.java @@ -5,9 +5,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.store.CoinHistory; -import gg.data.store.Item; -import gg.data.store.type.HistoryType; +import gg.data.pingpong.store.CoinHistory; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.type.HistoryType; import gg.data.user.User; import gg.repo.store.CoinHistoryRepository; import gg.repo.store.CoinPolicyRepository; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/ItemService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/ItemService.java index 6df2287e1..59b65f0ac 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/ItemService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/ItemService.java @@ -9,10 +9,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.store.Item; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; +import gg.data.pingpong.store.type.ItemType; import gg.data.user.User; import gg.data.user.type.RoleType; import gg.pingpong.api.user.noti.service.NotiService; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/MegaphoneService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/MegaphoneService.java index b478ed9dd..efe6d750f 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/MegaphoneService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/MegaphoneService.java @@ -9,11 +9,11 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.store.Megaphone; -import gg.data.store.Receipt; -import gg.data.store.redis.MegaphoneRedis; -import gg.data.store.type.ItemStatus; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Megaphone; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.redis.MegaphoneRedis; +import gg.data.pingpong.store.type.ItemStatus; +import gg.data.pingpong.store.type.ItemType; import gg.data.user.User; import gg.data.user.type.RoleType; import gg.pingpong.api.user.store.controller.request.MegaphoneUseRequestDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/UserCoinChangeService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/UserCoinChangeService.java index e0bbe3ad6..e8358f9db 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/UserCoinChangeService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/service/UserCoinChangeService.java @@ -5,9 +5,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.store.Item; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.store.Item; import gg.data.user.User; import gg.pingpong.api.user.game.service.GameFindService; import gg.pingpong.api.user.store.dto.UserGameCoinResultDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/request/TournamentFilterRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/request/TournamentFilterRequestDto.java index a0f1d7621..cfbcd9722 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/request/TournamentFilterRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/request/TournamentFilterRequestDto.java @@ -1,7 +1,7 @@ package gg.pingpong.api.user.tournament.controller.request; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.pingpong.api.global.dto.PageRequestDto; import lombok.Getter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentGameResDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentGameResDto.java index 246488cc0..364d0c49a 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentGameResDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentGameResDto.java @@ -1,7 +1,7 @@ package gg.pingpong.api.user.tournament.controller.response; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.TournamentRound; import gg.pingpong.api.user.game.controller.response.GameResultResDto; import gg.repo.game.out.GameTeamUser; import lombok.AccessLevel; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentResponseDto.java index 2a10b819e..6a5b14322 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentResponseDto.java @@ -2,10 +2,10 @@ import java.time.LocalDateTime; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.pingpong.api.user.user.dto.UserImageDto; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserListResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserListResponseDto.java index 818afd763..5f98bca9e 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserListResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserListResponseDto.java @@ -4,7 +4,7 @@ import java.util.Comparator; import java.util.List; -import gg.data.tournament.TournamentUser; +import gg.data.pingpong.tournament.TournamentUser; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserRegistrationResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserRegistrationResponseDto.java index 5858017cb..dfcba4508 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserRegistrationResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserRegistrationResponseDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.tournament.controller.response; -import gg.data.tournament.type.TournamentUserStatus; +import gg.data.pingpong.tournament.type.TournamentUserStatus; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserResponseDto.java index acb5f83ae..bc6ab8e8b 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/response/TournamentUserResponseDto.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import gg.data.tournament.TournamentUser; +import gg.data.pingpong.tournament.TournamentUser; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/service/TournamentService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/service/TournamentService.java index 854e3b995..48b2f8874 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/service/TournamentService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/service/TournamentService.java @@ -15,14 +15,14 @@ import org.springframework.transaction.annotation.Transactional; import gg.data.noti.type.NotiType; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.RoundNumber; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; -import gg.data.tournament.type.TournamentUserStatus; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.RoundNumber; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; +import gg.data.pingpong.tournament.type.TournamentUserStatus; import gg.data.user.User; import gg.pingpong.api.admin.noti.controller.request.SendNotiAdminRequestDto; import gg.pingpong.api.admin.noti.service.NotiAdminService; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/UserController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/UserController.java index 3afc31df1..b8317aaac 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/UserController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/UserController.java @@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; -import gg.data.game.type.Mode; +import gg.data.pingpong.game.type.Mode; import gg.data.user.type.OauthType; import gg.data.user.type.RoleType; import gg.pingpong.api.global.dto.PageRequestDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/CoinHistoryResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/CoinHistoryResponseDto.java index 8fc5badb6..cf195b575 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/CoinHistoryResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/CoinHistoryResponseDto.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import gg.data.store.CoinHistory; +import gg.data.pingpong.store.CoinHistory; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/UserDetailResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/UserDetailResponseDto.java index 9ed2874b5..806d2f592 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/UserDetailResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/UserDetailResponseDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.user.controller.response; -import gg.data.rank.Tier; +import gg.data.pingpong.rank.Tier; import gg.data.user.User; import gg.data.user.type.BackgroundType; import gg.data.user.type.EdgeType; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/UserLiveResponseDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/UserLiveResponseDto.java index 780d552f6..0e5a9e5b2 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/UserLiveResponseDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/response/UserLiveResponseDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.user.controller.response; -import gg.data.game.type.Mode; +import gg.data.pingpong.game.type.Mode; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/dto/UserHistoryData.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/dto/UserHistoryData.java index 6648c9f6b..2766868fb 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/dto/UserHistoryData.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/dto/UserHistoryData.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import gg.data.game.PChange; +import gg.data.pingpong.game.PChange; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserCoinService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserCoinService.java index afa6c7408..1fd993319 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserCoinService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserCoinService.java @@ -5,7 +5,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.store.CoinHistory; +import gg.data.pingpong.store.CoinHistory; import gg.data.user.User; import gg.pingpong.api.user.user.controller.response.CoinHistoryResponseDto; import gg.pingpong.api.user.user.controller.response.UserCoinHistoryListResponseDto; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserFindService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserFindService.java index 0f6f6a7d6..0d2b9ca7f 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserFindService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserFindService.java @@ -5,8 +5,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.user.season.service.SeasonFindService; import gg.repo.rank.redis.RankRedisRepository; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserService.java index eeae4bcdc..e4f178d64 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/service/UserService.java @@ -16,16 +16,16 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; -import gg.data.game.Game; -import gg.data.game.PChange; -import gg.data.game.type.StatusType; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; -import gg.data.store.type.ItemType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.PChange; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; +import gg.data.pingpong.store.type.ItemType; import gg.data.user.User; import gg.data.user.UserImage; import gg.data.user.type.BackgroundType; diff --git a/gg-pingpong-api/src/main/resources/db/migration/V2__recruit.sql b/gg-pingpong-api/src/main/resources/db/migration/V2__recruit.sql new file mode 100644 index 000000000..c0ed19add --- /dev/null +++ b/gg-pingpong-api/src/main/resources/db/migration/V2__recruit.sql @@ -0,0 +1,112 @@ +CREATE TABLE `recruitments` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `contents` varchar(3000) DEFAULT NULL, + `end_time` datetime(6) NOT NULL, + `generation` varchar(50) DEFAULT NULL, + `is_deleted` bit(1) DEFAULT false, + `is_finish` bit(1) DEFAULT false, + `start_time` datetime(6) NOT NULL, + `title` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `application` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `is_deleted` bit(1) DEFAULT false, + `status` varchar(15) NOT NULL , + `recruit_id` bigint NOT NULL , + `user_id` bigint NOT NULL , + PRIMARY KEY (`id`), + KEY `FKnmih1vdymw1494hdj04in2e5h` (`recruit_id`), + KEY `FKldca8xj6lqb3rsqawrowmkqbg` (`user_id`), + CONSTRAINT `FKldca8xj6lqb3rsqawrowmkqbg` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`), + CONSTRAINT `FKnmih1vdymw1494hdj04in2e5h` FOREIGN KEY (`recruit_id`) REFERENCES `recruitments` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `question` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `input_type` varchar(20) NOT NULL, + `question` varchar(300) DEFAULT NULL, + `sort_num` int NOT NULL, + `recruit_id` bigint NOT NULL , + PRIMARY KEY (`id`), + KEY `FK44dkmx1sa8ssxjd7u5ne0ti30` (`recruit_id`), + CONSTRAINT `FK44dkmx1sa8ssxjd7u5ne0ti30` FOREIGN KEY (`recruit_id`) REFERENCES `recruitments` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `application_answer` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `application_id` bigint NOT NULL , + `question_id` bigint NOT NULL , + PRIMARY KEY (`id`), + KEY `FKn2ayp7tptdv0yycdqkp2hcm63` (`application_id`), + KEY `FK59sj9jdfki14kkp34kc2jdhyj` (`question_id`), + CONSTRAINT `FK59sj9jdfki14kkp34kc2jdhyj` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), + CONSTRAINT `FKn2ayp7tptdv0yycdqkp2hcm63` FOREIGN KEY (`application_id`) REFERENCES `application` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `check_list` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `content` varchar(100) DEFAULT NULL, + `question_id` bigint NOT NULL, + PRIMARY KEY (`id`), + KEY `FKksl9r4adqk1aih1fn5kihxh7b` (`question_id`), + CONSTRAINT `FKksl9r4adqk1aih1fn5kihxh7b` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `application_answer_check_list` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `application_answer_id` bigint NOT NULL, + `check_list_id` bigint NOT NULL, + PRIMARY KEY (`id`), + KEY `FKqdnt92yg8t27q74he0ersyiax` (`application_answer_id`), + KEY `FK3mf6hfr08f2ex01aqejikxk9w` (`check_list_id`), + CONSTRAINT `FK3mf6hfr08f2ex01aqejikxk9w` FOREIGN KEY (`check_list_id`) REFERENCES `check_list` (`id`), + CONSTRAINT `FKqdnt92yg8t27q74he0ersyiax` FOREIGN KEY (`application_answer_id`) REFERENCES `application_answer` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +CREATE TABLE `application_answer_text` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `answer` varchar(1000) DEFAULT NULL, + `application_answer_id` bigint NOT NULL , + PRIMARY KEY (`id`), + KEY `FKlhk4m3hi4r3v8xqk8lx4bx5g7` (`application_answer_id`), + CONSTRAINT `FKlhk4m3hi4r3v8xqk8lx4bx5g7` FOREIGN KEY (`application_answer_id`) REFERENCES `application_answer` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + +CREATE TABLE `recruit_status` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `interview_date` datetime(6) DEFAULT NULL, + `application_id` bigint NOT NULL , + PRIMARY KEY (`id`), + KEY `FKrn9y1gwvfmkkoshsxyx3l4pbn` (`application_id`), + CONSTRAINT `FKrn9y1gwvfmkkoshsxyx3l4pbn` FOREIGN KEY (`application_id`) REFERENCES `application` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + + +CREATE TABLE `result_message` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `content` varchar(100) DEFAULT NULL, + `is_use` bit(1) DEFAULT false, + `message_type` varchar(15) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java index b31cc0581..ac9afb0e0 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.admin.repo.store.CoinPolicyAdminRepository; -import gg.data.store.CoinPolicy; +import gg.data.pingpong.store.CoinPolicy; import gg.data.user.User; import gg.pingpong.api.admin.store.controller.response.CoinPolicyAdminListResponseDto; import gg.pingpong.api.admin.store.dto.CoinPolicyAdminAddDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/service/CoinAdminServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/service/CoinAdminServiceTest.java index 18e7d0916..ea873c5ad 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/service/CoinAdminServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/service/CoinAdminServiceTest.java @@ -14,7 +14,7 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import gg.data.store.CoinHistory; +import gg.data.pingpong.store.CoinHistory; import gg.data.user.User; import gg.pingpong.api.admin.store.controller.request.CoinUpdateRequestDto; import gg.pingpong.api.admin.store.service.CoinAdminService; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/game/controller/GameAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/game/controller/GameAdminControllerTest.java index 5c7f3b35c..8c8cf8221 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/game/controller/GameAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/game/controller/GameAdminControllerTest.java @@ -25,10 +25,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.game.type.Mode; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.season.Season; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.admin.game.controller.response.GameLogListAdminResponseDto; import gg.pingpong.api.admin.game.dto.RankGamePPPModifyReqDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/item/controller/ItemAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/item/controller/ItemAdminControllerTest.java index 734c16218..f70917245 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/item/controller/ItemAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/item/controller/ItemAdminControllerTest.java @@ -25,8 +25,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.admin.repo.store.ItemAdminRepository; -import gg.data.store.Item; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.type.ItemType; import gg.pingpong.api.admin.store.controller.request.ItemUpdateRequestDto; import gg.pingpong.api.admin.store.controller.response.ItemListResponseDto; import gg.pingpong.api.admin.store.service.ItemAdminService; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/item/service/ItemAdminServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/item/service/ItemAdminServiceUnitTest.java index 18a30742d..1d56f7545 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/item/service/ItemAdminServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/item/service/ItemAdminServiceUnitTest.java @@ -21,7 +21,7 @@ import org.springframework.web.multipart.MultipartFile; import gg.admin.repo.store.ItemAdminRepository; -import gg.data.store.Item; +import gg.data.pingpong.store.Item; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/receipt/controller/ReceiptAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/receipt/controller/ReceiptAdminControllerTest.java index 3a157f59e..961ceac26 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/receipt/controller/ReceiptAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/receipt/controller/ReceiptAdminControllerTest.java @@ -19,8 +19,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.admin.repo.store.ReceiptAdminRepository; -import gg.data.store.Item; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.type.ItemType; import gg.data.user.User; import gg.pingpong.api.admin.store.controller.request.ItemUpdateRequestDto; import gg.pingpong.api.admin.store.controller.response.ReceiptListResponseDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/receipt/service/ReceiptAdminServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/receipt/service/ReceiptAdminServiceUnitTest.java index be06a7587..27e06b6a6 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/receipt/service/ReceiptAdminServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/receipt/service/ReceiptAdminServiceUnitTest.java @@ -15,7 +15,7 @@ import org.springframework.data.domain.Pageable; import gg.admin.repo.store.ReceiptAdminRepository; -import gg.data.store.Receipt; +import gg.data.pingpong.store.Receipt; import gg.pingpong.api.admin.store.service.ReceiptAdminService; import gg.utils.annotation.UnitTest; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/season/controller/SeasonAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/season/controller/SeasonAdminControllerTest.java index fdc758d2e..5b6bf2bb9 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/season/controller/SeasonAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/season/controller/SeasonAdminControllerTest.java @@ -20,8 +20,8 @@ import com.google.common.net.HttpHeaders; import gg.admin.repo.season.SeasonAdminRepository; -import gg.data.rank.Tier; -import gg.data.season.Season; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.season.Season; import gg.pingpong.api.admin.rank.service.RankAdminService; import gg.pingpong.api.admin.rank.service.RankRedisAdminService; import gg.pingpong.api.admin.season.controller.request.SeasonCreateRequestDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/season/service/SeasonAdminServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/season/service/SeasonAdminServiceUnitTest.java index 1022bcc8f..a2c35aaad 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/season/service/SeasonAdminServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/season/service/SeasonAdminServiceUnitTest.java @@ -20,7 +20,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import gg.admin.repo.season.SeasonAdminRepository; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import gg.pingpong.api.admin.rank.service.RankAdminService; import gg.pingpong.api.admin.rank.service.RankRedisAdminService; import gg.pingpong.api.admin.season.controller.request.SeasonCreateRequestDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/controller/SlotAdminControllerFailTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/controller/SlotAdminControllerFailTest.java index 2d6f207cd..e6f6cc9d4 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/controller/SlotAdminControllerFailTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/controller/SlotAdminControllerFailTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.admin.repo.manage.AdminSlotManagementsRepository; -import gg.data.manage.SlotManagement; +import gg.data.pingpong.manage.SlotManagement; import gg.pingpong.api.admin.manage.controller.request.SlotCreateRequestDto; import gg.pingpong.api.global.security.jwt.utils.AuthTokenProvider; import gg.repo.manage.SlotManagementRepository; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/controller/SlotAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/controller/SlotAdminControllerTest.java index f41d37e56..02aae0af9 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/controller/SlotAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/controller/SlotAdminControllerTest.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.admin.repo.manage.AdminSlotManagementsRepository; -import gg.data.manage.SlotManagement; +import gg.data.pingpong.manage.SlotManagement; import gg.pingpong.api.admin.manage.controller.request.SlotCreateRequestDto; import gg.pingpong.api.admin.manage.controller.response.SlotListAdminResponseDto; import gg.pingpong.api.admin.manage.dto.SlotAdminDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/service/SlotAdminServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/service/SlotAdminServiceUnitTest.java index 63fe2d374..ab4d6ab1a 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/service/SlotAdminServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/slotmanagement/service/SlotAdminServiceUnitTest.java @@ -19,7 +19,7 @@ import org.mockito.quality.Strictness; import gg.admin.repo.manage.AdminSlotManagementsRepository; -import gg.data.manage.SlotManagement; +import gg.data.pingpong.manage.SlotManagement; import gg.pingpong.api.admin.manage.controller.request.SlotCreateRequestDto; import gg.pingpong.api.admin.manage.service.SlotAdminService; import gg.utils.annotation.UnitTest; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/controller/TournamentAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/controller/TournamentAdminControllerTest.java index f5aa141e6..fbcb5bddf 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/controller/TournamentAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/controller/TournamentAdminControllerTest.java @@ -21,14 +21,14 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.game.type.Mode; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.data.user.User; import gg.pingpong.api.admin.tournament.controller.request.TournamentAdminAddUserRequestDto; import gg.pingpong.api.admin.tournament.controller.request.TournamentAdminCreateRequestDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/controller/TournamentAdminUserControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/controller/TournamentAdminUserControllerTest.java index 3ed665cae..64a1fd6e3 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/controller/TournamentAdminUserControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/controller/TournamentAdminUserControllerTest.java @@ -16,7 +16,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.tournament.Tournament; +import gg.data.pingpong.tournament.Tournament; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/service/TournamentAdminServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/service/TournamentAdminServiceTest.java index e34413789..313153be3 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/service/TournamentAdminServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/tournament/service/TournamentAdminServiceTest.java @@ -17,14 +17,14 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import gg.data.game.Game; -import gg.data.manage.SlotManagement; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/GameUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/GameUnitTest.java index ce67c4ca7..433f53c9f 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/GameUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/GameUnitTest.java @@ -13,8 +13,8 @@ import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; -import gg.data.game.Game; -import gg.data.game.Team; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; import gg.utils.annotation.UnitTest; import gg.utils.exception.ErrorCode; import gg.utils.exception.custom.BusinessException; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/PChangeDataTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/PChangeDataTest.java index 3db8c6c64..813bab08a 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/PChangeDataTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/PChangeDataTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; -import gg.data.game.PChange; +import gg.data.pingpong.game.PChange; import gg.utils.annotation.UnitTest; @UnitTest diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TeamUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TeamUnitTest.java index 1bb720d3a..f9bf108a7 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TeamUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TeamUnitTest.java @@ -13,8 +13,8 @@ import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; -import gg.data.game.Team; -import gg.data.game.TeamUser; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; import gg.utils.annotation.UnitTest; import gg.utils.exception.ErrorCode; import gg.utils.exception.custom.BusinessException; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TournamentGameUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TournamentGameUnitTest.java index 27519a10e..7857afa6d 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TournamentGameUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TournamentGameUnitTest.java @@ -8,11 +8,11 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import gg.data.game.Game; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.utils.annotation.UnitTest; @UnitTest diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TournamentUserUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TournamentUserUnitTest.java index f96c9afc0..ea0d614a6 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TournamentUserUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/game/TournamentUserUnitTest.java @@ -8,10 +8,10 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.data.user.User; import gg.utils.annotation.UnitTest; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/store/ItemUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/store/ItemUnitTest.java index 33da59006..50d2376ab 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/data/store/ItemUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/data/store/ItemUnitTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; -import gg.data.store.Item; +import gg.data.pingpong.store.Item; import gg.utils.annotation.UnitTest; @UnitTest diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/coin/service/CoinHistoryServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/coin/service/CoinHistoryServiceTest.java index 3b61b83ba..f4f1c1c30 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/coin/service/CoinHistoryServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/coin/service/CoinHistoryServiceTest.java @@ -10,8 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import gg.data.store.CoinHistory; -import gg.data.store.CoinPolicy; +import gg.data.pingpong.store.CoinHistory; +import gg.data.pingpong.store.CoinPolicy; import gg.data.user.User; import gg.pingpong.api.global.security.jwt.utils.AuthTokenProvider; import gg.pingpong.api.user.store.service.CoinHistoryService; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/coin/service/UserCoinChangeServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/coin/service/UserCoinChangeServiceTest.java index afcf7a41b..70ef95abd 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/coin/service/UserCoinChangeServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/coin/service/UserCoinChangeServiceTest.java @@ -10,12 +10,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.season.Season; -import gg.data.store.CoinPolicy; -import gg.data.store.Item; -import gg.data.store.type.ItemType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.store.CoinPolicy; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.type.ItemType; import gg.data.user.User; import gg.pingpong.api.global.security.jwt.utils.AuthTokenProvider; import gg.pingpong.api.user.store.dto.UserGameCoinResultDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/GameControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/GameControllerTest.java index ff71b42b0..dca463181 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/GameControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/GameControllerTest.java @@ -25,18 +25,18 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.game.Game; -import gg.data.game.PChange; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.PChange; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameDBTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameDBTest.java index dd1fad1e7..ed056707e 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameDBTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameDBTest.java @@ -17,11 +17,11 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.game.type.Mode; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.admin.game.service.GameAdminService; import gg.pingpong.api.global.security.jwt.utils.AuthTokenProvider; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameFindServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameFindServiceTest.java index deca8b8f5..1f4869eae 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameFindServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameFindServiceTest.java @@ -16,12 +16,12 @@ import org.springframework.data.domain.Sort; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.global.security.jwt.utils.AuthTokenProvider; import gg.pingpong.api.user.game.controller.response.GameListResDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameServiceTest.java index e26469fe4..11db20758 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameServiceTest.java @@ -10,15 +10,15 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.global.security.jwt.utils.AuthTokenProvider; import gg.pingpong.api.user.game.controller.request.RankResultReqDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameStatusServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameStatusServiceTest.java index 383b15f97..f98085832 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameStatusServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/game/service/GameStatusServiceTest.java @@ -10,13 +10,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.manage.SlotManagement; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/item/controller/ItemStoreListControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/item/controller/ItemStoreListControllerTest.java index 48fc990f5..2467b1ef0 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/item/controller/ItemStoreListControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/item/controller/ItemStoreListControllerTest.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.item.controller; -import static gg.data.store.type.ItemType.*; +import static gg.data.pingpong.store.type.ItemType.*; import static org.assertj.core.api.Assertions.*; import static org.mockito.Mockito.*; import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/item/service/ItemServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/item/service/ItemServiceUnitTest.java index 45aeb4b29..242538bc2 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/item/service/ItemServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/item/service/ItemServiceUnitTest.java @@ -20,10 +20,10 @@ import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; -import gg.data.store.Item; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; +import gg.data.pingpong.store.type.ItemType; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/dto/MatchStatusDtoUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/dto/MatchStatusDtoUnitTest.java index b0e726e53..b008debab 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/dto/MatchStatusDtoUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/dto/MatchStatusDtoUnitTest.java @@ -11,9 +11,9 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.manage.SlotManagement; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.manage.SlotManagement; import gg.utils.annotation.UnitTest; @UnitTest diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchBothServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchBothServiceTest.java index 6cac860e4..c6cda0518 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchBothServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchBothServiceTest.java @@ -19,11 +19,11 @@ import org.springframework.transaction.annotation.Transactional; import gg.admin.repo.manage.PenaltyAdminRepository; -import gg.data.game.Game; -import gg.data.manage.SlotManagement; import gg.data.manage.type.PenaltyKey; -import gg.data.match.type.Option; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.type.Option; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.user.manage.redis.PenaltyUserRedisRepository; import gg.pingpong.api.user.match.utils.MatchIntegrationTestUtils; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchFindServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchFindServiceUnitTest.java index e84103f51..471b368b8 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchFindServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchFindServiceUnitTest.java @@ -21,14 +21,14 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import gg.data.game.Game; -import gg.data.game.type.StatusType; -import gg.data.manage.SlotManagement; -import gg.data.match.RedisMatchTime; -import gg.data.match.type.Option; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.RedisMatchTime; +import gg.data.pingpong.match.type.Option; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.user.match.utils.SlotGenerator; import gg.pingpong.api.user.season.service.SeasonFindService; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchServiceTest.java index e40f7f2dc..13529a133 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchServiceTest.java @@ -23,22 +23,22 @@ import org.springframework.transaction.annotation.Transactional; import gg.admin.repo.manage.PenaltyAdminRepository; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.manage.SlotManagement; import gg.data.manage.redis.RedisPenaltyUser; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.MatchKey; -import gg.data.match.type.Option; -import gg.data.match.type.SlotStatus; import gg.data.noti.Noti; import gg.data.noti.type.NotiType; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.MatchKey; +import gg.data.pingpong.match.type.Option; +import gg.data.pingpong.match.type.SlotStatus; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.data.user.User; import gg.pingpong.api.user.manage.redis.PenaltyUserRedisRepository; import gg.pingpong.api.user.match.controller.response.MatchStatusResponseListDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchTournamentServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchTournamentServiceTest.java index 0b7aa2530..fbc0ea527 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchTournamentServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchTournamentServiceTest.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.match.service; -import static gg.data.tournament.type.RoundNumber.*; +import static gg.data.pingpong.tournament.type.RoundNumber.*; import static org.assertj.core.api.Assertions.*; import static org.mockito.Mockito.*; @@ -19,14 +19,14 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.transaction.annotation.Transactional; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.type.StatusType; -import gg.data.match.type.TournamentMatchStatus; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.match.type.TournamentMatchStatus; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; import gg.data.user.User; import gg.pingpong.api.admin.noti.controller.request.SendNotiAdminRequestDto; import gg.pingpong.api.admin.noti.service.NotiAdminService; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchTournamentServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchTournamentServiceUnitTest.java index c0acdbb9e..6772ca250 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchTournamentServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/service/MatchTournamentServiceUnitTest.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.match.service; -import static gg.data.tournament.type.RoundNumber.*; +import static gg.data.pingpong.tournament.type.RoundNumber.*; import static gg.pingpong.api.user.match.utils.TournamentGameTestUtils.*; import static gg.pingpong.api.utils.ReflectionUtilsForUnitTest.*; import static org.assertj.core.api.Assertions.assertThat; @@ -23,18 +23,18 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.manage.SlotManagement; -import gg.data.match.type.TournamentMatchStatus; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.RoundNumber; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.type.TournamentMatchStatus; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.RoundNumber; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; import gg.data.user.User; import gg.pingpong.api.admin.noti.controller.request.SendNotiAdminRequestDto; import gg.pingpong.api.admin.noti.service.NotiAdminService; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/GameTestUtils.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/GameTestUtils.java index 1b6b44346..150877a9f 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/GameTestUtils.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/GameTestUtils.java @@ -2,12 +2,12 @@ import java.time.LocalDateTime; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.season.Season; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.season.Season; import gg.data.user.User; public class GameTestUtils { diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/MatchIntegrationTestUtils.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/MatchIntegrationTestUtils.java index 0bb2d3def..310b4dad1 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/MatchIntegrationTestUtils.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/MatchIntegrationTestUtils.java @@ -9,14 +9,14 @@ import org.springframework.stereotype.Component; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.manage.SlotManagement; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.TournamentRound; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.TournamentRound; import gg.data.user.User; import gg.repo.game.GameRepository; import gg.repo.manage.SlotManagementRepository; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/TournamentGameTestUtils.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/TournamentGameTestUtils.java index 2bbd24485..2918ee3af 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/TournamentGameTestUtils.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/TournamentGameTestUtils.java @@ -7,16 +7,16 @@ import java.util.Optional; import java.util.stream.Collectors; -import gg.data.game.Game; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.RoundNumber; -import gg.data.tournament.type.TournamentRound; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.RoundNumber; +import gg.data.pingpong.tournament.type.TournamentRound; import gg.data.user.User; import gg.utils.exception.match.WinningTeamNotFoundException; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/TournamentTestUtils.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/TournamentTestUtils.java index b39ac3b02..bdec3d65f 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/TournamentTestUtils.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/match/utils/TournamentTestUtils.java @@ -2,12 +2,12 @@ import java.time.LocalDateTime; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; public class TournamentTestUtils { /** diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/megaphone/controller/MegaphoneControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/megaphone/controller/MegaphoneControllerTest.java index eb7ac45c5..d0d112361 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/megaphone/controller/MegaphoneControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/megaphone/controller/MegaphoneControllerTest.java @@ -17,11 +17,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.store.Item; -import gg.data.store.Megaphone; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.Megaphone; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; +import gg.data.pingpong.store.type.ItemType; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/megaphone/service/MegaphoneServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/megaphone/service/MegaphoneServiceUnitTest.java index 1dd4dce0d..c92430fa8 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/megaphone/service/MegaphoneServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/megaphone/service/MegaphoneServiceUnitTest.java @@ -22,11 +22,11 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import gg.data.store.Item; -import gg.data.store.Megaphone; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; -import gg.data.store.type.ItemType; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.Megaphone; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; +import gg.data.pingpong.store.type.ItemType; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/pchange/service/PChangeServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/pchange/service/PChangeServiceTest.java index b396d297e..cfa5cdcb9 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/pchange/service/PChangeServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/pchange/service/PChangeServiceTest.java @@ -14,8 +14,8 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import gg.data.game.Game; -import gg.data.game.PChange; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.PChange; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/controller/RankControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/controller/RankControllerTest.java index 99e9e8e6d..efd808a96 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/controller/RankControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/controller/RankControllerTest.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.global.security.jwt.utils.AuthTokenProvider; import gg.pingpong.api.user.rank.controller.response.ExpRankPageResponseDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/redis/RankRedisRepositoryTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/redis/RankRedisRepositoryTest.java index c048a5f26..bf2079a51 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/redis/RankRedisRepositoryTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/redis/RankRedisRepositoryTest.java @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import gg.data.rank.redis.RankRedis; +import gg.data.pingpong.rank.redis.RankRedis; import gg.repo.rank.redis.RankRedisRepository; import gg.utils.annotation.IntegrationTest; import gg.utils.exception.rank.RedisDataNotFoundException; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/service/RankServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/service/RankServiceTest.java index 9e0afdb01..5fa21e238 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/service/RankServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/rank/service/RankServiceTest.java @@ -17,7 +17,7 @@ import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.user.rank.controller.response.ExpRankPageResponseDto; import gg.pingpong.api.user.rank.controller.response.RankPageResponseDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/SeasonTestController.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/SeasonTestController.java index 8b20a431e..7714f199a 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/SeasonTestController.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/SeasonTestController.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import gg.pingpong.api.global.security.jwt.utils.AuthTokenProvider; import gg.pingpong.api.user.season.controller.response.SeasonListResDto; import gg.pingpong.api.user.season.controller.response.SeasonResDto; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/SeasonTriggerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/SeasonTriggerTest.java index 1728f970d..9cfb6cc97 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/SeasonTriggerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/SeasonTriggerTest.java @@ -16,8 +16,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.game.type.Mode; -import gg.data.season.Season; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.season.Season; import gg.pingpong.api.global.security.jwt.utils.AuthTokenProvider; import gg.repo.season.SeasonRepository; import gg.utils.TestDataUtils; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/service/SeasonServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/service/SeasonServiceUnitTest.java index 0a8b083fa..d60d118dc 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/service/SeasonServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/season/service/SeasonServiceUnitTest.java @@ -14,7 +14,7 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import gg.repo.season.SeasonRepository; import gg.utils.annotation.UnitTest; import gg.utils.exception.season.SeasonNotFoundException; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tier/service/TierServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tier/service/TierServiceUnitTest.java index 46fa47aba..0d034c5f5 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tier/service/TierServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tier/service/TierServiceUnitTest.java @@ -22,9 +22,9 @@ import org.mockito.quality.Strictness; import org.springframework.data.domain.Sort; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.season.Season; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.season.Season; import gg.data.user.User; import gg.pingpong.api.user.rank.service.TierService; import gg.repo.rank.RankRepository; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentFindControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentFindControllerTest.java index aaade00a1..26697166d 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentFindControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentFindControllerTest.java @@ -20,10 +20,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentGameControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentGameControllerTest.java index b98c27d0e..38f14f865 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentGameControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentGameControllerTest.java @@ -18,12 +18,12 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.game.type.Mode; -import gg.data.season.Season; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentSchedulerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentSchedulerTest.java index 7b8d45ccc..c47785f03 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentSchedulerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/controller/TournamentSchedulerTest.java @@ -15,10 +15,10 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.transaction.annotation.Transactional; -import gg.data.manage.SlotManagement; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.TournamentStatus; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.TournamentStatus; import gg.pingpong.api.admin.noti.controller.request.SendNotiAdminRequestDto; import gg.pingpong.api.admin.noti.service.NotiAdminService; import gg.pingpong.api.user.tournament.service.TournamentService; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/service/TournamentServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/service/TournamentServiceUnitTest.java index f639df29f..6144c5566 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/service/TournamentServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/tournament/service/TournamentServiceUnitTest.java @@ -24,15 +24,15 @@ import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; -import gg.data.game.Game; -import gg.data.game.type.StatusType; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; -import gg.data.tournament.type.TournamentUserStatus; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; +import gg.data.pingpong.tournament.type.TournamentUserStatus; import gg.data.user.User; import gg.data.user.type.RacketType; import gg.data.user.type.RoleType; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/user/controller/UserControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/user/controller/UserControllerTest.java index 7553d1f94..444f08abb 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/user/user/controller/UserControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/user/user/controller/UserControllerTest.java @@ -27,17 +27,17 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; -import gg.data.store.Item; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; -import gg.data.store.type.ItemType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; +import gg.data.pingpong.store.type.ItemType; import gg.data.user.User; import gg.data.user.type.BackgroundType; import gg.data.user.type.EdgeType; diff --git a/gg-repo/src/main/java/gg/repo/game/GameRepository.java b/gg-repo/src/main/java/gg/repo/game/GameRepository.java index f27d5bc27..c45dadcf7 100644 --- a/gg-repo/src/main/java/gg/repo/game/GameRepository.java +++ b/gg-repo/src/main/java/gg/repo/game/GameRepository.java @@ -14,9 +14,9 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.game.Game; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; import gg.repo.game.out.GameTeamUser; import gg.repo.game.out.GameTeamUserInfo; import gg.repo.game.out.GameUser; diff --git a/gg-repo/src/main/java/gg/repo/game/GameRepositoryCustom.java b/gg-repo/src/main/java/gg/repo/game/GameRepositoryCustom.java index 1b8b7b7dc..57012cb27 100644 --- a/gg-repo/src/main/java/gg/repo/game/GameRepositoryCustom.java +++ b/gg-repo/src/main/java/gg/repo/game/GameRepositoryCustom.java @@ -2,7 +2,7 @@ import java.util.Optional; -import gg.data.game.Game; +import gg.data.pingpong.game.Game; public interface GameRepositoryCustom { Optional getLatestGameByUser(Long userId); diff --git a/gg-repo/src/main/java/gg/repo/game/GameRepositoryImpl.java b/gg-repo/src/main/java/gg/repo/game/GameRepositoryImpl.java index d357d1600..9044556dc 100644 --- a/gg-repo/src/main/java/gg/repo/game/GameRepositoryImpl.java +++ b/gg-repo/src/main/java/gg/repo/game/GameRepositoryImpl.java @@ -5,8 +5,8 @@ import javax.persistence.EntityManager; import javax.persistence.NoResultException; -import gg.data.game.Game; -import gg.data.game.TeamUser; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.TeamUser; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor diff --git a/gg-repo/src/main/java/gg/repo/game/PChangeRepository.java b/gg-repo/src/main/java/gg/repo/game/PChangeRepository.java index a31b85364..ae0b5c434 100644 --- a/gg-repo/src/main/java/gg/repo/game/PChangeRepository.java +++ b/gg-repo/src/main/java/gg/repo/game/PChangeRepository.java @@ -7,8 +7,8 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.game.PChange; -import gg.data.game.type.Mode; +import gg.data.pingpong.game.PChange; +import gg.data.pingpong.game.type.Mode; public interface PChangeRepository extends JpaRepository, PChangeRepositoryCustom { diff --git a/gg-repo/src/main/java/gg/repo/game/PChangeRepositoryCustom.java b/gg-repo/src/main/java/gg/repo/game/PChangeRepositoryCustom.java index a6bb3b1f6..0e82b75a6 100644 --- a/gg-repo/src/main/java/gg/repo/game/PChangeRepositoryCustom.java +++ b/gg-repo/src/main/java/gg/repo/game/PChangeRepositoryCustom.java @@ -2,7 +2,7 @@ import java.util.List; -import gg.data.game.PChange; +import gg.data.pingpong.game.PChange; public interface PChangeRepositoryCustom { List findPChangesHistory(String intraId, Long seasonId); diff --git a/gg-repo/src/main/java/gg/repo/game/PChangeRepositoryImpl.java b/gg-repo/src/main/java/gg/repo/game/PChangeRepositoryImpl.java index 21275f7b3..8f208af67 100644 --- a/gg-repo/src/main/java/gg/repo/game/PChangeRepositoryImpl.java +++ b/gg-repo/src/main/java/gg/repo/game/PChangeRepositoryImpl.java @@ -6,7 +6,7 @@ import org.springframework.stereotype.Repository; -import gg.data.game.PChange; +import gg.data.pingpong.game.PChange; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/gg-repo/src/main/java/gg/repo/game/TeamRepository.java b/gg-repo/src/main/java/gg/repo/game/TeamRepository.java index 80e97a020..49a2a9d63 100644 --- a/gg-repo/src/main/java/gg/repo/game/TeamRepository.java +++ b/gg-repo/src/main/java/gg/repo/game/TeamRepository.java @@ -6,7 +6,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.game.Team; +import gg.data.pingpong.game.Team; public interface TeamRepository extends JpaRepository { @Query("select t from Team t where t.game.id=:gameId") diff --git a/gg-repo/src/main/java/gg/repo/game/TeamUserRepository.java b/gg-repo/src/main/java/gg/repo/game/TeamUserRepository.java index ecb568782..bb279716b 100644 --- a/gg-repo/src/main/java/gg/repo/game/TeamUserRepository.java +++ b/gg-repo/src/main/java/gg/repo/game/TeamUserRepository.java @@ -7,7 +7,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.game.TeamUser; +import gg.data.pingpong.game.TeamUser; public interface TeamUserRepository extends JpaRepository { @Query(value = "select team_user.id, team_user.team_id, team_user.user_id from team, team_user " diff --git a/gg-repo/src/main/java/gg/repo/game/out/GameTeamUser.java b/gg-repo/src/main/java/gg/repo/game/out/GameTeamUser.java index 0d4f1a010..2ad5aa371 100644 --- a/gg-repo/src/main/java/gg/repo/game/out/GameTeamUser.java +++ b/gg-repo/src/main/java/gg/repo/game/out/GameTeamUser.java @@ -2,8 +2,8 @@ import java.time.LocalDateTime; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; public interface GameTeamUser { Long getGameId(); diff --git a/gg-repo/src/main/java/gg/repo/game/out/GameTeamUserInfo.java b/gg-repo/src/main/java/gg/repo/game/out/GameTeamUserInfo.java index f12ff0c05..01e59f707 100644 --- a/gg-repo/src/main/java/gg/repo/game/out/GameTeamUserInfo.java +++ b/gg-repo/src/main/java/gg/repo/game/out/GameTeamUserInfo.java @@ -2,8 +2,8 @@ import java.time.LocalDateTime; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; public interface GameTeamUserInfo { Long getGameId(); diff --git a/gg-repo/src/main/java/gg/repo/manage/SlotManagementRepository.java b/gg-repo/src/main/java/gg/repo/manage/SlotManagementRepository.java index 56c72ee9a..a4b016ac9 100644 --- a/gg-repo/src/main/java/gg/repo/manage/SlotManagementRepository.java +++ b/gg-repo/src/main/java/gg/repo/manage/SlotManagementRepository.java @@ -8,7 +8,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.manage.SlotManagement; +import gg.data.pingpong.manage.SlotManagement; public interface SlotManagementRepository extends JpaRepository { diff --git a/gg-repo/src/main/java/gg/repo/match/RedisMatchTimeRepository.java b/gg-repo/src/main/java/gg/repo/match/RedisMatchTimeRepository.java index 7a8d5d0e2..7670ea9e4 100644 --- a/gg-repo/src/main/java/gg/repo/match/RedisMatchTimeRepository.java +++ b/gg-repo/src/main/java/gg/repo/match/RedisMatchTimeRepository.java @@ -11,8 +11,8 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Repository; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.MatchKey; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.MatchKey; import lombok.RequiredArgsConstructor; @Repository diff --git a/gg-repo/src/main/java/gg/repo/match/RedisMatchUserRepository.java b/gg-repo/src/main/java/gg/repo/match/RedisMatchUserRepository.java index c877c6622..91cb50d06 100644 --- a/gg-repo/src/main/java/gg/repo/match/RedisMatchUserRepository.java +++ b/gg-repo/src/main/java/gg/repo/match/RedisMatchUserRepository.java @@ -10,9 +10,9 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Repository; -import gg.data.match.RedisMatchTime; -import gg.data.match.type.MatchKey; -import gg.data.match.type.Option; +import gg.data.pingpong.match.RedisMatchTime; +import gg.data.pingpong.match.type.MatchKey; +import gg.data.pingpong.match.type.Option; import gg.utils.exception.match.PastSlotException; import lombok.RequiredArgsConstructor; diff --git a/gg-repo/src/main/java/gg/repo/rank/RankRepository.java b/gg-repo/src/main/java/gg/repo/rank/RankRepository.java index 03861c4fa..f087072f6 100644 --- a/gg-repo/src/main/java/gg/repo/rank/RankRepository.java +++ b/gg-repo/src/main/java/gg/repo/rank/RankRepository.java @@ -10,7 +10,7 @@ import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; -import gg.data.rank.Rank; +import gg.data.pingpong.rank.Rank; @Repository public interface RankRepository extends JpaRepository { diff --git a/gg-repo/src/main/java/gg/repo/rank/TierRepository.java b/gg-repo/src/main/java/gg/repo/rank/TierRepository.java index 38ff04a7c..006e4c615 100644 --- a/gg-repo/src/main/java/gg/repo/rank/TierRepository.java +++ b/gg-repo/src/main/java/gg/repo/rank/TierRepository.java @@ -5,7 +5,7 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import gg.data.rank.Tier; +import gg.data.pingpong.rank.Tier; public interface TierRepository extends JpaRepository { diff --git a/gg-repo/src/main/java/gg/repo/rank/redis/RankRedisRepository.java b/gg-repo/src/main/java/gg/repo/rank/redis/RankRedisRepository.java index 3ded2f8a9..692d7b303 100644 --- a/gg-repo/src/main/java/gg/repo/rank/redis/RankRedisRepository.java +++ b/gg-repo/src/main/java/gg/repo/rank/redis/RankRedisRepository.java @@ -10,7 +10,7 @@ import org.springframework.data.redis.core.ZSetOperations; import org.springframework.stereotype.Repository; -import gg.data.rank.redis.RankRedis; +import gg.data.pingpong.rank.redis.RankRedis; import gg.utils.exception.rank.RedisDataNotFoundException; @Repository diff --git a/gg-repo/src/main/java/gg/repo/season/SeasonRepository.java b/gg-repo/src/main/java/gg/repo/season/SeasonRepository.java index bae4dda42..7f00909e8 100644 --- a/gg-repo/src/main/java/gg/repo/season/SeasonRepository.java +++ b/gg-repo/src/main/java/gg/repo/season/SeasonRepository.java @@ -8,7 +8,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; public interface SeasonRepository extends JpaRepository { @Query("select s from Season s where s.startTime <= :now and s.endTime >= :now") diff --git a/gg-repo/src/main/java/gg/repo/store/CoinHistoryRepository.java b/gg-repo/src/main/java/gg/repo/store/CoinHistoryRepository.java index f287cf29e..5b0173cb2 100644 --- a/gg-repo/src/main/java/gg/repo/store/CoinHistoryRepository.java +++ b/gg-repo/src/main/java/gg/repo/store/CoinHistoryRepository.java @@ -10,7 +10,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.store.CoinHistory; +import gg.data.pingpong.store.CoinHistory; import gg.data.user.User; public interface CoinHistoryRepository extends JpaRepository { diff --git a/gg-repo/src/main/java/gg/repo/store/CoinPolicyRepository.java b/gg-repo/src/main/java/gg/repo/store/CoinPolicyRepository.java index 217852559..1a8e281d8 100644 --- a/gg-repo/src/main/java/gg/repo/store/CoinPolicyRepository.java +++ b/gg-repo/src/main/java/gg/repo/store/CoinPolicyRepository.java @@ -4,7 +4,7 @@ import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.store.CoinPolicy; +import gg.data.pingpong.store.CoinPolicy; public interface CoinPolicyRepository extends JpaRepository { Optional findTopByOrderByCreatedAtDesc(); diff --git a/gg-repo/src/main/java/gg/repo/store/ItemRepository.java b/gg-repo/src/main/java/gg/repo/store/ItemRepository.java index 74ace3772..2b2f764df 100644 --- a/gg-repo/src/main/java/gg/repo/store/ItemRepository.java +++ b/gg-repo/src/main/java/gg/repo/store/ItemRepository.java @@ -5,7 +5,7 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import gg.data.store.Item; +import gg.data.pingpong.store.Item; public interface ItemRepository extends JpaRepository { @Query("SELECT i FROM Item i WHERE i.isVisible = true ORDER BY i.createdAt DESC") diff --git a/gg-repo/src/main/java/gg/repo/store/MegaphoneRepository.java b/gg-repo/src/main/java/gg/repo/store/MegaphoneRepository.java index d54128bcb..dfe6c60ae 100644 --- a/gg-repo/src/main/java/gg/repo/store/MegaphoneRepository.java +++ b/gg-repo/src/main/java/gg/repo/store/MegaphoneRepository.java @@ -6,9 +6,9 @@ import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.store.Megaphone; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; +import gg.data.pingpong.store.Megaphone; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; public interface MegaphoneRepository extends JpaRepository { List findAllByUsedAtAndReceiptStatus(LocalDate date, ItemStatus itemStatus); diff --git a/gg-repo/src/main/java/gg/repo/store/ReceiptRepository.java b/gg-repo/src/main/java/gg/repo/store/ReceiptRepository.java index 87f43cd60..a3d757e77 100644 --- a/gg-repo/src/main/java/gg/repo/store/ReceiptRepository.java +++ b/gg-repo/src/main/java/gg/repo/store/ReceiptRepository.java @@ -2,7 +2,7 @@ import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.store.Receipt; +import gg.data.pingpong.store.Receipt; public interface ReceiptRepository extends JpaRepository { } diff --git a/gg-repo/src/main/java/gg/repo/store/UserItemRepository.java b/gg-repo/src/main/java/gg/repo/store/UserItemRepository.java index 2d5a9830b..4231ace5b 100644 --- a/gg-repo/src/main/java/gg/repo/store/UserItemRepository.java +++ b/gg-repo/src/main/java/gg/repo/store/UserItemRepository.java @@ -6,7 +6,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.store.Receipt; +import gg.data.pingpong.store.Receipt; public interface UserItemRepository extends JpaRepository { diff --git a/gg-repo/src/main/java/gg/repo/tournarment/TournamentGameRepository.java b/gg-repo/src/main/java/gg/repo/tournarment/TournamentGameRepository.java index beb1da482..b45514e7d 100644 --- a/gg-repo/src/main/java/gg/repo/tournarment/TournamentGameRepository.java +++ b/gg-repo/src/main/java/gg/repo/tournarment/TournamentGameRepository.java @@ -5,8 +5,8 @@ import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.type.TournamentRound; public interface TournamentGameRepository extends JpaRepository { List findAllByTournamentId(Long tournamentId); diff --git a/gg-repo/src/main/java/gg/repo/tournarment/TournamentRepository.java b/gg-repo/src/main/java/gg/repo/tournarment/TournamentRepository.java index 852d3d1bd..10e7b8e4d 100644 --- a/gg-repo/src/main/java/gg/repo/tournarment/TournamentRepository.java +++ b/gg-repo/src/main/java/gg/repo/tournarment/TournamentRepository.java @@ -12,9 +12,9 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import gg.data.tournament.Tournament; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; public interface TournamentRepository extends JpaRepository { List findAllByStatusIsNot(TournamentStatus status); diff --git a/gg-repo/src/main/java/gg/repo/tournarment/TournamentUserRepository.java b/gg-repo/src/main/java/gg/repo/tournarment/TournamentUserRepository.java index 5482c2279..7fb166fe7 100644 --- a/gg-repo/src/main/java/gg/repo/tournarment/TournamentUserRepository.java +++ b/gg-repo/src/main/java/gg/repo/tournarment/TournamentUserRepository.java @@ -5,8 +5,8 @@ import org.springframework.data.jpa.repository.JpaRepository; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentUser; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentUser; import gg.data.user.User; public interface TournamentUserRepository extends JpaRepository { diff --git a/gg-utils/src/testFixtures/java/gg/utils/ItemTestUtils.java b/gg-utils/src/testFixtures/java/gg/utils/ItemTestUtils.java index 68ea7dc0f..915b1203a 100644 --- a/gg-utils/src/testFixtures/java/gg/utils/ItemTestUtils.java +++ b/gg-utils/src/testFixtures/java/gg/utils/ItemTestUtils.java @@ -5,10 +5,10 @@ import org.springframework.stereotype.Component; -import gg.data.store.Item; -import gg.data.store.Megaphone; -import gg.data.store.Receipt; -import gg.data.store.type.ItemStatus; +import gg.data.pingpong.store.Item; +import gg.data.pingpong.store.Megaphone; +import gg.data.pingpong.store.Receipt; +import gg.data.pingpong.store.type.ItemStatus; import gg.data.user.User; import gg.pingpong.api.admin.store.controller.request.ItemUpdateRequestDto; import gg.repo.store.ItemRepository; diff --git a/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java b/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java index 9de9768b6..9d944fd26 100644 --- a/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java +++ b/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java @@ -9,27 +9,27 @@ import org.springframework.stereotype.Component; -import gg.data.game.Game; -import gg.data.game.PChange; -import gg.data.game.Team; -import gg.data.game.TeamUser; -import gg.data.game.type.Mode; -import gg.data.game.type.StatusType; import gg.data.manage.Announcement; -import gg.data.manage.SlotManagement; import gg.data.noti.Noti; import gg.data.noti.type.NotiType; -import gg.data.rank.Rank; -import gg.data.rank.Tier; -import gg.data.rank.redis.RankRedis; -import gg.data.season.Season; -import gg.data.store.CoinPolicy; -import gg.data.tournament.Tournament; -import gg.data.tournament.TournamentGame; -import gg.data.tournament.TournamentUser; -import gg.data.tournament.type.TournamentRound; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; +import gg.data.pingpong.game.Game; +import gg.data.pingpong.game.PChange; +import gg.data.pingpong.game.Team; +import gg.data.pingpong.game.TeamUser; +import gg.data.pingpong.game.type.Mode; +import gg.data.pingpong.game.type.StatusType; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.rank.Rank; +import gg.data.pingpong.rank.Tier; +import gg.data.pingpong.rank.redis.RankRedis; +import gg.data.pingpong.season.Season; +import gg.data.pingpong.store.CoinPolicy; +import gg.data.pingpong.tournament.Tournament; +import gg.data.pingpong.tournament.TournamentGame; +import gg.data.pingpong.tournament.TournamentUser; +import gg.data.pingpong.tournament.type.TournamentRound; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; import gg.data.user.User; import gg.data.user.UserImage; import gg.data.user.type.RacketType; From a25c07758e25020c327b76662e7075c1057e7e64 Mon Sep 17 00:00:00 2001 From: Hyunkyu Lee <88573971+wken5577@users.noreply.github.com> Date: Wed, 6 Mar 2024 20:04:40 +0900 Subject: [PATCH 02/12] [FEAT] #688 api module add (#689) --- build.gradle | 16 ++++++++++ .../main/java/gg/PingpongApiApplication.java | 2 +- .../CoinPolicyAdminControllerTest.java | 13 ++------ gg-recruit-api/build.gradle | 31 +++++++++++++++++++ .../java/gg/recruit/api/TestController.java | 22 +++++++++++++ gg-utils/build.gradle | 2 ++ .../java/gg/utils/TestDataUtils.java | 2 +- settings.gradle | 1 + 8 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 gg-recruit-api/build.gradle create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/TestController.java diff --git a/build.gradle b/build.gradle index 2f5aefec4..c64de17ee 100644 --- a/build.gradle +++ b/build.gradle @@ -56,6 +56,9 @@ subprojects { implementation 'org.springframework.boot:spring-boot-starter-data-redis' implementation 'org.redisson:redisson:3.17.3' + //devtools + implementation 'org.springframework.boot:spring-boot-devtools' + /* spring doc */ implementation 'org.springdoc:springdoc-openapi-ui:1.6.6' @@ -238,6 +241,19 @@ subprojects { project(':gg-pingpong-api') { bootJar { enabled = true } jar { enabled = true } + dependencies { + implementation project(':gg-data') + implementation project(':gg-repo') + implementation project(':gg-admin-repo') + implementation project(':gg-utils') + implementation project(':gg-auth') + implementation project(':gg-recruit-api') + } +} + +project(':gg-recruit-api') { + bootJar { enabled = false } + jar { enabled = true } dependencies { implementation project(':gg-data') implementation project(':gg-repo') diff --git a/gg-pingpong-api/src/main/java/gg/PingpongApiApplication.java b/gg-pingpong-api/src/main/java/gg/PingpongApiApplication.java index d2cc3673a..b61ffb94e 100644 --- a/gg-pingpong-api/src/main/java/gg/PingpongApiApplication.java +++ b/gg-pingpong-api/src/main/java/gg/PingpongApiApplication.java @@ -4,7 +4,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication(scanBasePackages = {"gg.admin.repo", "gg.data", "gg.repo", - "gg.pingpong.api", "gg.utils", "gg.party.api", "gg.auth"}) + "gg.pingpong.api", "gg.utils", "gg.party.api", "gg.auth", "gg.recruit.api"}) public class PingpongApiApplication { public static void main(String[] args) { diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java index affef5991..c9eaa3e2d 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java @@ -18,11 +18,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.admin.repo.store.CoinPolicyAdminRepository; - -import gg.data.pingpong.store.CoinPolicy; - import gg.auth.utils.AuthTokenProvider; - +import gg.data.pingpong.store.CoinPolicy; import gg.data.user.User; import gg.pingpong.api.admin.store.controller.response.CoinPolicyAdminListResponseDto; import gg.pingpong.api.admin.store.dto.CoinPolicyAdminAddDto; @@ -38,18 +35,14 @@ class CoinPolicyAdminControllerTest { @Autowired TestDataUtils testDataUtils; - - @Autowired - private MockMvc mockMvc; - @Autowired ObjectMapper objectMapper; - @Autowired AuthTokenProvider tokenProvider; - @Autowired CoinPolicyAdminRepository coinPolicyAdminRepository; + @Autowired + private MockMvc mockMvc; @Test @DisplayName("[Get]/pingpong/admin/coinpolicy") diff --git a/gg-recruit-api/build.gradle b/gg-recruit-api/build.gradle new file mode 100644 index 000000000..215acef41 --- /dev/null +++ b/gg-recruit-api/build.gradle @@ -0,0 +1,31 @@ +plugins { + id 'java' +} + +group 'gg.api' +version '42gg' + +repositories { + mavenCentral() +} + +dependencies { + /* spring */ + implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-mail' + annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' + + /* StringUtils */ + implementation 'org.apache.commons:commons-lang3:3.12.0' + + testImplementation 'org.springframework.security:spring-security-test' + + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' + testImplementation testFixtures(project(':gg-utils')) +} + +test { + useJUnitPlatform() +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java b/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java new file mode 100644 index 000000000..2764d00f9 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java @@ -0,0 +1,22 @@ +package gg.recruit.api; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import gg.auth.UserDto; +import gg.auth.argumentresolver.Login; + +@RestController +public class TestController { + + @GetMapping("/test") + public String test() { + return "test"; + } + + @GetMapping("/login") + public String login(@Login UserDto user) { + System.out.println("user = " + user); + return "login"; + } +} diff --git a/gg-utils/build.gradle b/gg-utils/build.gradle index ee14b69b8..cad5924ec 100644 --- a/gg-utils/build.gradle +++ b/gg-utils/build.gradle @@ -92,12 +92,14 @@ dependencies { testFixturesImplementation project(":gg-repo") testFixturesImplementation project(":gg-admin-repo") testFixturesImplementation project(":gg-pingpong-api") + testFixturesImplementation project(":gg-recruit-api") jacocoAggregation(project(':gg-data')) jacocoAggregation(project(':gg-auth')) jacocoAggregation(project(':gg-repo')) jacocoAggregation(project(':gg-admin-repo')) jacocoAggregation(project(':gg-pingpong-api')) + jacocoAggregation(project(':gg-recruit-api')) } test { diff --git a/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java b/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java index e4a6bf48f..f1ec3b36d 100644 --- a/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java +++ b/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Component; +import gg.auth.utils.AuthTokenProvider; import gg.data.manage.Announcement; import gg.data.noti.Noti; import gg.data.noti.type.NotiType; @@ -37,7 +38,6 @@ import gg.data.user.type.SnsType; import gg.pingpong.api.admin.tournament.controller.request.TournamentAdminCreateRequestDto; import gg.pingpong.api.admin.tournament.controller.request.TournamentAdminUpdateRequestDto; -import gg.auth.utils.AuthTokenProvider; import gg.pingpong.api.user.tournament.controller.response.TournamentResponseDto; import gg.pingpong.api.user.user.dto.UserImageDto; import gg.repo.game.GameRepository; diff --git a/settings.gradle b/settings.gradle index 887aef09f..9e311f424 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,4 +5,5 @@ include 'gg-repo' include 'gg-pingpong-api' include 'gg-utils' include 'gg-auth' +include 'gg-recruit-api' From 388fc60b69cf2c9ade4177a1d08dc1f1520f5f94 Mon Sep 17 00:00:00 2001 From: Hyunkyu Lee <88573971+wken5577@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:45:50 +0900 Subject: [PATCH 03/12] [FEAT] #558 my applications get (#691) --- .gitignore | 2 +- .../data/recruit/application/Application.java | 11 +- .../recruit/recruitment/Recruitments.java | 14 +- gg-recruit-api/build.gradle | 2 - .../java/gg/recruit/api/TestController.java | 22 --- .../controller/ApplicationController.java | 25 +++ .../response/ApplicationResDto.java | 29 +++ .../response/MyApplicationsResDto.java | 21 ++ .../service/ApplicationService.java | 22 +++ .../service/response/ApplicationDto.java | 29 +++ .../service/response/ApplicationListDto.java | 17 ++ .../api/TestSpringBootApplication.java | 8 + .../controller/ApplicationControllerTest.java | 61 ++++++ .../src/test/resources/application.yml | 184 ++++++++++++++++++ .../application/ApplicationRepository.java | 16 ++ .../recruitment/RecruitmentRepository.java | 8 + .../java/gg/utils/RecruitMockData.java | 30 +++ 17 files changed, 474 insertions(+), 27 deletions(-) delete mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/TestController.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/ApplicationController.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/ApplicationResDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/MyApplicationsResDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/ApplicationService.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationListDto.java create mode 100644 gg-recruit-api/src/test/java/gg/recruit/api/TestSpringBootApplication.java create mode 100644 gg-recruit-api/src/test/java/gg/recruit/api/user/application/controller/ApplicationControllerTest.java create mode 100644 gg-recruit-api/src/test/resources/application.yml create mode 100644 gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java create mode 100644 gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java create mode 100644 gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java diff --git a/.gitignore b/.gitignore index 19e247c89..443c346ca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ build/ !gradle/wrapper/gradle-wrapper.jar !**/src/main/**/build/ !**/src/test/**/build/ -**/application.yml +gg-pingpong-api/src/main/resources/application.yml .DS_Store python /logs diff --git a/gg-data/src/main/java/gg/data/recruit/application/Application.java b/gg-data/src/main/java/gg/data/recruit/application/Application.java index 58624b88c..29b4889cc 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/Application.java +++ b/gg-data/src/main/java/gg/data/recruit/application/Application.java @@ -16,10 +16,12 @@ import gg.data.recruit.recruitment.Recruitments; import gg.data.user.User; import lombok.AccessLevel; +import lombok.Getter; import lombok.NoArgsConstructor; @Entity @NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter public class Application extends BaseTimeEntity { @Id @@ -32,11 +34,18 @@ public class Application extends BaseTimeEntity { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "recruit_id", nullable = false) - private Recruitments recruitId; + private Recruitments recruit; private Boolean isDeleted; @Enumerated(EnumType.STRING) @Column(length = 15, nullable = false) private ApplicationStatus status; + + public Application(User user, Recruitments recruit) { + this.user = user; + this.recruit = recruit; + this.isDeleted = false; + this.status = ApplicationStatus.PROGRESS_DOCS; + } } diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java index 1e6f5c48b..f7f4d123a 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java @@ -10,9 +10,11 @@ import gg.data.BaseTimeEntity; import lombok.AccessLevel; +import lombok.Getter; import lombok.NoArgsConstructor; @Entity +@Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) public class Recruitments extends BaseTimeEntity { @Id @@ -34,6 +36,16 @@ public class Recruitments extends BaseTimeEntity { @Column(nullable = false) private LocalDateTime startTime; @Column(nullable = false) - private LocalDateTime endTime; + + public Recruitments(String title, String contents, String generation, LocalDateTime startTime, + LocalDateTime endTime) { + this.title = title; + this.contents = contents; + this.generation = generation; + this.startTime = startTime; + this.endTime = endTime; + this.isFinish = false; + this.isDeleted = false; + } } diff --git a/gg-recruit-api/build.gradle b/gg-recruit-api/build.gradle index 215acef41..4f8e11d62 100644 --- a/gg-recruit-api/build.gradle +++ b/gg-recruit-api/build.gradle @@ -19,8 +19,6 @@ dependencies { /* StringUtils */ implementation 'org.apache.commons:commons-lang3:3.12.0' - testImplementation 'org.springframework.security:spring-security-test' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' testImplementation testFixtures(project(':gg-utils')) diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java b/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java deleted file mode 100644 index 2764d00f9..000000000 --- a/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java +++ /dev/null @@ -1,22 +0,0 @@ -package gg.recruit.api; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -import gg.auth.UserDto; -import gg.auth.argumentresolver.Login; - -@RestController -public class TestController { - - @GetMapping("/test") - public String test() { - return "test"; - } - - @GetMapping("/login") - public String login(@Login UserDto user) { - System.out.println("user = " + user); - return "login"; - } -} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/ApplicationController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/ApplicationController.java new file mode 100644 index 000000000..7eaa6c448 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/ApplicationController.java @@ -0,0 +1,25 @@ +package gg.recruit.api.user.application.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import gg.auth.UserDto; +import gg.auth.argumentresolver.Login; +import gg.recruit.api.user.application.controller.response.MyApplicationsResDto; +import gg.recruit.api.user.application.service.ApplicationService; +import gg.recruit.api.user.application.service.response.ApplicationListDto; +import lombok.RequiredArgsConstructor; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/recruitments") +public class ApplicationController { + + private final ApplicationService applicationService; + @GetMapping("/applications") + public MyApplicationsResDto getMyApplications(@Login UserDto userDto) { + ApplicationListDto res = applicationService.findMyApplications(userDto.getId()); + return new MyApplicationsResDto(res); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/ApplicationResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/ApplicationResDto.java new file mode 100644 index 000000000..26cbfe311 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/ApplicationResDto.java @@ -0,0 +1,29 @@ +package gg.recruit.api.user.application.controller.response; + +import java.time.LocalDateTime; + +import gg.recruit.api.user.application.service.response.ApplicationDto; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class ApplicationResDto { + private Long recruitId; + private Long applicationId; + private LocalDateTime startDate; + private LocalDateTime endDate; + private String title; + private String generation; + private String status; + + public ApplicationResDto(ApplicationDto applicationDto) { + this.recruitId = applicationDto.getRecruitId(); + this.applicationId = applicationDto.getApplicationId(); + this.startDate = applicationDto.getStartDate(); + this.endDate = applicationDto.getEndDate(); + this.title = applicationDto.getTitle(); + this.generation = applicationDto.getGeneration(); + this.status = applicationDto.getStatus(); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/MyApplicationsResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/MyApplicationsResDto.java new file mode 100644 index 000000000..f899b5288 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/MyApplicationsResDto.java @@ -0,0 +1,21 @@ +package gg.recruit.api.user.application.controller.response; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.recruit.api.user.application.service.response.ApplicationListDto; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class MyApplicationsResDto { + private List applications; + + public MyApplicationsResDto(ApplicationListDto applicationListDto) { + applications = applicationListDto.getApplications() + .stream() + .map(ApplicationResDto::new) + .collect(Collectors.toList()); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/ApplicationService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/ApplicationService.java new file mode 100644 index 000000000..954ce734f --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/ApplicationService.java @@ -0,0 +1,22 @@ +package gg.recruit.api.user.application.service; + +import java.util.List; + +import org.springframework.stereotype.Service; + +import gg.data.recruit.application.Application; +import gg.recruit.api.user.application.service.response.ApplicationListDto; +import gg.repo.recruit.user.application.ApplicationRepository; +import lombok.RequiredArgsConstructor; + +@Service +@RequiredArgsConstructor +public class ApplicationService { + + private final ApplicationRepository applicationRepository; + + public ApplicationListDto findMyApplications(Long userId) { + List res = applicationRepository.findAllByUserId(userId); + return new ApplicationListDto(res); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationDto.java new file mode 100644 index 000000000..4393218d9 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationDto.java @@ -0,0 +1,29 @@ +package gg.recruit.api.user.application.service.response; + +import java.time.LocalDateTime; + +import gg.data.recruit.application.Application; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class ApplicationDto { + private Long recruitId; + private Long applicationId; + private LocalDateTime startDate; + private LocalDateTime endDate; + private String title; + private String generation; + private String status; + + public ApplicationDto(Application application) { + this.recruitId = application.getRecruit().getId(); + this.applicationId = application.getId(); + this.startDate = application.getRecruit().getStartTime(); + this.endDate = application.getRecruit().getEndTime(); + this.title = application.getRecruit().getTitle(); + this.generation = application.getRecruit().getGeneration(); + this.status = application.getStatus().name(); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationListDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationListDto.java new file mode 100644 index 000000000..370d3cfdc --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationListDto.java @@ -0,0 +1,17 @@ +package gg.recruit.api.user.application.service.response; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.data.recruit.application.Application; +import lombok.Getter; + +@Getter +public class ApplicationListDto { + List applications; + + public ApplicationListDto(List applications) { + this.applications = applications.stream().map(ApplicationDto::new) + .collect(Collectors.toList()); + } +} diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/TestSpringBootApplication.java b/gg-recruit-api/src/test/java/gg/recruit/api/TestSpringBootApplication.java new file mode 100644 index 000000000..dcc4eecb9 --- /dev/null +++ b/gg-recruit-api/src/test/java/gg/recruit/api/TestSpringBootApplication.java @@ -0,0 +1,8 @@ +package gg.recruit.api; + +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication(scanBasePackages = {"gg.recruit.api", "gg.utils", "gg.data", "gg.repo", + "gg.admin.repo", "gg.auth", "gg.pingpong.api"}) +public class TestSpringBootApplication { +} diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/application/controller/ApplicationControllerTest.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/application/controller/ApplicationControllerTest.java new file mode 100644 index 000000000..df89b5844 --- /dev/null +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/application/controller/ApplicationControllerTest.java @@ -0,0 +1,61 @@ +package gg.recruit.api.user.application.controller; + +import static org.junit.jupiter.api.Assertions.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.transaction.annotation.Transactional; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import gg.data.recruit.recruitment.Recruitments; +import gg.data.user.User; +import gg.recruit.api.user.application.controller.response.MyApplicationsResDto; +import gg.utils.RecruitMockData; +import gg.utils.TestDataUtils; +import gg.utils.annotation.IntegrationTest; + +@IntegrationTest +@Transactional +@AutoConfigureMockMvc +class ApplicationControllerTest { + + @Autowired + private RecruitMockData recruitMockData; + @Autowired + private TestDataUtils testDataUtils; + @Autowired + private ObjectMapper objectMapper; + @Autowired + private MockMvc mockMvc; + + @Test + @DisplayName("GET /recruitments/applications -> 200 OK TEST") + public void getMyApplicationsTest() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + + Recruitments recruitments = recruitMockData.createRecruitments(); + Recruitments recruitments2 = recruitMockData.createRecruitments(); + Recruitments recruitments3 = recruitMockData.createRecruitments(); + + recruitMockData.createApplication(user, recruitments); + recruitMockData.createApplication(user, recruitments2); + recruitMockData.createApplication(user, recruitments3); + + //when + String res = mockMvc.perform(get(("/recruitments/applications")) + .header("Authorization", "Bearer " + accessToken)) + .andExpect(status().isOk()).andReturn().getResponse().getContentAsString(); + + //then + MyApplicationsResDto myApplicationsResDto = objectMapper.readValue(res, MyApplicationsResDto.class); + assertEquals(3, myApplicationsResDto.getApplications().size()); + } +} diff --git a/gg-recruit-api/src/test/resources/application.yml b/gg-recruit-api/src/test/resources/application.yml new file mode 100644 index 000000000..f28374ce9 --- /dev/null +++ b/gg-recruit-api/src/test/resources/application.yml @@ -0,0 +1,184 @@ +spring: + application: + name: 42gg + + profiles: + active: testCode + + security: + oauth2.client: + authenticationScheme: header + registration: + 42: + redirect-uri: "{baseUrl}/{action}/oauth2/code/{registrationId}" + authorization-grant-type: authorization_code + scope: public + kakao: + redirect-uri: "{baseUrl}/{action}/oauth2/code/{registrationId}" + authorization-grant-type: authorization_code + scope: profile_nickname, profile_image, account_email + provider: + 42: + authorization-uri: "https://api.intra.42.fr/oauth/authorize" + token-uri: "https://api.intra.42.fr/oauth/token" + user-info-uri: "https://api.intra.42.fr/v2/me" + user-name-attribute: id + kakao: + authorization-uri: "https://kauth.kakao.com/oauth/authorize" + token-uri: "https://kauth.kakao.com/oauth/token" + user-info-uri: "https://kapi.kakao.com/v2/user/me" + user-name-attribute: id + + mvc: + hiddenmethod: + filter: + enabled: true + data: + web: + pageable: + default-page-size: 20 + one-indexed-parameters: false + + mail: + host: smtp.gmail.com + port: 587 + username: dummy + password: dummy + properties: + mail: + smtp: + starttls: + enable: true + required: true + auth: true + + # Message ์„ค์ • + messages: + basename: 'messages/validation' + encoding: UTF-8 + +springdoc: + swagger-ui: + path: /api-docs + default-consumes-media-type: application/json + default-produces-media-type: application/json + +app: + auth: + tokenSecret: authdummydummydummydummydummydummydummydummydummy + refreshTokenSecret: refreshdummydummydummydummydummydummydummydummydummy + +info: + image: + defaultUrl: 'https://42gg-public-test-image.s3.ap-northeast-2.amazonaws.com/images/small_default.jpeg' + itemNotFoundUrl: 'https://42gg-public-test-image.s3.ap-northeast-2.amazonaws.com/images/not_found.svg' + +constant: + allowedMinimalStartDays: 2 + tournamentSchedule: "0 0 0 * * *" + +# -- actuator + +management: + server: + port: 8081 + + info: + java: + enabled: true + os: + enabled: true + env: + enabled: true + + health: + show-details: always + + endpoints: + jmx: + exposure: + exclude: "*" + + web: + exposure: + include: "prometheus" + +server: + tomcat: + mbeanregistry: + enabled: true + +--- +spring.config.activate.on-profile: testCode + +# =========================== LOCAL =========================== +spring: + flyway: + enabled: true + baselineOnMigrate: true + locations: classpath:db/migration + user: root + password: 1234 + + jpa: + database-platform: org.hibernate.dialect.MySQL8Dialect + hibernate: + ddl-auto: validate + properties: + hibernate: + show_sql: true + format_sql: true + use_sql_comments: false + + security: + oauth2.client: + registration: + 42: + client-id: "dummy" + client-secret: "dummy" + kakao: + client-id: "dummy" + client-secret: "dummy" + client-authentication-method: POST + + # Redis ์„ค์ • + cache: + type: redis + +# cors ์„ค์ • +cors: + allowed-origins: 'http://localhost:8080,http://127.0.0.1:8081' + allowed-methods: GET,POST,PUT,DELETE,OPTIONS,PATCH + allowed-headers: '*' + allowed-Credentials: false + max-age: 3600 + +logging-level: + org.hibernate.SQL: debug + org.hibernate.type: trace + +slack: + xoxbToken: "dummy" + +info: + web: + frontUrl: 'http://localhost:8080' + domain: "localhost" + +cloud: + aws: + credentials: + accessKey: dummy + secretKey: dummy + s3: + bucket: 42gg-public-test-image + dir: images/ + region: + static: ap-northeast-2 + stack: + auto: false + +app: + auth: + refreshTokenExpiry: 604800000 + tokenExpiry: 604800000 diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java new file mode 100644 index 000000000..969f376d2 --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java @@ -0,0 +1,16 @@ +package gg.repo.recruit.user.application; + +import java.util.List; + +import org.springframework.data.jpa.repository.EntityGraph; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import gg.data.recruit.application.Application; + +public interface ApplicationRepository extends JpaRepository { + + @EntityGraph(attributePaths = {"recruit"}) + @Query("SELECT a FROM Application a WHERE a.user.id = :userId and a.isDeleted = false") + List findAllByUserId(Long userId); +} diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java new file mode 100644 index 000000000..215fa9758 --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java @@ -0,0 +1,8 @@ +package gg.repo.recruit.user.recruitment; + +import org.springframework.data.jpa.repository.JpaRepository; + +import gg.data.recruit.recruitment.Recruitments; + +public interface RecruitmentRepository extends JpaRepository { +} diff --git a/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java b/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java new file mode 100644 index 000000000..cf1ae70e7 --- /dev/null +++ b/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java @@ -0,0 +1,30 @@ +package gg.utils; + +import java.time.LocalDateTime; + +import org.springframework.stereotype.Component; + +import gg.data.recruit.application.Application; +import gg.data.recruit.recruitment.Recruitments; +import gg.data.user.User; +import gg.repo.recruit.user.application.ApplicationRepository; +import gg.repo.recruit.user.recruitment.RecruitmentRepository; +import lombok.RequiredArgsConstructor; + +@Component +@RequiredArgsConstructor +public class RecruitMockData { + private final RecruitmentRepository recruitmentRepository; + private final ApplicationRepository applicationRepository; + + public Recruitments createRecruitments() { + Recruitments recruitments = new Recruitments("title", "contents", "generation", + LocalDateTime.now(), LocalDateTime.now().plusDays(1)); + return recruitmentRepository.save(recruitments); + } + + public Application createApplication(User user, Recruitments recruitments) { + Application application = new Application(user, recruitments); + return applicationRepository.save(application); + } +} From 7a31d5dacf4b62c661b5db326a2e600b3053d951 Mon Sep 17 00:00:00 2001 From: yoahn <46748334+AYoungSn@users.noreply.github.com> Date: Tue, 12 Mar 2024 19:41:12 +0900 Subject: [PATCH 04/12] =?UTF-8?q?#578=20feature=20=EB=AA=A8=EC=A7=91?= =?UTF-8?q?=EC=A4=91=EC=9D=B8=20=EA=B3=B5=EA=B3=A0=20=EB=AA=A9=EB=A1=9D=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20api=20(#712)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../game/controller/GameAdminController.java | 2 +- .../game/dto/GameUserLogAdminReqDto.java | 2 +- .../AnnouncementAdminController.java | 2 +- .../controller/PenaltyAdminController.java | 2 +- .../request/FeedbackAdminPageRequestDto.java | 2 +- .../request/NotiListAdminRequestDto.java | 2 +- .../controller/CoinPolicyAdminController.java | 2 +- .../store/controller/ItemAdminController.java | 2 +- .../controller/MegaphoneAdminController.java | 2 +- .../request/ReceiptAdminPageRequestDto.java | 2 +- .../user/controller/UserAdminController.java | 2 +- .../request/UserSearchAdminRequestDto.java | 2 +- .../request/NormalGameListReqDto.java | 2 +- .../user/rank/controller/RankController.java | 2 +- .../rank/controller/RankV2Controller.java | 2 +- .../user/store/controller/ItemController.java | 2 +- .../request/TournamentFilterRequestDto.java | 2 +- .../user/user/controller/UserController.java | 2 +- .../AnnouncementAdminControllerUnitTest.java | 2 +- .../controller/ApplicationController.java | 9 +-- .../controller/RecruitmentController.java | 25 ++++++++ .../response/ActiveRecruitmentListResDto.java | 20 +++++++ .../response/ApplicationResDto.java | 4 +- .../response/MyApplicationsResDto.java | 4 +- .../controller/response/RecruitmentDto.java | 32 ++++++++++ .../response/RecruitmentStatus.java | 9 +++ .../service/ApplicationService.java | 4 +- .../api/user/service/RecruitmentService.java | 23 ++++++++ .../service/response/ApplicationDto.java | 2 +- .../service/response/ApplicationListDto.java | 2 +- .../response/RecruitmentListSvcDto.java | 20 +++++++ .../service/response/RecruitmentSvcDto.java | 25 ++++++++ .../controller/ApplicationControllerTest.java | 4 +- .../controller/RecruitmentControllerTest.java | 58 +++++++++++++++++++ .../recruitment/RecruitmentRepository.java | 12 +++- .../RecruitmentRepositoryCustom.java | 5 ++ .../RecruitmentRepositoryCustomImpl.java | 12 ++++ .../java/gg/utils}/dto/PageRequestDto.java | 2 +- 38 files changed, 275 insertions(+), 35 deletions(-) rename gg-recruit-api/src/main/java/gg/recruit/api/user/{application => }/controller/ApplicationController.java (71%) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ActiveRecruitmentListResDto.java rename gg-recruit-api/src/main/java/gg/recruit/api/user/{application => }/controller/response/ApplicationResDto.java (84%) rename gg-recruit-api/src/main/java/gg/recruit/api/user/{application => }/controller/response/MyApplicationsResDto.java (76%) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentStatus.java rename gg-recruit-api/src/main/java/gg/recruit/api/user/{application => }/service/ApplicationService.java (80%) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/RecruitmentService.java rename gg-recruit-api/src/main/java/gg/recruit/api/user/{application => }/service/response/ApplicationDto.java (93%) rename gg-recruit-api/src/main/java/gg/recruit/api/user/{application => }/service/response/ApplicationListDto.java (86%) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentListSvcDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentSvcDto.java rename gg-recruit-api/src/test/java/gg/recruit/api/user/{application => }/controller/ApplicationControllerTest.java (94%) create mode 100644 gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java create mode 100644 gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepositoryCustom.java create mode 100644 gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepositoryCustomImpl.java rename {gg-pingpong-api/src/main/java/gg/pingpong/api/global => gg-utils/src/main/java/gg/utils}/dto/PageRequestDto.java (94%) diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/controller/GameAdminController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/controller/GameAdminController.java index 3391d8cb1..43d77c7f1 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/controller/GameAdminController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/controller/GameAdminController.java @@ -20,8 +20,8 @@ import gg.pingpong.api.admin.game.dto.GameUserLogAdminReqDto; import gg.pingpong.api.admin.game.dto.RankGamePPPModifyReqDto; import gg.pingpong.api.admin.game.service.GameAdminService; -import gg.pingpong.api.global.dto.PageRequestDto; import gg.pingpong.api.user.rank.redis.RankRedisService; +import gg.utils.dto.PageRequestDto; import gg.utils.exception.ErrorCode; import gg.utils.exception.custom.InvalidParameterException; import lombok.RequiredArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/dto/GameUserLogAdminReqDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/dto/GameUserLogAdminReqDto.java index ea4b42050..70d700ef9 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/dto/GameUserLogAdminReqDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/dto/GameUserLogAdminReqDto.java @@ -2,7 +2,7 @@ import javax.validation.constraints.NotNull; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.Getter; @Getter diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/AnnouncementAdminController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/AnnouncementAdminController.java index 7f9ef0498..cdd2c326d 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/AnnouncementAdminController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/AnnouncementAdminController.java @@ -20,7 +20,7 @@ import gg.pingpong.api.admin.manage.controller.response.AnnouncementAdminListResponseDto; import gg.pingpong.api.admin.manage.dto.AnnouncementAdminAddDto; import gg.pingpong.api.admin.manage.service.AnnouncementAdminService; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.AllArgsConstructor; @RestController diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/PenaltyAdminController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/PenaltyAdminController.java index 69375f5de..771b4ba97 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/PenaltyAdminController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/PenaltyAdminController.java @@ -22,7 +22,7 @@ import gg.pingpong.api.admin.manage.controller.request.PenaltyRequestDto; import gg.pingpong.api.admin.manage.controller.response.PenaltyListResponseDto; import gg.pingpong.api.admin.manage.service.PenaltyAdminService; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.RequiredArgsConstructor; @RestController diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/request/FeedbackAdminPageRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/request/FeedbackAdminPageRequestDto.java index 80fbdb426..81daef33e 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/request/FeedbackAdminPageRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/manage/controller/request/FeedbackAdminPageRequestDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.admin.manage.controller.request; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.Getter; @Getter diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/noti/controller/request/NotiListAdminRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/noti/controller/request/NotiListAdminRequestDto.java index 2d545d127..edf72b834 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/noti/controller/request/NotiListAdminRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/noti/controller/request/NotiListAdminRequestDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.admin.noti.controller.request; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.Getter; import lombok.Setter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/CoinPolicyAdminController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/CoinPolicyAdminController.java index a39c643aa..f05386eda 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/CoinPolicyAdminController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/CoinPolicyAdminController.java @@ -20,7 +20,7 @@ import gg.pingpong.api.admin.store.controller.response.CoinPolicyAdminListResponseDto; import gg.pingpong.api.admin.store.dto.CoinPolicyAdminAddDto; import gg.pingpong.api.admin.store.service.CoinPolicyAdminService; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import io.swagger.v3.oas.annotations.Parameter; import lombok.RequiredArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/ItemAdminController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/ItemAdminController.java index 21b1e8963..837c482cb 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/ItemAdminController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/ItemAdminController.java @@ -25,7 +25,7 @@ import gg.pingpong.api.admin.store.controller.request.ItemUpdateRequestDto; import gg.pingpong.api.admin.store.controller.response.ItemListResponseDto; import gg.pingpong.api.admin.store.service.ItemAdminService; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import gg.utils.exception.item.ItemImageLargeException; import gg.utils.exception.item.ItemImageTypeException; import io.swagger.v3.oas.annotations.Parameter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/MegaphoneAdminController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/MegaphoneAdminController.java index 79e67c696..79814830b 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/MegaphoneAdminController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/MegaphoneAdminController.java @@ -13,7 +13,7 @@ import gg.pingpong.api.admin.store.controller.response.MegaphoneHistoryResponseDto; import gg.pingpong.api.admin.store.service.MegaphoneAdminService; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.RequiredArgsConstructor; @RestController diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/request/ReceiptAdminPageRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/request/ReceiptAdminPageRequestDto.java index 89a895eaa..f3d90d132 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/request/ReceiptAdminPageRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/store/controller/request/ReceiptAdminPageRequestDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.admin.store.controller.request; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.Getter; @Getter diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/UserAdminController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/UserAdminController.java index ebffae2c6..0ec5c085e 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/UserAdminController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/UserAdminController.java @@ -24,7 +24,7 @@ import gg.pingpong.api.admin.user.controller.response.UserImageListAdminResponseDto; import gg.pingpong.api.admin.user.controller.response.UserSearchAdminResponseDto; import gg.pingpong.api.admin.user.service.UserAdminService; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import gg.utils.exception.user.UserImageLargeException; import gg.utils.exception.user.UserImageTypeException; import lombok.AllArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/request/UserSearchAdminRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/request/UserSearchAdminRequestDto.java index 13eb69f47..4fe7bcba1 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/request/UserSearchAdminRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/user/controller/request/UserSearchAdminRequestDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.admin.user.controller.request; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.Getter; import lombok.Setter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/request/NormalGameListReqDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/request/NormalGameListReqDto.java index 98c4380ea..2ebcd14d5 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/request/NormalGameListReqDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/game/controller/request/NormalGameListReqDto.java @@ -1,6 +1,6 @@ package gg.pingpong.api.user.game.controller.request; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.Getter; import lombok.Setter; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/controller/RankController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/controller/RankController.java index 726658e33..9ffefe890 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/controller/RankController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/controller/RankController.java @@ -10,10 +10,10 @@ import gg.auth.UserDto; import gg.auth.argumentresolver.Login; -import gg.pingpong.api.global.dto.PageRequestDto; import gg.pingpong.api.user.rank.controller.response.ExpRankPageResponseDto; import gg.pingpong.api.user.rank.controller.response.RankPageResponseDto; import gg.pingpong.api.user.rank.service.RankService; +import gg.utils.dto.PageRequestDto; import io.swagger.v3.oas.annotations.Parameter; import lombok.RequiredArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/controller/RankV2Controller.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/controller/RankV2Controller.java index 488817a87..8384c4347 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/controller/RankV2Controller.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/rank/controller/RankV2Controller.java @@ -12,10 +12,10 @@ import gg.auth.UserDto; import gg.auth.argumentresolver.Login; -import gg.pingpong.api.global.dto.PageRequestDto; import gg.pingpong.api.user.rank.controller.response.ExpRankPageResponseDto; import gg.pingpong.api.user.rank.controller.response.RankPageResponseDto; import gg.pingpong.api.user.rank.service.RankService; +import gg.utils.dto.PageRequestDto; import io.swagger.v3.oas.annotations.Parameter; import lombok.RequiredArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/ItemController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/ItemController.java index 31fbdfd20..4e60188d5 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/ItemController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/store/controller/ItemController.java @@ -17,11 +17,11 @@ import gg.auth.UserDto; import gg.auth.argumentresolver.Login; -import gg.pingpong.api.global.dto.PageRequestDto; import gg.pingpong.api.user.store.controller.request.ItemGiftRequestDto; import gg.pingpong.api.user.store.controller.response.ItemStoreListResponseDto; import gg.pingpong.api.user.store.controller.response.UserItemListResponseDto; import gg.pingpong.api.user.store.service.ItemService; +import gg.utils.dto.PageRequestDto; import io.swagger.v3.oas.annotations.Parameter; import lombok.RequiredArgsConstructor; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/request/TournamentFilterRequestDto.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/request/TournamentFilterRequestDto.java index cfbcd9722..ee16b1870 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/request/TournamentFilterRequestDto.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/tournament/controller/request/TournamentFilterRequestDto.java @@ -2,7 +2,7 @@ import gg.data.pingpong.tournament.type.TournamentStatus; import gg.data.pingpong.tournament.type.TournamentType; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.utils.dto.PageRequestDto; import lombok.Getter; @Getter diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/UserController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/UserController.java index 001dc7cc0..a8f277cc6 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/UserController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/user/user/controller/UserController.java @@ -31,7 +31,6 @@ import gg.data.pingpong.game.type.Mode; import gg.data.user.type.OauthType; import gg.data.user.type.RoleType; -import gg.pingpong.api.global.dto.PageRequestDto; import gg.pingpong.api.global.security.cookie.CookieUtil; import gg.pingpong.api.global.security.jwt.utils.TokenHeaders; import gg.pingpong.api.user.user.controller.request.UserModifyRequestDto; @@ -54,6 +53,7 @@ import gg.pingpong.api.user.user.service.UserAuthenticationService; import gg.pingpong.api.user.user.service.UserCoinService; import gg.pingpong.api.user.user.service.UserService; +import gg.utils.dto.PageRequestDto; import gg.utils.exception.user.KakaoOauth2AlreadyExistException; import io.swagger.v3.oas.annotations.Parameter; import lombok.RequiredArgsConstructor; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/announcement/controller/AnnouncementAdminControllerUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/announcement/controller/AnnouncementAdminControllerUnitTest.java index bea390428..7b071e15e 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/announcement/controller/AnnouncementAdminControllerUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/announcement/controller/AnnouncementAdminControllerUnitTest.java @@ -16,8 +16,8 @@ import gg.pingpong.api.admin.manage.controller.response.AnnouncementAdminListResponseDto; import gg.pingpong.api.admin.manage.dto.AnnouncementAdminAddDto; import gg.pingpong.api.admin.manage.service.AnnouncementAdminService; -import gg.pingpong.api.global.dto.PageRequestDto; import gg.utils.annotation.UnitTest; +import gg.utils.dto.PageRequestDto; @UnitTest @ExtendWith(MockitoExtension.class) diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/ApplicationController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java similarity index 71% rename from gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/ApplicationController.java rename to gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java index 7eaa6c448..2b3c8bbd2 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/ApplicationController.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java @@ -1,4 +1,4 @@ -package gg.recruit.api.user.application.controller; +package gg.recruit.api.user.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -6,9 +6,9 @@ import gg.auth.UserDto; import gg.auth.argumentresolver.Login; -import gg.recruit.api.user.application.controller.response.MyApplicationsResDto; -import gg.recruit.api.user.application.service.ApplicationService; -import gg.recruit.api.user.application.service.response.ApplicationListDto; +import gg.recruit.api.user.controller.response.MyApplicationsResDto; +import gg.recruit.api.user.service.ApplicationService; +import gg.recruit.api.user.service.response.ApplicationListDto; import lombok.RequiredArgsConstructor; @RestController @@ -17,6 +17,7 @@ public class ApplicationController { private final ApplicationService applicationService; + @GetMapping("/applications") public MyApplicationsResDto getMyApplications(@Login UserDto userDto) { ApplicationListDto res = applicationService.findMyApplications(userDto.getId()); diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java new file mode 100644 index 000000000..ca6790442 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java @@ -0,0 +1,25 @@ +package gg.recruit.api.user.controller; + +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import gg.recruit.api.user.controller.response.ActiveRecruitmentListResDto; +import gg.recruit.api.user.service.RecruitmentService; +import gg.utils.dto.PageRequestDto; +import lombok.RequiredArgsConstructor; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/recruitments") +public class RecruitmentController { + private final RecruitmentService recruitmentService; + + @GetMapping + public ActiveRecruitmentListResDto findActiveRecruitmentList(PageRequestDto requestDto) { + Pageable pageable = PageRequest.of(requestDto.getPage() - 1, requestDto.getSize()); + return new ActiveRecruitmentListResDto(recruitmentService.findActiveRecruitmentList(pageable)); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ActiveRecruitmentListResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ActiveRecruitmentListResDto.java new file mode 100644 index 000000000..c0429edb5 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ActiveRecruitmentListResDto.java @@ -0,0 +1,20 @@ +package gg.recruit.api.user.controller.response; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.recruit.api.user.service.response.RecruitmentListSvcDto; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class ActiveRecruitmentListResDto { + private List recruitments; + private Integer totalPage; + + public ActiveRecruitmentListResDto(RecruitmentListSvcDto dto) { + this.recruitments = dto.getRecruitments().stream().map(RecruitmentDto::new).collect(Collectors.toList()); + this.totalPage = dto.getTotalPage(); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/ApplicationResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResDto.java similarity index 84% rename from gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/ApplicationResDto.java rename to gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResDto.java index 26cbfe311..7c0df2d21 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/ApplicationResDto.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResDto.java @@ -1,8 +1,8 @@ -package gg.recruit.api.user.application.controller.response; +package gg.recruit.api.user.controller.response; import java.time.LocalDateTime; -import gg.recruit.api.user.application.service.response.ApplicationDto; +import gg.recruit.api.user.service.response.ApplicationDto; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/MyApplicationsResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationsResDto.java similarity index 76% rename from gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/MyApplicationsResDto.java rename to gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationsResDto.java index f899b5288..1f67eb9d0 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/controller/response/MyApplicationsResDto.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationsResDto.java @@ -1,9 +1,9 @@ -package gg.recruit.api.user.application.controller.response; +package gg.recruit.api.user.controller.response; import java.util.List; import java.util.stream.Collectors; -import gg.recruit.api.user.application.service.response.ApplicationListDto; +import gg.recruit.api.user.service.response.ApplicationListDto; import lombok.Getter; import lombok.NoArgsConstructor; diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentDto.java new file mode 100644 index 000000000..00d9cf175 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentDto.java @@ -0,0 +1,32 @@ +package gg.recruit.api.user.controller.response; + +import java.time.LocalDateTime; + +import gg.recruit.api.user.service.response.RecruitmentSvcDto; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class RecruitmentDto { + private Long id; + private LocalDateTime startDate; + private LocalDateTime endDate; + private String title; + private RecruitmentStatus status; + private String generation; + + public RecruitmentDto(RecruitmentSvcDto dto) { + this.id = dto.getId(); + this.startDate = dto.getStartDate(); + this.endDate = dto.getEndDate(); + this.title = dto.getTitle(); + this.generation = dto.getGeneration(); + this.status = RecruitmentStatus.BEFORE; + if (LocalDateTime.now().isAfter(dto.getStartDate()) && LocalDateTime.now().isBefore(dto.getEndDate())) { + this.status = RecruitmentStatus.PROGRESS; + } else if (LocalDateTime.now().isAfter(dto.getEndDate())) { + this.status = RecruitmentStatus.FINISHED; + } + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentStatus.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentStatus.java new file mode 100644 index 000000000..70ddeb385 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentStatus.java @@ -0,0 +1,9 @@ +package gg.recruit.api.user.controller.response; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public enum RecruitmentStatus { + BEFORE("๋ชจ์ง‘์ „"), PROGRESS("๋ชจ์ง‘์ค‘"), FINISHED("๋ชจ์ง‘์™„๋ฃŒ"); + private final String desc; +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/ApplicationService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java similarity index 80% rename from gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/ApplicationService.java rename to gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java index 954ce734f..92fef6fb9 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/ApplicationService.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java @@ -1,11 +1,11 @@ -package gg.recruit.api.user.application.service; +package gg.recruit.api.user.service; import java.util.List; import org.springframework.stereotype.Service; import gg.data.recruit.application.Application; -import gg.recruit.api.user.application.service.response.ApplicationListDto; +import gg.recruit.api.user.service.response.ApplicationListDto; import gg.repo.recruit.user.application.ApplicationRepository; import lombok.RequiredArgsConstructor; diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/RecruitmentService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/RecruitmentService.java new file mode 100644 index 000000000..d090cfd0e --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/RecruitmentService.java @@ -0,0 +1,23 @@ +package gg.recruit.api.user.service; + +import java.time.LocalDateTime; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; + +import gg.data.recruit.recruitment.Recruitments; +import gg.recruit.api.user.service.response.RecruitmentListSvcDto; +import gg.repo.recruit.user.recruitment.RecruitmentRepository; +import lombok.RequiredArgsConstructor; + +@Service +@RequiredArgsConstructor +public class RecruitmentService { + private final RecruitmentRepository recruitmentRepository; + + public RecruitmentListSvcDto findActiveRecruitmentList(Pageable pageable) { + Page pages = recruitmentRepository.findActiveRecruitmentList(LocalDateTime.now(), pageable); + return new RecruitmentListSvcDto(pages.getContent(), pages.getTotalPages()); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationDto.java similarity index 93% rename from gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationDto.java rename to gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationDto.java index 4393218d9..facb2d82b 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationDto.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationDto.java @@ -1,4 +1,4 @@ -package gg.recruit.api.user.application.service.response; +package gg.recruit.api.user.service.response; import java.time.LocalDateTime; diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationListDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListDto.java similarity index 86% rename from gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationListDto.java rename to gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListDto.java index 370d3cfdc..b361fcb52 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/application/service/response/ApplicationListDto.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListDto.java @@ -1,4 +1,4 @@ -package gg.recruit.api.user.application.service.response; +package gg.recruit.api.user.service.response; import java.util.List; import java.util.stream.Collectors; diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentListSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentListSvcDto.java new file mode 100644 index 000000000..8baa6e5ac --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentListSvcDto.java @@ -0,0 +1,20 @@ +package gg.recruit.api.user.service.response; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.data.recruit.recruitment.Recruitments; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class RecruitmentListSvcDto { + private List recruitments; + private Integer totalPage; + + public RecruitmentListSvcDto(List recruitments, Integer totalPage) { + this.recruitments = recruitments.stream().map(RecruitmentSvcDto::new).collect(Collectors.toList()); + this.totalPage = totalPage; + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentSvcDto.java new file mode 100644 index 000000000..a14d09b6f --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentSvcDto.java @@ -0,0 +1,25 @@ +package gg.recruit.api.user.service.response; + +import java.time.LocalDateTime; + +import gg.data.recruit.recruitment.Recruitments; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class RecruitmentSvcDto { + private Long id; + private LocalDateTime startDate; + private LocalDateTime endDate; + private String title; + private String generation; + + public RecruitmentSvcDto(Recruitments recruitments) { + this.id = recruitments.getId(); + this.startDate = recruitments.getStartTime(); + this.endDate = recruitments.getEndTime(); + this.title = recruitments.getTitle(); + this.generation = recruitments.getGeneration(); + } +} diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/application/controller/ApplicationControllerTest.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java similarity index 94% rename from gg-recruit-api/src/test/java/gg/recruit/api/user/application/controller/ApplicationControllerTest.java rename to gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java index df89b5844..f4039faeb 100644 --- a/gg-recruit-api/src/test/java/gg/recruit/api/user/application/controller/ApplicationControllerTest.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java @@ -1,4 +1,4 @@ -package gg.recruit.api.user.application.controller; +package gg.recruit.api.user.controller; import static org.junit.jupiter.api.Assertions.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; @@ -15,7 +15,7 @@ import gg.data.recruit.recruitment.Recruitments; import gg.data.user.User; -import gg.recruit.api.user.application.controller.response.MyApplicationsResDto; +import gg.recruit.api.user.controller.response.MyApplicationsResDto; import gg.utils.RecruitMockData; import gg.utils.TestDataUtils; import gg.utils.annotation.IntegrationTest; diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java new file mode 100644 index 000000000..2a97136b5 --- /dev/null +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java @@ -0,0 +1,58 @@ +package gg.recruit.api.user.controller; + +import static org.assertj.core.api.Assertions.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.transaction.annotation.Transactional; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import gg.data.recruit.recruitment.Recruitments; +import gg.data.user.User; +import gg.recruit.api.user.controller.response.ActiveRecruitmentListResDto; +import gg.utils.RecruitMockData; +import gg.utils.TestDataUtils; +import gg.utils.annotation.IntegrationTest; + +@IntegrationTest +@Transactional +@AutoConfigureMockMvc +class RecruitmentControllerTest { + @Autowired + private ObjectMapper objectMapper; + @Autowired + private MockMvc mockMvc; + @Autowired + private RecruitMockData recruitMockData; + @Autowired + private TestDataUtils testDataUtils; + + @Test + @DisplayName("GET /recruitments -> 200 OK TEST") + void findActiveRecruitmentList() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + + Recruitments recruitments = recruitMockData.createRecruitments(); + Recruitments recruitments2 = recruitMockData.createRecruitments(); + Recruitments recruitments3 = recruitMockData.createRecruitments(); + //when + String res = mockMvc.perform(get("/recruitments") + .param("page", "1") + .param("size", "10") + .header("Authorization", "Bearer " + accessToken)) + .andExpect(status().isOk()).andReturn().getResponse().getContentAsString(); + + //then + ActiveRecruitmentListResDto resDto = objectMapper.readValue(res, ActiveRecruitmentListResDto.class); + assertThat(resDto.getRecruitments().size()).isEqualTo(3); + assertThat(resDto.getTotalPage()).isEqualTo(1); + } +} diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java index 215fa9758..079860917 100644 --- a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java @@ -1,8 +1,18 @@ package gg.repo.recruit.user.recruitment; +import java.time.LocalDateTime; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import gg.data.recruit.recruitment.Recruitments; -public interface RecruitmentRepository extends JpaRepository { +public interface RecruitmentRepository extends JpaRepository, RecruitmentRepositoryCustom { + @Query("SELECT r FROM Recruitments r " + + "WHERE r.isDeleted = false AND r.startTime <= :date AND r.isFinish = false " + + "ORDER BY r.startTime DESC") + Page findActiveRecruitmentList(@Param("date") LocalDateTime date, Pageable pageable); } diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepositoryCustom.java b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepositoryCustom.java new file mode 100644 index 000000000..3651b20d9 --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepositoryCustom.java @@ -0,0 +1,5 @@ +package gg.repo.recruit.user.recruitment; + +public interface RecruitmentRepositoryCustom { + +} diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepositoryCustomImpl.java b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepositoryCustomImpl.java new file mode 100644 index 000000000..7e3d6f06a --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepositoryCustomImpl.java @@ -0,0 +1,12 @@ +package gg.repo.recruit.user.recruitment; + +import javax.persistence.EntityManager; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public class RecruitmentRepositoryCustomImpl implements RecruitmentRepositoryCustom { + + private final EntityManager em; + +} diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/dto/PageRequestDto.java b/gg-utils/src/main/java/gg/utils/dto/PageRequestDto.java similarity index 94% rename from gg-pingpong-api/src/main/java/gg/pingpong/api/global/dto/PageRequestDto.java rename to gg-utils/src/main/java/gg/utils/dto/PageRequestDto.java index 868992210..619b10791 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/dto/PageRequestDto.java +++ b/gg-utils/src/main/java/gg/utils/dto/PageRequestDto.java @@ -1,4 +1,4 @@ -package gg.pingpong.api.global.dto; +package gg.utils.dto; import javax.validation.constraints.Max; import javax.validation.constraints.Min; From f6597d4c1615273f54630fb4a544fbc938449057 Mon Sep 17 00:00:00 2001 From: yoahn <46748334+AYoungSn@users.noreply.github.com> Date: Tue, 12 Mar 2024 19:46:00 +0900 Subject: [PATCH 05/12] =?UTF-8?q?[REFACT]=20#724=20Jpa=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=ED=86=B5=ED=95=A9=20?= =?UTF-8?q?(#725)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pingpong/api/global/config/JpaAuditingConfig.java | 10 ---------- .../java/gg/pingpong/api/global/config/JpaConfig.java | 2 ++ 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/JpaAuditingConfig.java diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/JpaAuditingConfig.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/JpaAuditingConfig.java deleted file mode 100644 index 5405f9fbe..000000000 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/JpaAuditingConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package gg.pingpong.api.global.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.data.jpa.repository.config.EnableJpaAuditing; - -@Configuration -@EnableJpaAuditing -public class JpaAuditingConfig { - -} diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/JpaConfig.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/JpaConfig.java index 6bb8e11f9..2ff8da1c8 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/JpaConfig.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/JpaConfig.java @@ -2,9 +2,11 @@ import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.annotation.Configuration; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @Configuration +@EnableJpaAuditing @EnableJpaRepositories(basePackages = {"gg.repo", "gg.admin.repo"}) @EntityScan(basePackages = "gg.data") public class JpaConfig { From c47f16dccbdd86e4619b41a8c25896d9669108f2 Mon Sep 17 00:00:00 2001 From: Hyunkyu Lee <88573971+wken5577@users.noreply.github.com> Date: Mon, 18 Mar 2024 14:56:26 +0900 Subject: [PATCH 06/12] [FEAT] #559 application detail get api (#737) --- .../application/ApplicationAnswer.java | 26 ++++++++++-- .../ApplicationAnswerCheckList.java | 21 +++++----- .../ApplicationAnswerEntityDto.java | 24 +++++++++++ .../application/ApplicationAnswerText.java | 21 ++++------ .../application/CheckListEntityDto.java | 11 +++++ .../data/recruit/recruitment/CheckList.java | 4 +- .../gg/data/recruit/recruitment/Question.java | 2 + .../api/global/config/SwaggerConfig.java | 18 ++++++++ .../exception/GlobalExceptionHandler.java | 1 + .../resources/db/migration/V2__recruit.sql | 21 ++++------ .../controller/ApplicationController.java | 17 +++++++- .../response/ApplicationResDto.java | 4 +- .../controller/response/CheckListResDto.java | 15 +++++++ .../user/controller/response/FormResDto.java | 26 ++++++++++++ .../response/MyApplicationDetailResDto.java | 30 +++++++++++++ .../response/MyApplicationsResDto.java | 4 +- .../api/user/service/ApplicationService.java | 22 ++++++++-- .../param/FindApplicationDetailParam.java | 12 ++++++ ...istDto.java => ApplicationListSvcDto.java} | 8 ++-- ...icationDto.java => ApplicationSvcDto.java} | 4 +- .../response/ApplicationWithAnswerSvcDto.java | 42 +++++++++++++++++++ .../service/response/CheckListSvcDto.java | 15 +++++++ .../api/user/service/response/FormSvcDto.java | 25 +++++++++++ .../ApplicationAnswerRepository.java | 17 ++++++++ 24 files changed, 334 insertions(+), 56 deletions(-) create mode 100644 gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerEntityDto.java create mode 100644 gg-data/src/main/java/gg/data/recruit/application/CheckListEntityDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/CheckListResDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/FormResDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationDetailResDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FindApplicationDetailParam.java rename gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/{ApplicationListDto.java => ApplicationListSvcDto.java} (51%) rename gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/{ApplicationDto.java => ApplicationSvcDto.java} (90%) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationWithAnswerSvcDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/CheckListSvcDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/FormSvcDto.java create mode 100644 gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java index 5f3279089..d79e22292 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java @@ -1,31 +1,49 @@ package gg.data.recruit.application; +import javax.persistence.DiscriminatorColumn; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import gg.data.BaseTimeEntity; import gg.data.recruit.recruitment.Question; +import gg.data.recruit.recruitment.enums.InputType; import lombok.AccessLevel; +import lombok.Getter; import lombok.NoArgsConstructor; @Entity @NoArgsConstructor(access = AccessLevel.PROTECTED) -public class ApplicationAnswer extends BaseTimeEntity { - +@Inheritance(strategy = InheritanceType.JOINED) +@DiscriminatorColumn(name = "answer_type") +public abstract class ApplicationAnswer extends BaseTimeEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "question_id", nullable = false) - private Question questionId; + private Question question; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "application_id", nullable = false) - private Application applicationId; + @Getter + private Application application; + + public InputType getInputType() { + return question.getInputType(); + } + + public Long getQuestionId() { + return question.getId(); + } + + public abstract ApplicationAnswerEntityDto toForm(); + } diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java index 58594f2c1..9744b57c0 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java @@ -1,29 +1,30 @@ package gg.data.recruit.application; +import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; -import gg.data.BaseTimeEntity; import gg.data.recruit.recruitment.CheckList; import lombok.NoArgsConstructor; @Entity @NoArgsConstructor(access = lombok.AccessLevel.PROTECTED) -public class ApplicationAnswerCheckList extends BaseTimeEntity { +@DiscriminatorValue("CHECK_LIST") +public class ApplicationAnswerCheckList extends ApplicationAnswer { + @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "application_answer_id", nullable = false) - private ApplicationAnswer applicationAnswerId; - @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "check_list_id", nullable = false) - private CheckList checkListId; + private CheckList checkList; + + @Override + public ApplicationAnswerEntityDto toForm() { + return new ApplicationAnswerEntityDto(this.getQuestionId(), this.getInputType(), + new CheckListEntityDto(checkList.getId(), checkList.getContent())); + } } diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerEntityDto.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerEntityDto.java new file mode 100644 index 000000000..162dc03d4 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerEntityDto.java @@ -0,0 +1,24 @@ +package gg.data.recruit.application; +import gg.data.recruit.recruitment.enums.InputType; +import lombok.Getter; + +@Getter +public class ApplicationAnswerEntityDto { + private Long questionId; + private InputType inputType; + + private CheckListEntityDto checkedList; + private String answer; + + public ApplicationAnswerEntityDto(Long questionId, InputType inputType, CheckListEntityDto checkedList) { + this.questionId = questionId; + this.inputType = inputType; + this.checkedList = checkedList; + } + + public ApplicationAnswerEntityDto(Long questionId, InputType inputType, String answer) { + this.questionId = questionId; + this.inputType = inputType; + this.answer = answer; + } +} diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java index 3da2b03d8..b2ad7607e 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java @@ -1,28 +1,25 @@ package gg.data.recruit.application; import javax.persistence.Column; +import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import gg.data.BaseTimeEntity; import lombok.NoArgsConstructor; @Entity @NoArgsConstructor(access = lombok.AccessLevel.PROTECTED) -public class ApplicationAnswerText extends BaseTimeEntity { +@DiscriminatorValue("TEXT") +public class ApplicationAnswerText extends ApplicationAnswer { + @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "application_answer_id", nullable = false) - private ApplicationAnswer applicationAnswerId; - @Column(length = 1000) private String answer; + + @Override + public ApplicationAnswerEntityDto toForm() { + return new ApplicationAnswerEntityDto(this.getQuestionId(), this.getInputType(), answer); + } } diff --git a/gg-data/src/main/java/gg/data/recruit/application/CheckListEntityDto.java b/gg-data/src/main/java/gg/data/recruit/application/CheckListEntityDto.java new file mode 100644 index 000000000..87fea3d29 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/CheckListEntityDto.java @@ -0,0 +1,11 @@ +package gg.data.recruit.application; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public class CheckListEntityDto { + private Long checkListId; + private String content; +} diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java b/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java index 844fa183f..6b6130ad7 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java @@ -11,10 +11,12 @@ import gg.data.BaseTimeEntity; import lombok.AccessLevel; +import lombok.Getter; import lombok.NoArgsConstructor; @Entity @NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter public class CheckList extends BaseTimeEntity { @Id @@ -23,7 +25,7 @@ public class CheckList extends BaseTimeEntity { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "question_id", nullable = false) - private Question questionId; + private Question question; @Column(length = 100) private String content; diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java index 67f0824a8..d7a7a33a7 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java @@ -14,9 +14,11 @@ import gg.data.BaseTimeEntity; import gg.data.recruit.recruitment.enums.InputType; import lombok.AccessLevel; +import lombok.Getter; import lombok.NoArgsConstructor; @Entity +@Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) public class Question extends BaseTimeEntity { @Id diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/SwaggerConfig.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/SwaggerConfig.java index 7af1049e5..4758458cd 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/SwaggerConfig.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/config/SwaggerConfig.java @@ -22,6 +22,24 @@ public GroupedOpenApi group1() { .build(); } + @Bean + public GroupedOpenApi recruitGroup() { + return GroupedOpenApi.builder() + .group("recruit") + .pathsToMatch("/recruitments/**") + .packagesToScan("gg.recruit.api.user") + .build(); + } + + @Bean + public GroupedOpenApi recruitAdminGroup() { + return GroupedOpenApi.builder() + .group("recruit admin") + .pathsToMatch("admin/recruitments/**") + .packagesToScan("gg.recruit.api.admin") + .build(); + } + @Bean public GroupedOpenApi admin_group() { return GroupedOpenApi.builder() diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/exception/GlobalExceptionHandler.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/exception/GlobalExceptionHandler.java index 697150080..5aefa6c89 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/global/exception/GlobalExceptionHandler.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/global/exception/GlobalExceptionHandler.java @@ -118,6 +118,7 @@ protected ResponseEntity httpRequestMethodNotSupportedExceptionHa @ExceptionHandler(Exception.class) public ResponseEntity handleException(Exception ex) { log.error("!!!!!! SERVER ERROR !!!!!!", ex.getMessage()); + ex.printStackTrace(); ErrorResponse response = new ErrorResponse(ErrorCode.INTERNAL_SERVER_ERR); return new ResponseEntity<>(response, HttpStatus.valueOf(response.getStatus())); } diff --git a/gg-pingpong-api/src/main/resources/db/migration/V2__recruit.sql b/gg-pingpong-api/src/main/resources/db/migration/V2__recruit.sql index c0ed19add..9a5fc3359 100644 --- a/gg-pingpong-api/src/main/resources/db/migration/V2__recruit.sql +++ b/gg-pingpong-api/src/main/resources/db/migration/V2__recruit.sql @@ -46,6 +46,7 @@ CREATE TABLE `application_answer` ( `modified_at` datetime(6) DEFAULT NULL, `application_id` bigint NOT NULL , `question_id` bigint NOT NULL , + `answer_type` varchar(20) NOT NULL, PRIMARY KEY (`id`), KEY `FKn2ayp7tptdv0yycdqkp2hcm63` (`application_id`), KEY `FK59sj9jdfki14kkp34kc2jdhyj` (`question_id`), @@ -65,27 +66,19 @@ CREATE TABLE `check_list` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; CREATE TABLE `application_answer_check_list` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `created_at` datetime(6) NOT NULL, - `modified_at` datetime(6) DEFAULT NULL, - `application_answer_id` bigint NOT NULL, + `id` bigint NOT NULL, `check_list_id` bigint NOT NULL, - PRIMARY KEY (`id`), - KEY `FKqdnt92yg8t27q74he0ersyiax` (`application_answer_id`), + KEY `FKqdnt92yg8t27q74he0ersyiax` (`id`), KEY `FK3mf6hfr08f2ex01aqejikxk9w` (`check_list_id`), CONSTRAINT `FK3mf6hfr08f2ex01aqejikxk9w` FOREIGN KEY (`check_list_id`) REFERENCES `check_list` (`id`), - CONSTRAINT `FKqdnt92yg8t27q74he0ersyiax` FOREIGN KEY (`application_answer_id`) REFERENCES `application_answer` (`id`) + CONSTRAINT `FKqdnt92yg8t27q74he0ersyiax` FOREIGN KEY (`id`) REFERENCES `application_answer` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; CREATE TABLE `application_answer_text` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `created_at` datetime(6) NOT NULL, - `modified_at` datetime(6) DEFAULT NULL, + `id` bigint NOT NULL , `answer` varchar(1000) DEFAULT NULL, - `application_answer_id` bigint NOT NULL , - PRIMARY KEY (`id`), - KEY `FKlhk4m3hi4r3v8xqk8lx4bx5g7` (`application_answer_id`), - CONSTRAINT `FKlhk4m3hi4r3v8xqk8lx4bx5g7` FOREIGN KEY (`application_answer_id`) REFERENCES `application_answer` (`id`) + KEY `FKlhk4m3hi4r3v8xqk8lx4bx5g7` (`id`), + CONSTRAINT `FKlhk4m3hi4r3v8xqk8lx4bx5g7` FOREIGN KEY (`id`) REFERENCES `application_answer` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java index 2b3c8bbd2..e08cb8c85 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java @@ -6,9 +6,13 @@ import gg.auth.UserDto; import gg.auth.argumentresolver.Login; +import gg.recruit.api.user.controller.response.MyApplicationDetailResDto; import gg.recruit.api.user.controller.response.MyApplicationsResDto; import gg.recruit.api.user.service.ApplicationService; -import gg.recruit.api.user.service.response.ApplicationListDto; +import gg.recruit.api.user.service.param.FindApplicationDetailParam; +import gg.recruit.api.user.service.response.ApplicationListSvcDto; +import gg.recruit.api.user.service.response.ApplicationWithAnswerSvcDto; +import io.swagger.v3.oas.annotations.Parameter; import lombok.RequiredArgsConstructor; @RestController @@ -20,7 +24,16 @@ public class ApplicationController { @GetMapping("/applications") public MyApplicationsResDto getMyApplications(@Login UserDto userDto) { - ApplicationListDto res = applicationService.findMyApplications(userDto.getId()); + ApplicationListSvcDto res = applicationService.findMyApplications(userDto.getId()); return new MyApplicationsResDto(res); } + + @GetMapping("{recruitmentId}/applications/{applicationId}") + public MyApplicationDetailResDto getMyApplication(@Login @Parameter(hidden = true) UserDto userDto, + Long recruitmentId, Long applicationId) { + ApplicationWithAnswerSvcDto res = applicationService + .findMyApplicationDetail(new FindApplicationDetailParam(userDto.getId(), recruitmentId, applicationId)); + return new MyApplicationDetailResDto(res); + } + } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResDto.java index 7c0df2d21..7a1f20401 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResDto.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResDto.java @@ -2,7 +2,7 @@ import java.time.LocalDateTime; -import gg.recruit.api.user.service.response.ApplicationDto; +import gg.recruit.api.user.service.response.ApplicationSvcDto; import lombok.Getter; import lombok.NoArgsConstructor; @@ -17,7 +17,7 @@ public class ApplicationResDto { private String generation; private String status; - public ApplicationResDto(ApplicationDto applicationDto) { + public ApplicationResDto(ApplicationSvcDto applicationDto) { this.recruitId = applicationDto.getRecruitId(); this.applicationId = applicationDto.getApplicationId(); this.startDate = applicationDto.getStartDate(); diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/CheckListResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/CheckListResDto.java new file mode 100644 index 000000000..50d46f8f4 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/CheckListResDto.java @@ -0,0 +1,15 @@ +package gg.recruit.api.user.controller.response; + +import gg.recruit.api.user.service.response.CheckListSvcDto; +import lombok.Getter; + +@Getter +public class CheckListResDto { + private Long checkListId; + private String content; + + public CheckListResDto(CheckListSvcDto checkListSvcDto) { + this.checkListId = checkListSvcDto.getCheckListId(); + this.content = checkListSvcDto.getContent(); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/FormResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/FormResDto.java new file mode 100644 index 000000000..7cd343dfd --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/FormResDto.java @@ -0,0 +1,26 @@ +package gg.recruit.api.user.controller.response; + +import static java.util.stream.Collectors.*; + +import java.util.List; + +import gg.recruit.api.user.service.response.FormSvcDto; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public class FormResDto { + private Long questionId; + private String inputType; + private List checkeList; + private String answer; + + public FormResDto(FormSvcDto formSvcDto) { + this.questionId = formSvcDto.getQuestionId(); + this.inputType = formSvcDto.getInputType(); + this.checkeList = formSvcDto.getCheckedList().stream() + .map(CheckListResDto::new).collect(toList()); + this.answer = formSvcDto.getAnswer(); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationDetailResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationDetailResDto.java new file mode 100644 index 000000000..f1b164b36 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationDetailResDto.java @@ -0,0 +1,30 @@ +package gg.recruit.api.user.controller.response; + +import static java.util.stream.Collectors.*; + +import java.time.LocalDateTime; +import java.util.List; + +import gg.recruit.api.user.service.response.ApplicationWithAnswerSvcDto; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor +@Getter +public class MyApplicationDetailResDto { + private Long applicationId; + private LocalDateTime endTime; + private String title; + private String content; + private List from; + + public MyApplicationDetailResDto(ApplicationWithAnswerSvcDto applicationWithAnswerSvcDto) { + this.applicationId = applicationWithAnswerSvcDto.getApplicationId(); + this.endTime = applicationWithAnswerSvcDto.getEndTime(); + this.title = applicationWithAnswerSvcDto.getTitle(); + this.content = applicationWithAnswerSvcDto.getContent(); + this.from = applicationWithAnswerSvcDto.getForm().stream() + .map(FormResDto::new) + .collect(toList()); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationsResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationsResDto.java index 1f67eb9d0..434ba0e3c 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationsResDto.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationsResDto.java @@ -3,7 +3,7 @@ import java.util.List; import java.util.stream.Collectors; -import gg.recruit.api.user.service.response.ApplicationListDto; +import gg.recruit.api.user.service.response.ApplicationListSvcDto; import lombok.Getter; import lombok.NoArgsConstructor; @@ -12,7 +12,7 @@ public class MyApplicationsResDto { private List applications; - public MyApplicationsResDto(ApplicationListDto applicationListDto) { + public MyApplicationsResDto(ApplicationListSvcDto applicationListDto) { applications = applicationListDto.getApplications() .stream() .map(ApplicationResDto::new) diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java index 92fef6fb9..648fc619f 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java @@ -5,8 +5,14 @@ import org.springframework.stereotype.Service; import gg.data.recruit.application.Application; -import gg.recruit.api.user.service.response.ApplicationListDto; +import gg.data.recruit.application.ApplicationAnswer; +import gg.recruit.api.user.service.param.FindApplicationDetailParam; +import gg.recruit.api.user.service.response.ApplicationListSvcDto; +import gg.recruit.api.user.service.response.ApplicationWithAnswerSvcDto; +import gg.repo.recruit.user.application.ApplicationAnswerRepository; import gg.repo.recruit.user.application.ApplicationRepository; +import gg.utils.exception.ErrorCode; +import gg.utils.exception.custom.NotExistException; import lombok.RequiredArgsConstructor; @Service @@ -14,9 +20,19 @@ public class ApplicationService { private final ApplicationRepository applicationRepository; + private final ApplicationAnswerRepository applicationAnswerRepository; - public ApplicationListDto findMyApplications(Long userId) { + public ApplicationListSvcDto findMyApplications(Long userId) { List res = applicationRepository.findAllByUserId(userId); - return new ApplicationListDto(res); + return new ApplicationListSvcDto(res); + } + + public ApplicationWithAnswerSvcDto findMyApplicationDetail(FindApplicationDetailParam param) { + List answers = applicationAnswerRepository + .findAllAnswers(param.getUserId(), param.getRecruitId(), param.getApplicationId()); + if (answers.size() == 0) { + throw new NotExistException("application not found", ErrorCode.BAD_REQUEST); + } + return new ApplicationWithAnswerSvcDto(answers); } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FindApplicationDetailParam.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FindApplicationDetailParam.java new file mode 100644 index 000000000..8e19d0b94 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FindApplicationDetailParam.java @@ -0,0 +1,12 @@ +package gg.recruit.api.user.service.param; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class FindApplicationDetailParam { + private Long userId; + private Long recruitId; + private Long applicationId; +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListSvcDto.java similarity index 51% rename from gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListDto.java rename to gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListSvcDto.java index b361fcb52..3b824536e 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListDto.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListSvcDto.java @@ -7,11 +7,11 @@ import lombok.Getter; @Getter -public class ApplicationListDto { - List applications; +public class ApplicationListSvcDto { + List applications; - public ApplicationListDto(List applications) { - this.applications = applications.stream().map(ApplicationDto::new) + public ApplicationListSvcDto(List applications) { + this.applications = applications.stream().map(ApplicationSvcDto::new) .collect(Collectors.toList()); } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationSvcDto.java similarity index 90% rename from gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationDto.java rename to gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationSvcDto.java index facb2d82b..3473ad125 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationDto.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationSvcDto.java @@ -8,7 +8,7 @@ @Getter @NoArgsConstructor -public class ApplicationDto { +public class ApplicationSvcDto { private Long recruitId; private Long applicationId; private LocalDateTime startDate; @@ -17,7 +17,7 @@ public class ApplicationDto { private String generation; private String status; - public ApplicationDto(Application application) { + public ApplicationSvcDto(Application application) { this.recruitId = application.getRecruit().getId(); this.applicationId = application.getId(); this.startDate = application.getRecruit().getStartTime(); diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationWithAnswerSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationWithAnswerSvcDto.java new file mode 100644 index 000000000..862f6173d --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationWithAnswerSvcDto.java @@ -0,0 +1,42 @@ +package gg.recruit.api.user.service.response; + +import static java.util.stream.Collectors.*; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; + +import gg.data.recruit.application.ApplicationAnswer; +import gg.data.recruit.application.ApplicationAnswerEntityDto; +import lombok.Getter; + +@Getter +public class ApplicationWithAnswerSvcDto { + private final Long applicationId; + private final LocalDateTime endTime; + private final String title; + private final String content; + private final List form; + + public ApplicationWithAnswerSvcDto(List answers) { + this.applicationId = answers.get(0).getApplication().getId(); + this.endTime = answers.get(0).getApplication().getRecruit().getEndTime(); + this.title = answers.get(0).getApplication().getRecruit().getTitle(); + this.content = answers.get(0).getApplication().getRecruit().getContents(); + + List entityDtos = answers.stream() + .map(ApplicationAnswer::toForm).collect(toList()); + + // groupping answers by questionId and inputType + Map> groupedAnswers = entityDtos.stream() + .collect(groupingBy(ApplicationAnswerEntityDto::getQuestionId)); + + // convert to FromSvcDto + this.form = groupedAnswers.entrySet().stream() + .map(entry -> { + Long questionId = entry.getKey(); + List answersByInputType = entry.getValue(); + return new FormSvcDto(questionId, answersByInputType); + }).collect(toList()); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/CheckListSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/CheckListSvcDto.java new file mode 100644 index 000000000..99779bde9 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/CheckListSvcDto.java @@ -0,0 +1,15 @@ +package gg.recruit.api.user.service.response; + +import gg.data.recruit.application.CheckListEntityDto; +import lombok.Getter; + +@Getter +public class CheckListSvcDto { + private Long checkListId; + private String content; + + public CheckListSvcDto(CheckListEntityDto entityDto) { + this.checkListId = entityDto.getCheckListId(); + this.content = entityDto.getContent(); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/FormSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/FormSvcDto.java new file mode 100644 index 000000000..68a03bfd2 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/FormSvcDto.java @@ -0,0 +1,25 @@ +package gg.recruit.api.user.service.response; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import gg.data.recruit.application.ApplicationAnswerEntityDto; +import lombok.Getter; + +@Getter +public class FormSvcDto { + private Long questionId; + private String inputType; + + private List checkedList; + private String answer; + + public FormSvcDto(Long questionId, List entityDtos) { + this.questionId = questionId; + this.inputType = entityDtos.get(0).getInputType().name(); + this.answer = entityDtos.get(0).getAnswer(); + this.checkedList = entityDtos.stream().map(ApplicationAnswerEntityDto::getCheckedList) + .filter(Objects::nonNull) + .map(CheckListSvcDto::new).collect(Collectors.toList()); + } +} diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java new file mode 100644 index 000000000..69768acf0 --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java @@ -0,0 +1,17 @@ +package gg.repo.recruit.user.application; + +import java.util.List; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import gg.data.recruit.application.ApplicationAnswer; + +public interface ApplicationAnswerRepository extends JpaRepository { + + @Query("SELECT a FROM ApplicationAnswer a JOIN FETCH a.question WHERE a.application.user.id = :userId " + + "AND a.application.recruit.id = :recruitId AND a.application.id = :applicationId order by a.question.sortNum") + List findAllAnswers(@Param("userId") Long userId, + @Param("recruitId") Long recruitId, @Param("applicationId") Long applicationId); +} From 234a5ac942da2501d6635fc4707d43860e63c1cc Mon Sep 17 00:00:00 2001 From: yoahn <46748334+AYoungSn@users.noreply.github.com> Date: Tue, 19 Mar 2024 13:52:52 +0900 Subject: [PATCH 07/12] =?UTF-8?q?#552=20feature=20=EA=B3=B5=EA=B3=A0=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EC=A1=B0=ED=9A=8C=20api=20(#738)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gg/data/recruit/recruitment/Question.java | 9 +++- .../recruit/recruitment/Recruitments.java | 4 ++ .../recruit/recruitment/enums/InputType.java | 3 +- .../controller/RecruitmentController.java | 14 +++++ .../controller/response/CheckItemResDto.java | 17 ++++++ .../controller/response/FormDetailResDto.java | 25 +++++++++ .../response/RecruitmentDetailResDto.java | 31 +++++++++++ .../api/user/service/ApplicationService.java | 6 +++ .../api/user/service/QuestionService.java | 19 +++++++ .../api/user/service/RecruitmentService.java | 12 +++++ .../service/response/CheckItemSvcDto.java | 15 ++++++ .../service/response/FormDetailSvcDto.java | 23 ++++++++ .../response/RecruitmentDetailSvcDto.java | 28 ++++++++++ .../controller/RecruitmentControllerTest.java | 53 +++++++++++++++++++ .../application/ApplicationRepository.java | 7 +++ .../user/recruitment/CheckListRepository.java | 13 +++++ .../user/recruitment/QuestionRepository.java | 16 ++++++ .../recruitment/RecruitmentRepository.java | 5 ++ .../exception/custom/NotExistException.java | 4 ++ .../java/gg/utils/RecruitMockData.java | 7 +++ 20 files changed, 309 insertions(+), 2 deletions(-) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/CheckItemResDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/FormDetailResDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentDetailResDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/QuestionService.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/CheckItemSvcDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/FormDetailSvcDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentDetailSvcDto.java create mode 100644 gg-repo/src/main/java/gg/repo/recruit/user/recruitment/CheckListRepository.java create mode 100644 gg-repo/src/main/java/gg/repo/recruit/user/recruitment/QuestionRepository.java diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java index d7a7a33a7..3f10a6bcc 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java @@ -1,5 +1,8 @@ package gg.data.recruit.recruitment; +import java.util.List; + +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; @@ -10,6 +13,7 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; import gg.data.BaseTimeEntity; import gg.data.recruit.recruitment.enums.InputType; @@ -27,7 +31,7 @@ public class Question extends BaseTimeEntity { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "recruit_id", nullable = false) - private Recruitments recruitId; + private Recruitments recruit; @Enumerated(EnumType.STRING) @Column(length = 20, nullable = false) @@ -36,6 +40,9 @@ public class Question extends BaseTimeEntity { @Column(length = 300) private String question; + @OneToMany(mappedBy = "question", cascade = CascadeType.ALL) + private List checkLists; + private int sortNum; } diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java index f7f4d123a..cfadc5f01 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java @@ -48,4 +48,8 @@ public Recruitments(String title, String contents, String generation, LocalDateT this.isFinish = false; this.isDeleted = false; } + + public void del() { + this.isDeleted = true; + } } diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/enums/InputType.java b/gg-data/src/main/java/gg/data/recruit/recruitment/enums/InputType.java index 4ede99473..fde979896 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/enums/InputType.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/enums/InputType.java @@ -6,7 +6,8 @@ public enum InputType { TEXT("text", "ํ…์ŠคํŠธ"), - CHECK_LIST("checkList", "์ฒดํฌ๋ฆฌ์ŠคํŠธ"); + SINGLE_CHECK("single_check", "์‹ฑ๊ธ€ ์ฒดํฌ๋ฆฌ์ŠคํŠธ"), + MULTI_CHECK("multi_check", "๋ฉ€ํ‹ฐ ์ฒดํฌ๋ฆฌ์ŠคํŠธ"); private final String type; private final String desc; } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java index ca6790442..82b635d4c 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java @@ -3,12 +3,18 @@ import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import gg.auth.UserDto; +import gg.auth.argumentresolver.Login; import gg.recruit.api.user.controller.response.ActiveRecruitmentListResDto; +import gg.recruit.api.user.controller.response.RecruitmentDetailResDto; +import gg.recruit.api.user.service.ApplicationService; import gg.recruit.api.user.service.RecruitmentService; import gg.utils.dto.PageRequestDto; +import io.swagger.v3.oas.annotations.Parameter; import lombok.RequiredArgsConstructor; @RestController @@ -16,10 +22,18 @@ @RequestMapping("/recruitments") public class RecruitmentController { private final RecruitmentService recruitmentService; + private final ApplicationService applicationService; @GetMapping public ActiveRecruitmentListResDto findActiveRecruitmentList(PageRequestDto requestDto) { Pageable pageable = PageRequest.of(requestDto.getPage() - 1, requestDto.getSize()); return new ActiveRecruitmentListResDto(recruitmentService.findActiveRecruitmentList(pageable)); } + + @GetMapping("/{recruitmentId}") + public RecruitmentDetailResDto findRecruitmentDetail(@Parameter(hidden = true) @Login UserDto user, + @PathVariable Long recruitmentId) { + return new RecruitmentDetailResDto(recruitmentService.findRecruitmentDetail(recruitmentId), + applicationService.findApplicationByUserAndRecruit(user.getId(), recruitmentId)); + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/CheckItemResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/CheckItemResDto.java new file mode 100644 index 000000000..5048c4bc3 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/CheckItemResDto.java @@ -0,0 +1,17 @@ +package gg.recruit.api.user.controller.response; + +import gg.recruit.api.user.service.response.CheckItemSvcDto; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@Getter +public class CheckItemResDto { + private Long id; + private String contents; + + public CheckItemResDto(CheckItemSvcDto dto) { + this.id = dto.getId(); + this.contents = dto.getContents(); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/FormDetailResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/FormDetailResDto.java new file mode 100644 index 000000000..0fa625c9e --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/FormDetailResDto.java @@ -0,0 +1,25 @@ +package gg.recruit.api.user.controller.response; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.data.recruit.recruitment.enums.InputType; +import gg.recruit.api.user.service.response.FormDetailSvcDto; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@Getter +public class FormDetailResDto { + private Long questionId; + private String question; + private InputType inputType; + private List checkList; + + public FormDetailResDto(FormDetailSvcDto dto) { + this.questionId = dto.getQuestionId(); + this.question = dto.getQuestion(); + this.inputType = dto.getInputType(); + this.checkList = dto.getCheckList().stream().map(CheckItemResDto::new).collect(Collectors.toList()); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentDetailResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentDetailResDto.java new file mode 100644 index 000000000..99629bc9b --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/RecruitmentDetailResDto.java @@ -0,0 +1,31 @@ +package gg.recruit.api.user.controller.response; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.stream.Collectors; + +import gg.recruit.api.user.service.response.RecruitmentDetailSvcDto; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@Getter +public class RecruitmentDetailResDto { + private LocalDateTime startDate; + private LocalDateTime endDate; + private String title; + private String contents; + private String generation; + private List forms; + private Long applicationId; + + public RecruitmentDetailResDto(RecruitmentDetailSvcDto dto, Long applicationId) { + this.startDate = dto.getStartDate(); + this.endDate = dto.getEndDate(); + this.title = dto.getTitle(); + this.contents = dto.getContents(); + this.generation = dto.getGeneration(); + this.forms = dto.getForms().stream().map(FormDetailResDto::new).collect(Collectors.toList()); + this.applicationId = applicationId; + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java index 648fc619f..6a9ac4290 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java @@ -1,6 +1,7 @@ package gg.recruit.api.user.service; import java.util.List; +import java.util.Optional; import org.springframework.stereotype.Service; @@ -35,4 +36,9 @@ public ApplicationWithAnswerSvcDto findMyApplicationDetail(FindApplicationDetail } return new ApplicationWithAnswerSvcDto(answers); } + + public Long findApplicationByUserAndRecruit(Long userId, Long recruitId) { + Optional application = applicationRepository.findByUserIdAndRecruitId(userId, recruitId); + return application.map(Application::getId).orElse(null); + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/QuestionService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/QuestionService.java new file mode 100644 index 000000000..411af8023 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/QuestionService.java @@ -0,0 +1,19 @@ +package gg.recruit.api.user.service; + +import java.util.List; + +import org.springframework.stereotype.Service; + +import gg.data.recruit.recruitment.Question; +import gg.repo.recruit.user.recruitment.QuestionRepository; +import lombok.RequiredArgsConstructor; + +@Service +@RequiredArgsConstructor +public class QuestionService { + private final QuestionRepository questionRepository; + + public List findQuestionsByRecruitId(Long recruitId) { + return questionRepository.findAllByRecruitId(recruitId); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/RecruitmentService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/RecruitmentService.java index d090cfd0e..04cb7552d 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/RecruitmentService.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/RecruitmentService.java @@ -1,23 +1,35 @@ package gg.recruit.api.user.service; import java.time.LocalDateTime; +import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; +import gg.data.recruit.recruitment.Question; import gg.data.recruit.recruitment.Recruitments; +import gg.recruit.api.user.service.response.RecruitmentDetailSvcDto; import gg.recruit.api.user.service.response.RecruitmentListSvcDto; import gg.repo.recruit.user.recruitment.RecruitmentRepository; +import gg.utils.exception.custom.NotExistException; import lombok.RequiredArgsConstructor; @Service @RequiredArgsConstructor public class RecruitmentService { private final RecruitmentRepository recruitmentRepository; + private final QuestionService questionService; public RecruitmentListSvcDto findActiveRecruitmentList(Pageable pageable) { Page pages = recruitmentRepository.findActiveRecruitmentList(LocalDateTime.now(), pageable); return new RecruitmentListSvcDto(pages.getContent(), pages.getTotalPages()); } + + public RecruitmentDetailSvcDto findRecruitmentDetail(Long recruitmentId) { + Recruitments recruit = recruitmentRepository.findByActiveRecruit(recruitmentId, LocalDateTime.now()) + .orElseThrow(() -> new NotExistException("Recruitment id ๊ฐ€ ์œ ํšจํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.")); + List questions = questionService.findQuestionsByRecruitId(recruitmentId); + return new RecruitmentDetailSvcDto(recruit, questions); + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/CheckItemSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/CheckItemSvcDto.java new file mode 100644 index 000000000..d4f10dc1e --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/CheckItemSvcDto.java @@ -0,0 +1,15 @@ +package gg.recruit.api.user.service.response; + +import gg.data.recruit.recruitment.CheckList; +import lombok.Getter; + +@Getter +public class CheckItemSvcDto { + private Long id; + private String contents; + + public CheckItemSvcDto(CheckList checkList) { + this.id = checkList.getId(); + this.contents = checkList.getContent(); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/FormDetailSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/FormDetailSvcDto.java new file mode 100644 index 000000000..6c14f2a2b --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/FormDetailSvcDto.java @@ -0,0 +1,23 @@ +package gg.recruit.api.user.service.response; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.data.recruit.recruitment.Question; +import gg.data.recruit.recruitment.enums.InputType; +import lombok.Getter; + +@Getter +public class FormDetailSvcDto { + private Long questionId; + private String question; + private InputType inputType; + private List checkList; + + public FormDetailSvcDto(Question question) { + this.questionId = question.getId(); + this.question = question.getQuestion(); + this.inputType = question.getInputType(); + this.checkList = question.getCheckLists().stream().map(CheckItemSvcDto::new).collect(Collectors.toList()); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentDetailSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentDetailSvcDto.java new file mode 100644 index 000000000..b727acb19 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/RecruitmentDetailSvcDto.java @@ -0,0 +1,28 @@ +package gg.recruit.api.user.service.response; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.stream.Collectors; + +import gg.data.recruit.recruitment.Question; +import gg.data.recruit.recruitment.Recruitments; +import lombok.Getter; + +@Getter +public class RecruitmentDetailSvcDto { + private LocalDateTime startDate; + private LocalDateTime endDate; + private String title; + private String contents; + private String generation; + private List forms; + + public RecruitmentDetailSvcDto(Recruitments recruit, List questions) { + this.startDate = recruit.getStartTime(); + this.endDate = recruit.getEndTime(); + this.title = recruit.getTitle(); + this.contents = recruit.getContents(); + this.generation = recruit.getGeneration(); + this.forms = questions.stream().map(FormDetailSvcDto::new).collect(Collectors.toList()); + } +} diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java index 2a97136b5..cc08acda3 100644 --- a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java @@ -13,9 +13,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; +import gg.data.recruit.application.Application; import gg.data.recruit.recruitment.Recruitments; import gg.data.user.User; import gg.recruit.api.user.controller.response.ActiveRecruitmentListResDto; +import gg.recruit.api.user.controller.response.RecruitmentDetailResDto; import gg.utils.RecruitMockData; import gg.utils.TestDataUtils; import gg.utils.annotation.IntegrationTest; @@ -55,4 +57,55 @@ void findActiveRecruitmentList() throws Exception { assertThat(resDto.getRecruitments().size()).isEqualTo(3); assertThat(resDto.getTotalPage()).isEqualTo(1); } + + @Test + @DisplayName("GET /recruitments/{recruitmentId} -> 200 OK TEST") + void findRecruitmentDetail() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + + Recruitments recruitments = recruitMockData.createRecruitments(); + //when + String res = mockMvc.perform(get("/recruitments/" + recruitments.getId()) + .header("Authorization", "Bearer " + accessToken)) + .andExpect(status().isOk()).andReturn().getResponse().getContentAsString(); + + //then + } + + @Test + @DisplayName("GET /recruitments/{recruitmentId} -> 404 NOT FOUND TEST") + void findRecruitmentDetailDel() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + + Recruitments recruitments = recruitMockData.createRecruitmentsDel(); + //when + String res = mockMvc.perform(get("/recruitments/" + recruitments.getId()) + .header("Authorization", "Bearer " + accessToken)) + .andExpect(status().isNotFound()).andReturn().getResponse().getContentAsString(); + + //then + } + + @Test + @DisplayName("GET /recruitments/{recruitmentId} ์ง€์›์„œ id ์กฐํšŒ -> 200 OK TEST") + void findRecruitmentDetailAndApplicationId() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + + Recruitments recruitments = recruitMockData.createRecruitments(); + Application application = recruitMockData.createApplication(user, recruitments); + //when + String result = mockMvc.perform(get("/recruitments/" + recruitments.getId()) + .header("Authorization", "Bearer " + accessToken)) + .andExpect(status().isOk()).andReturn().getResponse().getContentAsString(); + + //then + RecruitmentDetailResDto res = objectMapper.readValue(result, RecruitmentDetailResDto.class); + assertThat(res.getApplicationId()).isNotNull(); + } } diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java index 969f376d2..74ec67cf5 100644 --- a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java +++ b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java @@ -1,10 +1,12 @@ package gg.repo.recruit.user.application; import java.util.List; +import java.util.Optional; import org.springframework.data.jpa.repository.EntityGraph; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import gg.data.recruit.application.Application; @@ -13,4 +15,9 @@ public interface ApplicationRepository extends JpaRepository @EntityGraph(attributePaths = {"recruit"}) @Query("SELECT a FROM Application a WHERE a.user.id = :userId and a.isDeleted = false") List findAllByUserId(Long userId); + + @Query("SELECT a FROM Application a " + + "JOIN FETCH a.recruit r " + + "WHERE a.user.id = :userId and r.id = :recruitId and a.isDeleted = false and r.isDeleted = false") + Optional findByUserIdAndRecruitId(@Param("userId") Long userId, @Param("recruitId") Long recruitId); } diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/CheckListRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/CheckListRepository.java new file mode 100644 index 000000000..41097f49a --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/CheckListRepository.java @@ -0,0 +1,13 @@ +package gg.repo.recruit.user.recruitment; + +import java.util.List; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import gg.data.recruit.recruitment.CheckList; + +public interface CheckListRepository extends JpaRepository { + @Query("SELECT c FROM CheckList c ") + List findAllByRecruitId(Long recruitId); +} diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/QuestionRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/QuestionRepository.java new file mode 100644 index 000000000..1c667a2f6 --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/QuestionRepository.java @@ -0,0 +1,16 @@ +package gg.repo.recruit.user.recruitment; + +import java.util.List; + +import org.springframework.data.jpa.repository.EntityGraph; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import gg.data.recruit.recruitment.Question; + +public interface QuestionRepository extends JpaRepository { + @EntityGraph(attributePaths = {"checkLists"}) + @Query("SELECT q FROM Question q WHERE q.recruit.id = :recruitId ORDER BY q.sortNum") + List findAllByRecruitId(@Param("recruitId") Long recruitId); +} diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java index 079860917..53eda0661 100644 --- a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java @@ -1,6 +1,7 @@ package gg.repo.recruit.user.recruitment; import java.time.LocalDateTime; +import java.util.Optional; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -15,4 +16,8 @@ public interface RecruitmentRepository extends JpaRepository + "WHERE r.isDeleted = false AND r.startTime <= :date AND r.isFinish = false " + "ORDER BY r.startTime DESC") Page findActiveRecruitmentList(@Param("date") LocalDateTime date, Pageable pageable); + + @Query("SELECT r FROM Recruitments r " + + "WHERE r.id = :recruitId AND r.startTime <= :date AND r.isDeleted = false AND r.isFinish = false") + Optional findByActiveRecruit(@Param("recruitId") Long recruitId, @Param("date") LocalDateTime date); } diff --git a/gg-utils/src/main/java/gg/utils/exception/custom/NotExistException.java b/gg-utils/src/main/java/gg/utils/exception/custom/NotExistException.java index efbf33b5e..8255e9873 100644 --- a/gg-utils/src/main/java/gg/utils/exception/custom/NotExistException.java +++ b/gg-utils/src/main/java/gg/utils/exception/custom/NotExistException.java @@ -8,4 +8,8 @@ public class NotExistException extends CustomRuntimeException { public NotExistException(String message, ErrorCode errorCode) { super(message, errorCode); } + + public NotExistException(String message) { + super(message, ErrorCode.NOT_FOUND); + } } diff --git a/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java b/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java index cf1ae70e7..ca8dce891 100644 --- a/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java +++ b/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java @@ -23,6 +23,13 @@ public Recruitments createRecruitments() { return recruitmentRepository.save(recruitments); } + public Recruitments createRecruitmentsDel() { + Recruitments recruitments = new Recruitments("title", "contents", "generation", + LocalDateTime.now(), LocalDateTime.now().plusDays(1)); + recruitments.del(); + return recruitmentRepository.save(recruitments); + } + public Application createApplication(User user, Recruitments recruitments) { Application application = new Application(user, recruitments); return applicationRepository.save(application); From 9b8bdba0aa3a78a4446258331213bddefee0b33f Mon Sep 17 00:00:00 2001 From: Hyunkyu Lee <88573971+wken5577@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:55:59 +0900 Subject: [PATCH 08/12] [FEAT] #560 application res api (#741) --- .../data/recruit/application/Application.java | 3 ++ .../recruit/application/RecruitStatus.java | 8 ++++- .../controller/ApplicationController.java | 14 ++++++++- .../response/ApplicationResultResDto.java | 23 ++++++++++++++ .../api/user/service/ApplicationService.java | 22 ++++++++++++++ .../param/FindApplicationResultParam.java | 15 ++++++++++ .../response/ApplicationResultSvcDto.java | 25 ++++++++++++++++ .../controller/ApplicationControllerTest.java | 30 +++++++++++++++++++ .../application/ApplicationRepository.java | 7 +++++ .../application/RecruitStatusRepository.java | 15 ++++++++++ .../java/gg/utils/RecruitMockData.java | 8 +++++ 11 files changed, 168 insertions(+), 2 deletions(-) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResultResDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FindApplicationResultParam.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationResultSvcDto.java create mode 100644 gg-repo/src/main/java/gg/repo/recruit/user/application/RecruitStatusRepository.java diff --git a/gg-data/src/main/java/gg/data/recruit/application/Application.java b/gg-data/src/main/java/gg/data/recruit/application/Application.java index 29b4889cc..8faaa3ebb 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/Application.java +++ b/gg-data/src/main/java/gg/data/recruit/application/Application.java @@ -48,4 +48,7 @@ public Application(User user, Recruitments recruit) { this.isDeleted = false; this.status = ApplicationStatus.PROGRESS_DOCS; } + public String getRecruitTitle() { + return this.recruit.getTitle(); + } } diff --git a/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java b/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java index 27c413246..6ab7e2aff 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java +++ b/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java @@ -12,6 +12,7 @@ import gg.data.BaseTimeEntity; import lombok.AccessLevel; +import lombok.Getter; import lombok.NoArgsConstructor; @Entity @@ -24,7 +25,12 @@ public class RecruitStatus extends BaseTimeEntity { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "application_id", nullable = false) - private Application applicationId; + private Application application; + @Getter private LocalDateTime interviewDate; + + public RecruitStatus(Application application) { + this.application = application; + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java index e08cb8c85..196858347 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java @@ -1,16 +1,20 @@ package gg.recruit.api.user.controller; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import gg.auth.UserDto; import gg.auth.argumentresolver.Login; +import gg.recruit.api.user.controller.response.ApplicationResultResDto; import gg.recruit.api.user.controller.response.MyApplicationDetailResDto; import gg.recruit.api.user.controller.response.MyApplicationsResDto; import gg.recruit.api.user.service.ApplicationService; import gg.recruit.api.user.service.param.FindApplicationDetailParam; +import gg.recruit.api.user.service.param.FindApplicationResultParam; import gg.recruit.api.user.service.response.ApplicationListSvcDto; +import gg.recruit.api.user.service.response.ApplicationResultSvcDto; import gg.recruit.api.user.service.response.ApplicationWithAnswerSvcDto; import io.swagger.v3.oas.annotations.Parameter; import lombok.RequiredArgsConstructor; @@ -30,10 +34,18 @@ public MyApplicationsResDto getMyApplications(@Login UserDto userDto) { @GetMapping("{recruitmentId}/applications/{applicationId}") public MyApplicationDetailResDto getMyApplication(@Login @Parameter(hidden = true) UserDto userDto, - Long recruitmentId, Long applicationId) { + @PathVariable Long recruitmentId, @PathVariable Long applicationId) { ApplicationWithAnswerSvcDto res = applicationService .findMyApplicationDetail(new FindApplicationDetailParam(userDto.getId(), recruitmentId, applicationId)); return new MyApplicationDetailResDto(res); } + @GetMapping("{recruitmentId}/applications/{applicationId}/result") + public ApplicationResultResDto getApplicationResult(@Login @Parameter(hidden = true) UserDto userDto, + @PathVariable Long recruitmentId, @PathVariable Long applicationId) { + ApplicationResultSvcDto res = applicationService.findApplicationResult( + new FindApplicationResultParam(userDto.getId(), + recruitmentId, applicationId)); + return new ApplicationResultResDto(res); + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResultResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResultResDto.java new file mode 100644 index 000000000..266b73dc3 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResultResDto.java @@ -0,0 +1,23 @@ +package gg.recruit.api.user.controller.response; + +import java.time.LocalDateTime; + +import gg.data.recruit.application.enums.ApplicationStatus; +import gg.recruit.api.user.service.response.ApplicationResultSvcDto; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor(access = AccessLevel.PROTECTED) +public class ApplicationResultResDto { + private String title; + private ApplicationStatus status; + private LocalDateTime interviewDate; + + public ApplicationResultResDto(ApplicationResultSvcDto applicationResult) { + this.title = applicationResult.getTitle(); + this.status = applicationResult.getStatus(); + this.interviewDate = applicationResult.getInterviewDate(); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java index 6a9ac4290..98199cb0c 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java @@ -7,11 +7,15 @@ import gg.data.recruit.application.Application; import gg.data.recruit.application.ApplicationAnswer; +import gg.data.recruit.application.RecruitStatus; import gg.recruit.api.user.service.param.FindApplicationDetailParam; +import gg.recruit.api.user.service.param.FindApplicationResultParam; import gg.recruit.api.user.service.response.ApplicationListSvcDto; +import gg.recruit.api.user.service.response.ApplicationResultSvcDto; import gg.recruit.api.user.service.response.ApplicationWithAnswerSvcDto; import gg.repo.recruit.user.application.ApplicationAnswerRepository; import gg.repo.recruit.user.application.ApplicationRepository; +import gg.repo.recruit.user.application.RecruitStatusRepository; import gg.utils.exception.ErrorCode; import gg.utils.exception.custom.NotExistException; import lombok.RequiredArgsConstructor; @@ -22,6 +26,8 @@ public class ApplicationService { private final ApplicationRepository applicationRepository; private final ApplicationAnswerRepository applicationAnswerRepository; + private final RecruitStatusRepository recruitStatusRepository; + public ApplicationListSvcDto findMyApplications(Long userId) { List res = applicationRepository.findAllByUserId(userId); @@ -41,4 +47,20 @@ public Long findApplicationByUserAndRecruit(Long userId, Long recruitId) { Optional application = applicationRepository.findByUserIdAndRecruitId(userId, recruitId); return application.map(Application::getId).orElse(null); } + + public ApplicationResultSvcDto findApplicationResult(FindApplicationResultParam param) { + Optional optionalApplication = applicationRepository + .findApplication(param.getApplicationId(), param.getUserId(), param.getRecruitmentId()); + ApplicationResultSvcDto result; + if (optionalApplication.isEmpty()) { + result = ApplicationResultSvcDto.nullResult(); + } else { + Application application = optionalApplication.get(); + RecruitStatus recruitStatus = recruitStatusRepository.findByApplicationId(param.getApplicationId()) + .orElseThrow(IllegalStateException::new); + result = ApplicationResultSvcDto.of(application.getRecruitTitle(), + application.getStatus(), recruitStatus.getInterviewDate()); + } + return result; + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FindApplicationResultParam.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FindApplicationResultParam.java new file mode 100644 index 000000000..5e6e6d723 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FindApplicationResultParam.java @@ -0,0 +1,15 @@ +package gg.recruit.api.user.service.param; + +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class FindApplicationResultParam { + + private Long userId; + private Long recruitmentId; + private Long applicationId; + +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationResultSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationResultSvcDto.java new file mode 100644 index 000000000..a0d565d62 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationResultSvcDto.java @@ -0,0 +1,25 @@ +package gg.recruit.api.user.service.response; + +import java.time.LocalDateTime; + +import gg.data.recruit.application.enums.ApplicationStatus; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@AllArgsConstructor(access = AccessLevel.PRIVATE) +@Getter +public class ApplicationResultSvcDto { + private String title; + private ApplicationStatus status; + private LocalDateTime interviewDate; + + public static ApplicationResultSvcDto nullResult() { + return new ApplicationResultSvcDto(null, null, null); + } + + public static ApplicationResultSvcDto of(String title, ApplicationStatus status, LocalDateTime interviewDate) { + return new ApplicationResultSvcDto(title, status, interviewDate); + } + +} diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java index f4039faeb..fd7670cd4 100644 --- a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java @@ -13,8 +13,12 @@ import com.fasterxml.jackson.databind.ObjectMapper; +import gg.data.recruit.application.Application; +import gg.data.recruit.application.RecruitStatus; +import gg.data.recruit.application.enums.ApplicationStatus; import gg.data.recruit.recruitment.Recruitments; import gg.data.user.User; +import gg.recruit.api.user.controller.response.ApplicationResultResDto; import gg.recruit.api.user.controller.response.MyApplicationsResDto; import gg.utils.RecruitMockData; import gg.utils.TestDataUtils; @@ -58,4 +62,30 @@ public void getMyApplicationsTest() throws Exception { MyApplicationsResDto myApplicationsResDto = objectMapper.readValue(res, MyApplicationsResDto.class); assertEquals(3, myApplicationsResDto.getApplications().size()); } + + @Test + @DisplayName("GET /recruitments/{recruitmentId}/applications/{applicationId}/result -> 200 OK TEST") + public void applicationResApiTest() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + Recruitments recruitments = recruitMockData.createRecruitments(); + Application application = recruitMockData.createApplication(user, recruitments); + recruitMockData.createRecruitStatus(application); + + //when + String url = "/recruitments/" + recruitments.getId() + + "/applications/" + application.getId() + "/result"; + + String res = mockMvc.perform(get(url) + .header("Authorization", "Bearer " + accessToken)) + .andExpect(status().isOk()).andReturn().getResponse().getContentAsString(); + + ApplicationResultResDto applicationResultResDto = objectMapper + .readValue(res, ApplicationResultResDto.class); + + assertEquals(recruitments.getTitle(), applicationResultResDto.getTitle()); + assertEquals(ApplicationStatus.PROGRESS_DOCS, applicationResultResDto.getStatus()); + } + } diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java index 74ec67cf5..e6ac482a3 100644 --- a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java +++ b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java @@ -20,4 +20,11 @@ public interface ApplicationRepository extends JpaRepository + "JOIN FETCH a.recruit r " + "WHERE a.user.id = :userId and r.id = :recruitId and a.isDeleted = false and r.isDeleted = false") Optional findByUserIdAndRecruitId(@Param("userId") Long userId, @Param("recruitId") Long recruitId); + + @Query("SELECT a FROM Application a " + + "JOIN FETCH a.recruit r " + + "WHERE a.id = :applicationId and a.user.id = :userId " + + "and r.id = :recruitmentId and a.isDeleted = false and r.isDeleted = false") + Optional findApplication(@Param("applicationId") Long applicationId, @Param("userId")Long userId, + @Param("recruitmentId")Long recruitmentId); } diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/application/RecruitStatusRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/application/RecruitStatusRepository.java new file mode 100644 index 000000000..ae5094feb --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/application/RecruitStatusRepository.java @@ -0,0 +1,15 @@ +package gg.repo.recruit.user.application; + +import java.util.Optional; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import gg.data.recruit.application.RecruitStatus; + +public interface RecruitStatusRepository extends JpaRepository { + + @Query("SELECT rs FROM RecruitStatus rs WHERE rs.application.id = :applicationId") + Optional findByApplicationId(@Param("applicationId") Long applicationId); +} diff --git a/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java b/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java index ca8dce891..4474959e5 100644 --- a/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java +++ b/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java @@ -5,9 +5,11 @@ import org.springframework.stereotype.Component; import gg.data.recruit.application.Application; +import gg.data.recruit.application.RecruitStatus; import gg.data.recruit.recruitment.Recruitments; import gg.data.user.User; import gg.repo.recruit.user.application.ApplicationRepository; +import gg.repo.recruit.user.application.RecruitStatusRepository; import gg.repo.recruit.user.recruitment.RecruitmentRepository; import lombok.RequiredArgsConstructor; @@ -16,6 +18,7 @@ public class RecruitMockData { private final RecruitmentRepository recruitmentRepository; private final ApplicationRepository applicationRepository; + private final RecruitStatusRepository recruitStatusRepository; public Recruitments createRecruitments() { Recruitments recruitments = new Recruitments("title", "contents", "generation", @@ -34,4 +37,9 @@ public Application createApplication(User user, Recruitments recruitments) { Application application = new Application(user, recruitments); return applicationRepository.save(application); } + + public RecruitStatus createRecruitStatus(Application application) { + RecruitStatus recruitStatus = new RecruitStatus(application); + return recruitStatusRepository.save(recruitStatus); + } } From 15c33dfd04059a64c140dfe8dbd156427fdf817b Mon Sep 17 00:00:00 2001 From: yoahn <46748334+AYoungSn@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:43:22 +0900 Subject: [PATCH 09/12] =?UTF-8?q?#555=20feature=20=EC=A7=80=EC=9B=90?= =?UTF-8?q?=ED=95=98=EA=B8=B0=20api=20(#742)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/ApplicationAnswer.java | 4 ++ .../ApplicationAnswerCheckList.java | 7 +++ .../application/ApplicationAnswerText.java | 6 ++ .../gg/data/recruit/recruitment/Question.java | 6 ++ .../controller/ApplicationController.java | 22 ++++++++ .../request/RecruitApplyFormListReqDto.java | 16 ++++++ .../request/RecruitApplyFormReqDto.java | 36 ++++++++++++ .../response/ApplicationResultResDto.java | 2 + .../api/user/service/ApplicationService.java | 55 ++++++++++++++++++- .../service/param/RecruitApplyFormParam.java | 21 +++++++ .../user/service/param/RecruitApplyParam.java | 19 +++++++ .../gg/recruit/api/user}/RecruitMockData.java | 11 +++- .../controller/ApplicationControllerTest.java | 36 +++++++++++- .../controller/RecruitmentControllerTest.java | 2 +- .../application/ApplicationRepository.java | 6 +- .../java/gg/utils/exception/ErrorCode.java | 1 + .../custom/DuplicationException.java | 4 ++ 17 files changed, 246 insertions(+), 8 deletions(-) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/RecruitApplyFormListReqDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/RecruitApplyFormReqDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/RecruitApplyFormParam.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/RecruitApplyParam.java rename {gg-utils/src/testFixtures/java/gg/utils => gg-recruit-api/src/test/java/gg/recruit/api/user}/RecruitMockData.java (79%) diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java index d79e22292..2feaa2071 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java @@ -46,4 +46,8 @@ public Long getQuestionId() { public abstract ApplicationAnswerEntityDto toForm(); + public ApplicationAnswer(Application application, Question question) { + this.question = question; + this.application = application; + } } diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java index 9744b57c0..f2fd0c4e2 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java @@ -8,6 +8,7 @@ import javax.persistence.ManyToOne; import gg.data.recruit.recruitment.CheckList; +import gg.data.recruit.recruitment.Question; import lombok.NoArgsConstructor; @Entity @@ -27,4 +28,10 @@ public ApplicationAnswerEntityDto toForm() { return new ApplicationAnswerEntityDto(this.getQuestionId(), this.getInputType(), new CheckListEntityDto(checkList.getId(), checkList.getContent())); } + + public ApplicationAnswerCheckList(Application application, Question question, + CheckList checkList) { + super(application, question); + this.checkList = checkList; + } } diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java index b2ad7607e..c5f0169f4 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java @@ -5,6 +5,7 @@ import javax.persistence.Entity; import javax.persistence.Id; +import gg.data.recruit.recruitment.Question; import lombok.NoArgsConstructor; @Entity @@ -22,4 +23,9 @@ public class ApplicationAnswerText extends ApplicationAnswer { public ApplicationAnswerEntityDto toForm() { return new ApplicationAnswerEntityDto(this.getQuestionId(), this.getInputType(), answer); } + + public ApplicationAnswerText(Application application, Question question, String answer) { + super(application, question); + this.answer = answer; + } } diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java index 3f10a6bcc..f7c1bd869 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java @@ -45,4 +45,10 @@ public class Question extends BaseTimeEntity { private int sortNum; + public Question(Recruitments recruit, InputType inputType, String question, int sortNum) { + this.recruit = recruit; + this.inputType = inputType; + this.question = question; + this.sortNum = sortNum; + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java index 196858347..3e6a08994 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java @@ -1,18 +1,28 @@ package gg.recruit.api.user.controller; +import java.util.List; +import java.util.stream.Collectors; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import gg.auth.UserDto; import gg.auth.argumentresolver.Login; +import gg.recruit.api.user.controller.request.RecruitApplyFormListReqDto; import gg.recruit.api.user.controller.response.ApplicationResultResDto; import gg.recruit.api.user.controller.response.MyApplicationDetailResDto; import gg.recruit.api.user.controller.response.MyApplicationsResDto; import gg.recruit.api.user.service.ApplicationService; import gg.recruit.api.user.service.param.FindApplicationDetailParam; import gg.recruit.api.user.service.param.FindApplicationResultParam; +import gg.recruit.api.user.service.param.RecruitApplyFormParam; +import gg.recruit.api.user.service.param.RecruitApplyParam; import gg.recruit.api.user.service.response.ApplicationListSvcDto; import gg.recruit.api.user.service.response.ApplicationResultSvcDto; import gg.recruit.api.user.service.response.ApplicationWithAnswerSvcDto; @@ -40,6 +50,18 @@ public MyApplicationDetailResDto getMyApplication(@Login @Parameter(hidden = tru return new MyApplicationDetailResDto(res); } + @PostMapping("{recruitmentId}/applications") + public ResponseEntity apply(@Login @Parameter(hidden = true) UserDto userDto, + @PathVariable Long recruitmentId, @RequestBody RecruitApplyFormListReqDto reqDto) { + List forms = reqDto.getForms().stream() + .map(form -> new RecruitApplyFormParam(form.getQuestionId(), form.getInputType(), form.getCheckedList(), + form.getAnswer())) + .collect(Collectors.toList()); + Long applicationId = applicationService.recruitApply( + new RecruitApplyParam(userDto.getId(), recruitmentId, forms)); + return ResponseEntity.status(HttpStatus.CREATED).body(applicationId); + } + @GetMapping("{recruitmentId}/applications/{applicationId}/result") public ApplicationResultResDto getApplicationResult(@Login @Parameter(hidden = true) UserDto userDto, @PathVariable Long recruitmentId, @PathVariable Long applicationId) { diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/RecruitApplyFormListReqDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/RecruitApplyFormListReqDto.java new file mode 100644 index 000000000..88a85c671 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/RecruitApplyFormListReqDto.java @@ -0,0 +1,16 @@ +package gg.recruit.api.user.controller.request; + +import java.util.List; + +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class RecruitApplyFormListReqDto { + private List forms; + + public RecruitApplyFormListReqDto(List forms) { + this.forms = forms; + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/RecruitApplyFormReqDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/RecruitApplyFormReqDto.java new file mode 100644 index 000000000..7e9f13b8c --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/RecruitApplyFormReqDto.java @@ -0,0 +1,36 @@ +package gg.recruit.api.user.controller.request; + +import java.util.List; + +import gg.data.recruit.recruitment.enums.InputType; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class RecruitApplyFormReqDto { + private Long questionId; + private InputType inputType; + private List checkedList; + private String answer; + + public RecruitApplyFormReqDto(Long questionId, String answer) { + this.questionId = questionId; + this.inputType = InputType.TEXT; + this.answer = answer; + } + + public RecruitApplyFormReqDto(Long questionId, List checkedList) { + this.questionId = questionId; + this.inputType = InputType.MULTI_CHECK; + this.checkedList = checkedList; + } + + public RecruitApplyFormReqDto(Long questionId, Long checkedList) { + this.questionId = questionId; + this.inputType = InputType.SINGLE_CHECK; + this.checkedList = List.of(checkedList); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResultResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResultResDto.java index 266b73dc3..b31271b81 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResultResDto.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResultResDto.java @@ -7,9 +7,11 @@ import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @AllArgsConstructor(access = AccessLevel.PROTECTED) +@NoArgsConstructor public class ApplicationResultResDto { private String title; private ApplicationStatus status; diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java index 98199cb0c..a5ea366bb 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java @@ -7,16 +7,29 @@ import gg.data.recruit.application.Application; import gg.data.recruit.application.ApplicationAnswer; +import gg.data.recruit.application.ApplicationAnswerCheckList; +import gg.data.recruit.application.ApplicationAnswerText; import gg.data.recruit.application.RecruitStatus; +import gg.data.recruit.recruitment.Recruitments; +import gg.data.recruit.recruitment.enums.InputType; +import gg.data.user.User; +import gg.data.user.type.SnsType; import gg.recruit.api.user.service.param.FindApplicationDetailParam; import gg.recruit.api.user.service.param.FindApplicationResultParam; +import gg.recruit.api.user.service.param.RecruitApplyFormParam; +import gg.recruit.api.user.service.param.RecruitApplyParam; import gg.recruit.api.user.service.response.ApplicationListSvcDto; import gg.recruit.api.user.service.response.ApplicationResultSvcDto; import gg.recruit.api.user.service.response.ApplicationWithAnswerSvcDto; import gg.repo.recruit.user.application.ApplicationAnswerRepository; import gg.repo.recruit.user.application.ApplicationRepository; import gg.repo.recruit.user.application.RecruitStatusRepository; +import gg.repo.recruit.user.recruitment.CheckListRepository; +import gg.repo.recruit.user.recruitment.QuestionRepository; +import gg.repo.recruit.user.recruitment.RecruitmentRepository; +import gg.repo.user.UserRepository; import gg.utils.exception.ErrorCode; +import gg.utils.exception.custom.DuplicationException; import gg.utils.exception.custom.NotExistException; import lombok.RequiredArgsConstructor; @@ -26,9 +39,12 @@ public class ApplicationService { private final ApplicationRepository applicationRepository; private final ApplicationAnswerRepository applicationAnswerRepository; + private final UserRepository userRepository; + private final RecruitmentRepository recruitmentRepository; + private final QuestionRepository questionRepository; + private final CheckListRepository checkListRepository; private final RecruitStatusRepository recruitStatusRepository; - public ApplicationListSvcDto findMyApplications(Long userId) { List res = applicationRepository.findAllByUserId(userId); return new ApplicationListSvcDto(res); @@ -48,6 +64,43 @@ public Long findApplicationByUserAndRecruit(Long userId, Long recruitId) { return application.map(Application::getId).orElse(null); } + /** + * user ๊ฐ€ recruit ์— ์ง€์›ํ•œ๋‹ค. + * @param param + * @return + */ + public Long recruitApply(RecruitApplyParam param) { + // application ์— ๊ธฐ์กด ์ง€์›์„œ๊ฐ€ ์กด์žฌํ•˜๋Š”์ง€ ํ™•์ธ isExist + Optional application = applicationRepository + .findByUserIdAndRecruitId(param.getUserId(), param.getRecruitId()); + if (application.isPresent()) { + throw new DuplicationException("์ด๋ฏธ ์ง€์›ํ•œ ๊ณต๊ณ ์ž…๋‹ˆ๋‹ค. applicationId = " + application.get().getId()); + } + // application ์ƒ์„ฑ + User user = userRepository.findById(param.getUserId()) + .orElseThrow(() -> new NotExistException("user not found")); + if (user.getSnsNotiOpt().equals(SnsType.NONE) || user.getSnsNotiOpt().equals(SnsType.EMAIL)) { + user.updateTypes(user.getRacketType(), SnsType.BOTH); + } + Recruitments recruitments = recruitmentRepository.getById(param.getRecruitId()); + Application newApplication = applicationRepository.save(new Application(user, recruitments)); + for (RecruitApplyFormParam form : + param.getForms()) { + if (form.getInputType().equals(InputType.TEXT)) { + applicationAnswerRepository.save( + new ApplicationAnswerText(newApplication, questionRepository.getById(form.getQuestionId()), + form.getAnswer())); + } else { + for (Long checkedId : form.getCheckedList()) { + applicationAnswerRepository.save( + new ApplicationAnswerCheckList(newApplication, questionRepository.getById(form.getQuestionId()), + checkListRepository.getById(checkedId))); + } + } + } + return newApplication.getId(); + } + public ApplicationResultSvcDto findApplicationResult(FindApplicationResultParam param) { Optional optionalApplication = applicationRepository .findApplication(param.getApplicationId(), param.getUserId(), param.getRecruitmentId()); diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/RecruitApplyFormParam.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/RecruitApplyFormParam.java new file mode 100644 index 000000000..1519f20a8 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/RecruitApplyFormParam.java @@ -0,0 +1,21 @@ +package gg.recruit.api.user.service.param; + +import java.util.List; + +import gg.data.recruit.recruitment.enums.InputType; +import lombok.Getter; + +@Getter +public class RecruitApplyFormParam { + private Long questionId; + private InputType inputType; + private List checkedList; + private String answer; + + public RecruitApplyFormParam(Long questionId, InputType inputType, List checkedList, String answer) { + this.questionId = questionId; + this.inputType = inputType; + this.checkedList = checkedList; + this.answer = answer; + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/RecruitApplyParam.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/RecruitApplyParam.java new file mode 100644 index 000000000..12c596f73 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/RecruitApplyParam.java @@ -0,0 +1,19 @@ +package gg.recruit.api.user.service.param; + +import java.util.List; + +import lombok.Getter; + +@Getter +public class RecruitApplyParam { + private Long recruitId; + private Long userId; + private List forms; + + public RecruitApplyParam(Long recruitId, Long userId, List forms) { + this.recruitId = recruitId; + this.userId = userId; + this.forms = forms; + } + +} diff --git a/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java similarity index 79% rename from gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java rename to gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java index 4474959e5..fe783c411 100644 --- a/gg-utils/src/testFixtures/java/gg/utils/RecruitMockData.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java @@ -1,4 +1,4 @@ -package gg.utils; +package gg.recruit.api.user; import java.time.LocalDateTime; @@ -6,10 +6,13 @@ import gg.data.recruit.application.Application; import gg.data.recruit.application.RecruitStatus; +import gg.data.recruit.recruitment.Question; import gg.data.recruit.recruitment.Recruitments; +import gg.data.recruit.recruitment.enums.InputType; import gg.data.user.User; import gg.repo.recruit.user.application.ApplicationRepository; import gg.repo.recruit.user.application.RecruitStatusRepository; +import gg.repo.recruit.user.recruitment.QuestionRepository; import gg.repo.recruit.user.recruitment.RecruitmentRepository; import lombok.RequiredArgsConstructor; @@ -18,6 +21,7 @@ public class RecruitMockData { private final RecruitmentRepository recruitmentRepository; private final ApplicationRepository applicationRepository; + private final QuestionRepository questionRepository; private final RecruitStatusRepository recruitStatusRepository; public Recruitments createRecruitments() { @@ -38,6 +42,11 @@ public Application createApplication(User user, Recruitments recruitments) { return applicationRepository.save(application); } + public Question createQuestion(Recruitments recruitments) { + Question question = new Question(recruitments, InputType.TEXT, "question", 1); + return questionRepository.save(question); + } + public RecruitStatus createRecruitStatus(Application application) { RecruitStatus recruitStatus = new RecruitStatus(application); return recruitStatusRepository.save(recruitStatus); diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java index fd7670cd4..4bc6f5a34 100644 --- a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java @@ -4,6 +4,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; +import java.util.List; + import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -14,13 +16,15 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.data.recruit.application.Application; -import gg.data.recruit.application.RecruitStatus; import gg.data.recruit.application.enums.ApplicationStatus; +import gg.data.recruit.recruitment.Question; import gg.data.recruit.recruitment.Recruitments; import gg.data.user.User; +import gg.recruit.api.user.RecruitMockData; +import gg.recruit.api.user.controller.request.RecruitApplyFormListReqDto; +import gg.recruit.api.user.controller.request.RecruitApplyFormReqDto; import gg.recruit.api.user.controller.response.ApplicationResultResDto; import gg.recruit.api.user.controller.response.MyApplicationsResDto; -import gg.utils.RecruitMockData; import gg.utils.TestDataUtils; import gg.utils.annotation.IntegrationTest; @@ -63,6 +67,34 @@ public void getMyApplicationsTest() throws Exception { assertEquals(3, myApplicationsResDto.getApplications().size()); } + @Test + @DisplayName("POST /recruitments/{recruitmentId}/applications -> 201 CREATED TEST") + void saveApplicationTest() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + + Recruitments recruitments = recruitMockData.createRecruitments(); + Question q1 = recruitMockData.createQuestion(recruitments); + Question q2 = recruitMockData.createQuestion(recruitments); + Question q3 = recruitMockData.createQuestion(recruitments); + + List forms = List.of(new RecruitApplyFormReqDto(q1.getId(), "๋‹ต๋ณ€ 1"), + new RecruitApplyFormReqDto(q2.getId(), "๋‹ต๋ณ€ 2"), + new RecruitApplyFormReqDto(q3.getId(), "๋‹ต๋ณ€ 3")); + RecruitApplyFormListReqDto req = new RecruitApplyFormListReqDto(forms); + String content = objectMapper.writeValueAsString(req); + + //when + String res = mockMvc.perform(post(("/recruitments/" + recruitments.getId() + "/applications")) + .header("Authorization", "Bearer " + accessToken) + .contentType("application/json") + .content(content)) + .andExpect(status().isCreated()).andReturn().getResponse().getContentAsString(); + + //then + } + @Test @DisplayName("GET /recruitments/{recruitmentId}/applications/{applicationId}/result -> 200 OK TEST") public void applicationResApiTest() throws Exception { diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java index cc08acda3..8287f0cce 100644 --- a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java @@ -16,9 +16,9 @@ import gg.data.recruit.application.Application; import gg.data.recruit.recruitment.Recruitments; import gg.data.user.User; +import gg.recruit.api.user.RecruitMockData; import gg.recruit.api.user.controller.response.ActiveRecruitmentListResDto; import gg.recruit.api.user.controller.response.RecruitmentDetailResDto; -import gg.utils.RecruitMockData; import gg.utils.TestDataUtils; import gg.utils.annotation.IntegrationTest; diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java index e6ac482a3..af4802015 100644 --- a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java +++ b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java @@ -14,7 +14,7 @@ public interface ApplicationRepository extends JpaRepository @EntityGraph(attributePaths = {"recruit"}) @Query("SELECT a FROM Application a WHERE a.user.id = :userId and a.isDeleted = false") - List findAllByUserId(Long userId); + List findAllByUserId(@Param("userId") Long userId); @Query("SELECT a FROM Application a " + "JOIN FETCH a.recruit r " @@ -25,6 +25,6 @@ public interface ApplicationRepository extends JpaRepository + "JOIN FETCH a.recruit r " + "WHERE a.id = :applicationId and a.user.id = :userId " + "and r.id = :recruitmentId and a.isDeleted = false and r.isDeleted = false") - Optional findApplication(@Param("applicationId") Long applicationId, @Param("userId")Long userId, - @Param("recruitmentId")Long recruitmentId); + Optional findApplication(@Param("applicationId") Long applicationId, @Param("userId") Long userId, + @Param("recruitmentId") Long recruitmentId); } diff --git a/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java b/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java index 56bd12820..f58dd3f77 100644 --- a/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java +++ b/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java @@ -116,6 +116,7 @@ public enum ErrorCode { VALID_FAILED(400, "CM007", "Valid Test Failed."), BAD_ARGU(400, "ARGUMENT-ERR-400", "์ž˜๋ชป๋œ argument ์ž…๋‹ˆ๋‹ค."), UNREADABLE_HTTP_MESSAGE(400, "CM008", "์œ ํšจํ•˜์ง€ ์•Š์€ HTTP ๋ฉ”์‹œ์ง€์ž…๋‹ˆ๋‹ค."), + CONFLICT(409, "CM009", "CONFLICT"), //Feedback FEEDBACK_NOT_FOUND(404, "FB100", "FB NOT FOUND"), diff --git a/gg-utils/src/main/java/gg/utils/exception/custom/DuplicationException.java b/gg-utils/src/main/java/gg/utils/exception/custom/DuplicationException.java index 7d3591af2..0fc4c5861 100644 --- a/gg-utils/src/main/java/gg/utils/exception/custom/DuplicationException.java +++ b/gg-utils/src/main/java/gg/utils/exception/custom/DuplicationException.java @@ -6,4 +6,8 @@ public class DuplicationException extends CustomRuntimeException { public DuplicationException(String message, ErrorCode errorCode) { super(message, errorCode); } + + public DuplicationException(String message) { + super(message, ErrorCode.CONFLICT); + } } From 49a78da6d7f5b8454ef593957713eac923a93223 Mon Sep 17 00:00:00 2001 From: yoahn <46748334+AYoungSn@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:29:34 +0900 Subject: [PATCH 10/12] =?UTF-8?q?[FEAT]=20#556=20feature=20=EC=A7=80?= =?UTF-8?q?=EC=9B=90=20=EC=B7=A8=EC=86=8C=20api=20(#746)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/recruit/application/Application.java | 9 ++++ .../recruit/recruitment/Recruitments.java | 4 ++ .../controller/ApplicationController.java | 9 ++++ .../api/user/service/ApplicationService.java | 16 ++++++ .../service/param/DelApplicationParam.java | 16 ++++++ .../gg/recruit/api/user/RecruitMockData.java | 6 +++ .../controller/ApplicationControllerTest.java | 53 +++++++++++++++++++ .../java/gg/utils/exception/ErrorCode.java | 1 + .../exception/custom/ForbiddenException.java | 4 ++ 9 files changed, 118 insertions(+) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/DelApplicationParam.java diff --git a/gg-data/src/main/java/gg/data/recruit/application/Application.java b/gg-data/src/main/java/gg/data/recruit/application/Application.java index 8faaa3ebb..eb7b50247 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/Application.java +++ b/gg-data/src/main/java/gg/data/recruit/application/Application.java @@ -48,7 +48,16 @@ public Application(User user, Recruitments recruit) { this.isDeleted = false; this.status = ApplicationStatus.PROGRESS_DOCS; } + public String getRecruitTitle() { return this.recruit.getTitle(); } + + public void delete() { + this.isDeleted = Boolean.TRUE; + } + + public Boolean isUpdateAvailable() { + return !recruit.isEnd(); + } } diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java index cfadc5f01..e08807138 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java @@ -52,4 +52,8 @@ public Recruitments(String title, String contents, String generation, LocalDateT public void del() { this.isDeleted = true; } + + public Boolean isEnd() { + return LocalDateTime.now().isAfter(this.endTime); + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java index 3e6a08994..c761ec215 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java @@ -5,6 +5,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -19,6 +20,7 @@ import gg.recruit.api.user.controller.response.MyApplicationDetailResDto; import gg.recruit.api.user.controller.response.MyApplicationsResDto; import gg.recruit.api.user.service.ApplicationService; +import gg.recruit.api.user.service.param.DelApplicationParam; import gg.recruit.api.user.service.param.FindApplicationDetailParam; import gg.recruit.api.user.service.param.FindApplicationResultParam; import gg.recruit.api.user.service.param.RecruitApplyFormParam; @@ -70,4 +72,11 @@ public ApplicationResultResDto getApplicationResult(@Login @Parameter(hidden = t recruitmentId, applicationId)); return new ApplicationResultResDto(res); } + + @DeleteMapping("/{recruitmentId}/applications/{applicationId}") + public ResponseEntity cancelApplication(@Login @Parameter(hidden = true) UserDto userDto, + @PathVariable Long recruitmentId, @PathVariable Long applicationId) { + applicationService.deleteApplication(new DelApplicationParam(userDto.getId(), recruitmentId, applicationId)); + return ResponseEntity.noContent().build(); + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java index a5ea366bb..08ca8598b 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java @@ -14,6 +14,7 @@ import gg.data.recruit.recruitment.enums.InputType; import gg.data.user.User; import gg.data.user.type.SnsType; +import gg.recruit.api.user.service.param.DelApplicationParam; import gg.recruit.api.user.service.param.FindApplicationDetailParam; import gg.recruit.api.user.service.param.FindApplicationResultParam; import gg.recruit.api.user.service.param.RecruitApplyFormParam; @@ -30,6 +31,7 @@ import gg.repo.user.UserRepository; import gg.utils.exception.ErrorCode; import gg.utils.exception.custom.DuplicationException; +import gg.utils.exception.custom.ForbiddenException; import gg.utils.exception.custom.NotExistException; import lombok.RequiredArgsConstructor; @@ -116,4 +118,18 @@ public ApplicationResultSvcDto findApplicationResult(FindApplicationResultParam } return result; } + + public void deleteApplication(DelApplicationParam param) { + Application application = applicationRepository + .findByUserIdAndRecruitId(param.getUserId(), param.getRecruitmentId()) + .orElseThrow(() -> new NotExistException("application not found")); + if (!application.isUpdateAvailable()) { + throw new ForbiddenException("์ง€์›์„œ ์ˆ˜์ • ๊ธฐ๊ฐ„์ด ์ง€๋‚ฌ์Šต๋‹ˆ๋‹ค."); + } + if (application.getId().equals(param.getApplicationId())) { + application.delete(); + } else { + throw new NotExistException("application not found"); + } + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/DelApplicationParam.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/DelApplicationParam.java new file mode 100644 index 000000000..bb19390e5 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/DelApplicationParam.java @@ -0,0 +1,16 @@ +package gg.recruit.api.user.service.param; + +import lombok.Getter; + +@Getter +public class DelApplicationParam { + private Long userId; + private Long applicationId; + private Long recruitmentId; + + public DelApplicationParam(Long userId, Long applicationId, Long recruitmentId) { + this.applicationId = applicationId; + this.recruitmentId = recruitmentId; + this.userId = userId; + } +} diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java index fe783c411..6e8061fdd 100644 --- a/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java @@ -37,6 +37,12 @@ public Recruitments createRecruitmentsDel() { return recruitmentRepository.save(recruitments); } + public Recruitments createRecruitmentsEnd() { + Recruitments recruitments = new Recruitments("title", "contents", "generation", + LocalDateTime.now().minusDays(2), LocalDateTime.now().minusDays(1)); + return recruitmentRepository.save(recruitments); + } + public Application createApplication(User user, Recruitments recruitments) { Application application = new Application(user, recruitments); return applicationRepository.save(application); diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java index 4bc6f5a34..fc0b32fa5 100644 --- a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java @@ -120,4 +120,57 @@ public void applicationResApiTest() throws Exception { assertEquals(ApplicationStatus.PROGRESS_DOCS, applicationResultResDto.getStatus()); } + @Test + @DisplayName("DELETE /recruitments/{recruitmentId}/applications/{applicationId} -> 204 NO_CONTENT TEST") + void deleteApplicationTest() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + Recruitments recruitments = recruitMockData.createRecruitments(); + Application application = recruitMockData.createApplication(user, recruitments); + + //when + String url = "/recruitments/" + recruitments.getId() + + "/applications/" + application.getId(); + + mockMvc.perform(delete(url) + .header("Authorization", "Bearer " + accessToken)) + .andExpect(status().isNoContent()); + } + + @Test + @DisplayName("DELETE /recruitments/{recruitmentId}/applications/{applicationId} -> 403 FORBIDDEN TEST") + void deleteApplicationForbiddenTest() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + Recruitments recruitments = recruitMockData.createRecruitmentsEnd(); + Application application = recruitMockData.createApplication(user, recruitments); + + //when, then + String url = "/recruitments/" + recruitments.getId() + + "/applications/" + application.getId(); + + mockMvc.perform(delete(url) + .header("Authorization", "Bearer " + accessToken)) + .andExpect(status().isForbidden()); + } + + @Test + @DisplayName("DELETE /recruitments/{recruitmentId}/applications/{applicationId} -> 404 NOT_FOUND TEST") + void deleteApplicationNotFoundTest() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + Recruitments recruitments = recruitMockData.createRecruitmentsDel(); + Application application = recruitMockData.createApplication(user, recruitments); + + //when, then + String url = "/recruitments/" + recruitments.getId() + + "/applications/" + application.getId() + 1; + + mockMvc.perform(delete(url) + .header("Authorization", "Bearer " + accessToken)) + .andExpect(status().isNotFound()); + } } diff --git a/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java b/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java index f58dd3f77..a314a71a6 100644 --- a/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java +++ b/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java @@ -117,6 +117,7 @@ public enum ErrorCode { BAD_ARGU(400, "ARGUMENT-ERR-400", "์ž˜๋ชป๋œ argument ์ž…๋‹ˆ๋‹ค."), UNREADABLE_HTTP_MESSAGE(400, "CM008", "์œ ํšจํ•˜์ง€ ์•Š์€ HTTP ๋ฉ”์‹œ์ง€์ž…๋‹ˆ๋‹ค."), CONFLICT(409, "CM009", "CONFLICT"), + FORBIDDEN(403, "CM010", "์ ‘๊ทผ์ด ๊ธˆ์ง€๋œ ์š”์ฒญ์ž…๋‹ˆ๋‹ค."), //Feedback FEEDBACK_NOT_FOUND(404, "FB100", "FB NOT FOUND"), diff --git a/gg-utils/src/main/java/gg/utils/exception/custom/ForbiddenException.java b/gg-utils/src/main/java/gg/utils/exception/custom/ForbiddenException.java index b9ff7b742..f31592bd4 100644 --- a/gg-utils/src/main/java/gg/utils/exception/custom/ForbiddenException.java +++ b/gg-utils/src/main/java/gg/utils/exception/custom/ForbiddenException.java @@ -6,4 +6,8 @@ public class ForbiddenException extends CustomRuntimeException { public ForbiddenException(String message, ErrorCode errorCode) { super(message, errorCode); } + + public ForbiddenException(String message) { + super(message, ErrorCode.FORBIDDEN); + } } From e8db691314f7dde2460abe95cc451c710db8431c Mon Sep 17 00:00:00 2001 From: Hyunkyu Lee <88573971+wken5577@users.noreply.github.com> Date: Sat, 23 Mar 2024 20:59:39 +0900 Subject: [PATCH 11/12] [FEAT] #557 patch application api (#749) --- .../application/ApplicationAnswer.java | 2 + .../ApplicationAnswerCheckList.java | 5 ++ .../application/ApplicationAnswerText.java | 5 ++ .../data/recruit/recruitment/CheckList.java | 6 ++ .../gg/data/recruit/recruitment/Question.java | 7 ++- .../controller/ApplicationController.java | 11 ++++ .../request/CheckListFormRequest.java | 31 +++++++++++ .../request/FormPatchRequestDto.java | 21 +++++++ .../user/controller/request/FormRequest.java | 26 +++++++++ .../controller/request/TextFormRequest.java | 29 ++++++++++ .../api/user/service/ApplicationService.java | 40 ++++++++++++++ .../service/param/CheckListFormParam.java | 36 ++++++++++++ .../api/user/service/param/FormParam.java | 26 +++++++++ .../user/service/param/FormPatchParam.java | 23 ++++++++ .../api/user/service/param/TextFormParam.java | 32 +++++++++++ .../gg/recruit/api/user/RecruitMockData.java | 36 ++++++++++++ .../controller/ApplicationControllerTest.java | 55 +++++++++++++++++++ .../ApplicationAnswerRepository.java | 11 ++++ .../user/recruitment/CheckListRepository.java | 5 +- 19 files changed, 404 insertions(+), 3 deletions(-) create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/CheckListFormRequest.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/FormPatchRequestDto.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/FormRequest.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/TextFormRequest.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/CheckListFormParam.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FormParam.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FormPatchParam.java create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/TextFormParam.java diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java index 2feaa2071..40f0613fe 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java @@ -44,6 +44,8 @@ public Long getQuestionId() { return question.getId(); } + public abstract String getAnswer(); + public abstract ApplicationAnswerEntityDto toForm(); public ApplicationAnswer(Application application, Question question) { diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java index f2fd0c4e2..9c81b1d3e 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java @@ -23,6 +23,11 @@ public class ApplicationAnswerCheckList extends ApplicationAnswer { @JoinColumn(name = "check_list_id", nullable = false) private CheckList checkList; + @Override + public String getAnswer() { + return checkList.getContent(); + } + @Override public ApplicationAnswerEntityDto toForm() { return new ApplicationAnswerEntityDto(this.getQuestionId(), this.getInputType(), diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java index c5f0169f4..55ce791a1 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java @@ -19,6 +19,11 @@ public class ApplicationAnswerText extends ApplicationAnswer { @Column(length = 1000) private String answer; + @Override + public String getAnswer() { + return answer; + } + @Override public ApplicationAnswerEntityDto toForm() { return new ApplicationAnswerEntityDto(this.getQuestionId(), this.getInputType(), answer); diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java b/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java index 6b6130ad7..74dadd719 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java @@ -29,4 +29,10 @@ public class CheckList extends BaseTimeEntity { @Column(length = 100) private String content; + + public CheckList(Question question, String content) { + this.question = question; + this.content = content; + question.addCheckList(this); + } } diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java index f7c1bd869..f608a5143 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java @@ -1,5 +1,6 @@ package gg.data.recruit.recruitment; +import java.util.ArrayList; import java.util.List; import javax.persistence.CascadeType; @@ -41,7 +42,7 @@ public class Question extends BaseTimeEntity { private String question; @OneToMany(mappedBy = "question", cascade = CascadeType.ALL) - private List checkLists; + private List checkLists = new ArrayList<>(); private int sortNum; @@ -51,4 +52,8 @@ public Question(Recruitments recruit, InputType inputType, String question, int this.question = question; this.sortNum = sortNum; } + + protected void addCheckList(CheckList checkList) { + this.checkLists.add(checkList); + } } diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java index c761ec215..0338260d4 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java @@ -7,6 +7,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -15,6 +16,7 @@ import gg.auth.UserDto; import gg.auth.argumentresolver.Login; +import gg.recruit.api.user.controller.request.FormPatchRequestDto; import gg.recruit.api.user.controller.request.RecruitApplyFormListReqDto; import gg.recruit.api.user.controller.response.ApplicationResultResDto; import gg.recruit.api.user.controller.response.MyApplicationDetailResDto; @@ -23,6 +25,7 @@ import gg.recruit.api.user.service.param.DelApplicationParam; import gg.recruit.api.user.service.param.FindApplicationDetailParam; import gg.recruit.api.user.service.param.FindApplicationResultParam; +import gg.recruit.api.user.service.param.FormPatchParam; import gg.recruit.api.user.service.param.RecruitApplyFormParam; import gg.recruit.api.user.service.param.RecruitApplyParam; import gg.recruit.api.user.service.response.ApplicationListSvcDto; @@ -73,6 +76,14 @@ public ApplicationResultResDto getApplicationResult(@Login @Parameter(hidden = t return new ApplicationResultResDto(res); } + @PatchMapping("{recruitmentId}/applications/{applicationId}") + public ResponseEntity updateApplication(@Login @Parameter(hidden = true) UserDto userDto, + @PathVariable Long recruitmentId, @PathVariable Long applicationId, @RequestBody FormPatchRequestDto reqDto) { + applicationService.updateApplication(new FormPatchParam(applicationId, recruitmentId, + userDto.getId(), reqDto.toFormParamList())); + return ResponseEntity.noContent().build(); + } + @DeleteMapping("/{recruitmentId}/applications/{applicationId}") public ResponseEntity cancelApplication(@Login @Parameter(hidden = true) UserDto userDto, @PathVariable Long recruitmentId, @PathVariable Long applicationId) { diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/CheckListFormRequest.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/CheckListFormRequest.java new file mode 100644 index 000000000..071d37c69 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/CheckListFormRequest.java @@ -0,0 +1,31 @@ +package gg.recruit.api.user.controller.request; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import gg.data.recruit.recruitment.enums.InputType; +import gg.recruit.api.user.service.param.CheckListFormParam; +import gg.recruit.api.user.service.param.FormParam; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Setter +@NoArgsConstructor +public class CheckListFormRequest extends FormRequest { + + @JsonProperty("checkedList") + private List checkedList; + + public CheckListFormRequest(Long questionId, InputType inputType, List checkedList) { + this.checkedList = checkedList; + this.questionId = questionId; + this.inputType = inputType; + } + + @Override + public FormParam toFormParam() { + return new CheckListFormParam(checkedList, questionId, inputType); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/FormPatchRequestDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/FormPatchRequestDto.java new file mode 100644 index 000000000..ddc43099d --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/FormPatchRequestDto.java @@ -0,0 +1,21 @@ +package gg.recruit.api.user.controller.request; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.recruit.api.user.service.param.FormParam; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class FormPatchRequestDto { + List forms; + + public List toFormParamList() { + return forms.stream().map(FormRequest::toFormParam) + .collect(Collectors.toList()); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/FormRequest.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/FormRequest.java new file mode 100644 index 000000000..50a5dfbfe --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/FormRequest.java @@ -0,0 +1,26 @@ +package gg.recruit.api.user.controller.request; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import gg.data.recruit.recruitment.enums.InputType; +import gg.recruit.api.user.service.param.FormParam; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "inputType", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = TextFormRequest.class, name = "TEXT"), + @JsonSubTypes.Type(value = CheckListFormRequest.class, name = "SINGLE_CHECK"), + @JsonSubTypes.Type(value = CheckListFormRequest.class, name = "MULTI_CHECK") +}) +@Setter +@Getter +@NoArgsConstructor +public abstract class FormRequest { + protected Long questionId; + protected InputType inputType; + + public abstract FormParam toFormParam(); +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/TextFormRequest.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/TextFormRequest.java new file mode 100644 index 000000000..b497b9b85 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/request/TextFormRequest.java @@ -0,0 +1,29 @@ +package gg.recruit.api.user.controller.request; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import gg.data.recruit.recruitment.enums.InputType; +import gg.recruit.api.user.service.param.FormParam; +import gg.recruit.api.user.service.param.TextFormParam; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Setter +@NoArgsConstructor +public class TextFormRequest extends FormRequest { + + @JsonProperty("answer") + private String answer; + + public TextFormRequest(Long questionId, InputType inputType, String answer) { + this.questionId = questionId; + this.inputType = inputType; + this.answer = answer; + } + + @Override + public FormParam toFormParam() { + return new TextFormParam(answer, questionId, inputType); + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java index 08ca8598b..4c62f2177 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java @@ -1,15 +1,21 @@ package gg.recruit.api.user.service; +import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Optional; +import java.util.stream.Collectors; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import gg.data.recruit.application.Application; import gg.data.recruit.application.ApplicationAnswer; import gg.data.recruit.application.ApplicationAnswerCheckList; import gg.data.recruit.application.ApplicationAnswerText; import gg.data.recruit.application.RecruitStatus; +import gg.data.recruit.recruitment.CheckList; +import gg.data.recruit.recruitment.Question; import gg.data.recruit.recruitment.Recruitments; import gg.data.recruit.recruitment.enums.InputType; import gg.data.user.User; @@ -17,6 +23,8 @@ import gg.recruit.api.user.service.param.DelApplicationParam; import gg.recruit.api.user.service.param.FindApplicationDetailParam; import gg.recruit.api.user.service.param.FindApplicationResultParam; +import gg.recruit.api.user.service.param.FormParam; +import gg.recruit.api.user.service.param.FormPatchParam; import gg.recruit.api.user.service.param.RecruitApplyFormParam; import gg.recruit.api.user.service.param.RecruitApplyParam; import gg.recruit.api.user.service.response.ApplicationListSvcDto; @@ -119,6 +127,38 @@ public ApplicationResultSvcDto findApplicationResult(FindApplicationResultParam return result; } + @Transactional + public void updateApplication(FormPatchParam param) { + Application application = applicationRepository.findByUserIdAndRecruitId(param.getUserId(), + param.getRecruitmentId()).orElseThrow(() -> + new NotExistException("application not found")); + + //delete all existing answers + List questionIds = param.getQuestionIds(); + List res = applicationAnswerRepository.findAllByQuestionIds(param.getUserId(), + param.getApplicationId(), param.getRecruitmentId(), questionIds); + applicationAnswerRepository.deleteAll(res); + + Map questionMap = questionRepository.findAllById(questionIds) + .stream() + .collect(Collectors.toMap(Question::getId, q -> q)); + + Map checkListMap = checkListRepository.findAllByQuestionIds(questionIds) + .stream() + .collect(Collectors.toMap(CheckList::getId, q -> q)); + applicationAnswerRepository.saveAll( + toApplicationAnswer(application, questionMap, checkListMap, param.getForms())); + } + + private List toApplicationAnswer(Application application, Map questionMap, + Map checkListMap, List forms) { + List newAnswers = new ArrayList<>(); + forms.stream().forEach(form -> { + newAnswers.addAll(form.toApplicationAnswer(application, questionMap, checkListMap)); + }); + return newAnswers; + } + public void deleteApplication(DelApplicationParam param) { Application application = applicationRepository .findByUserIdAndRecruitId(param.getUserId(), param.getRecruitmentId()) diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/CheckListFormParam.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/CheckListFormParam.java new file mode 100644 index 000000000..1c068b023 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/CheckListFormParam.java @@ -0,0 +1,36 @@ +package gg.recruit.api.user.service.param; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import gg.data.recruit.application.Application; +import gg.data.recruit.application.ApplicationAnswer; +import gg.data.recruit.application.ApplicationAnswerCheckList; +import gg.data.recruit.recruitment.CheckList; +import gg.data.recruit.recruitment.Question; +import gg.data.recruit.recruitment.enums.InputType; + +public class CheckListFormParam extends FormParam { + private final List checkedList; + + public CheckListFormParam(List checkedList, Long questionId, InputType inputType) { + this.checkedList = checkedList; + this.questionId = questionId; + this.inputType = inputType; + } + + @Override + public List toApplicationAnswer(Application application, Map questionMap, + Map checkListMap) { + List res = new ArrayList<>(); + for (Long checkListId : checkedList) { + CheckList checkList = checkListMap.get(checkListId); + if (checkList == null) { + throw new IllegalArgumentException("checkListId must exist in checkListMap"); + } + res.add(new ApplicationAnswerCheckList(application, questionMap.get(questionId), checkList)); + } + return res; + } +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FormParam.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FormParam.java new file mode 100644 index 000000000..ae91ce601 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FormParam.java @@ -0,0 +1,26 @@ +package gg.recruit.api.user.service.param; + +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import gg.data.recruit.application.Application; +import gg.data.recruit.application.ApplicationAnswer; +import gg.data.recruit.recruitment.CheckList; +import gg.data.recruit.recruitment.Question; +import gg.data.recruit.recruitment.enums.InputType; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +@Getter +public abstract class FormParam { + protected Long questionId; + + protected InputType inputType; + + public abstract List toApplicationAnswer(Application application, + Map questionMap, Map checkListMap); +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FormPatchParam.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FormPatchParam.java new file mode 100644 index 000000000..e29a0854e --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/FormPatchParam.java @@ -0,0 +1,23 @@ +package gg.recruit.api.user.service.param; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.recruit.api.user.controller.request.FormRequest; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class FormPatchParam { + Long applicationId; + Long recruitmentId; + Long userId; + List forms; + + public List getQuestionIds() { + return forms.stream().map(FormParam::getQuestionId) + .collect(Collectors.toList()); + } + +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/TextFormParam.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/TextFormParam.java new file mode 100644 index 000000000..b5f760ddc --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/param/TextFormParam.java @@ -0,0 +1,32 @@ +package gg.recruit.api.user.service.param; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import gg.data.recruit.application.Application; +import gg.data.recruit.application.ApplicationAnswer; +import gg.data.recruit.application.ApplicationAnswerText; +import gg.data.recruit.recruitment.CheckList; +import gg.data.recruit.recruitment.Question; +import gg.data.recruit.recruitment.enums.InputType; +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import lombok.Setter; + +public class TextFormParam extends FormParam { + private String answer; + + public TextFormParam(String answer, Long questionId, InputType inputType) { + this.answer = answer; + this.questionId = questionId; + this.inputType = inputType; + } + + @Override + public List toApplicationAnswer(Application application, Map questionMap, + Map checkListMap) { + return Collections.singletonList( + new ApplicationAnswerText(application, questionMap.get(questionId), answer)); + } +} diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java index 6e8061fdd..e477eaedd 100644 --- a/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java @@ -1,17 +1,24 @@ package gg.recruit.api.user; import java.time.LocalDateTime; +import java.util.List; import org.springframework.stereotype.Component; import gg.data.recruit.application.Application; +import gg.data.recruit.application.ApplicationAnswer; +import gg.data.recruit.application.ApplicationAnswerCheckList; +import gg.data.recruit.application.ApplicationAnswerText; import gg.data.recruit.application.RecruitStatus; +import gg.data.recruit.recruitment.CheckList; import gg.data.recruit.recruitment.Question; import gg.data.recruit.recruitment.Recruitments; import gg.data.recruit.recruitment.enums.InputType; import gg.data.user.User; +import gg.repo.recruit.user.application.ApplicationAnswerRepository; import gg.repo.recruit.user.application.ApplicationRepository; import gg.repo.recruit.user.application.RecruitStatusRepository; +import gg.repo.recruit.user.recruitment.CheckListRepository; import gg.repo.recruit.user.recruitment.QuestionRepository; import gg.repo.recruit.user.recruitment.RecruitmentRepository; import lombok.RequiredArgsConstructor; @@ -23,6 +30,8 @@ public class RecruitMockData { private final ApplicationRepository applicationRepository; private final QuestionRepository questionRepository; private final RecruitStatusRepository recruitStatusRepository; + private final CheckListRepository checkListRepository; + private final ApplicationAnswerRepository applicationAnswerRepository; public Recruitments createRecruitments() { Recruitments recruitments = new Recruitments("title", "contents", "generation", @@ -53,8 +62,35 @@ public Question createQuestion(Recruitments recruitments) { return questionRepository.save(question); } + public Question createQuestion(Recruitments recruitments, String question, + InputType inputType, String... checkList) { + Question questionEntity = new Question(recruitments, inputType, question, 1); + questionRepository.save(questionEntity); + for (String check : checkList) { + CheckList checkListEntity = new CheckList(questionEntity, check); + checkListRepository.save(checkListEntity); + } + return questionEntity; + } + public RecruitStatus createRecruitStatus(Application application) { RecruitStatus recruitStatus = new RecruitStatus(application); return recruitStatusRepository.save(recruitStatus); } + + public ApplicationAnswer makeAnswer(Application application, Question question, String content) { + ApplicationAnswer answer = new ApplicationAnswerText(application, question, content); + return applicationAnswerRepository.save(answer); + } + + public void makeAnswer(Application application, Question question, Long checkedId) { + CheckList checkList = checkListRepository.findById(checkedId) + .orElseThrow(() -> new IllegalArgumentException("์กด์žฌํ•˜์ง€ ์•Š๋Š” ์ฒดํฌ๋ฆฌ์ŠคํŠธ")); + ApplicationAnswer answer = new ApplicationAnswerCheckList(application, question, checkList); + applicationAnswerRepository.save(answer); + } + + public List getAllAnswers(Long userId, Long recruitId, Long applicationId) { + return applicationAnswerRepository.findAllAnswers(userId, recruitId, applicationId); + } } diff --git a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java index fc0b32fa5..448b64d67 100644 --- a/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java @@ -4,6 +4,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; import org.junit.jupiter.api.DisplayName; @@ -16,13 +18,19 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.data.recruit.application.Application; +import gg.data.recruit.application.ApplicationAnswer; import gg.data.recruit.application.enums.ApplicationStatus; import gg.data.recruit.recruitment.Question; import gg.data.recruit.recruitment.Recruitments; +import gg.data.recruit.recruitment.enums.InputType; import gg.data.user.User; import gg.recruit.api.user.RecruitMockData; +import gg.recruit.api.user.controller.request.CheckListFormRequest; +import gg.recruit.api.user.controller.request.FormPatchRequestDto; +import gg.recruit.api.user.controller.request.FormRequest; import gg.recruit.api.user.controller.request.RecruitApplyFormListReqDto; import gg.recruit.api.user.controller.request.RecruitApplyFormReqDto; +import gg.recruit.api.user.controller.request.TextFormRequest; import gg.recruit.api.user.controller.response.ApplicationResultResDto; import gg.recruit.api.user.controller.response.MyApplicationsResDto; import gg.utils.TestDataUtils; @@ -173,4 +181,51 @@ void deleteApplicationNotFoundTest() throws Exception { .header("Authorization", "Bearer " + accessToken)) .andExpect(status().isNotFound()); } + + @Test + @DisplayName("PATCH /recruitments/{recruitmentId}/applications/{applicationId} -> 204 NO_CONTENT TEST") + void patchApplicationTest() throws Exception { + //given + User user = testDataUtils.createNewUser(); + String accessToken = testDataUtils.getLoginAccessTokenFromUser(user); + Recruitments recruitments = recruitMockData.createRecruitments(); + Question question1 = recruitMockData.createQuestion(recruitments, "์งˆ๋ฌธ 1", InputType.TEXT); + Question question2 = recruitMockData.createQuestion(recruitments, "์งˆ๋ฌธ 2", InputType.SINGLE_CHECK, + "์„ ํƒ์ง€ 1", "์„ ํƒ์ง€ 2"); + + Application application = recruitMockData.createApplication(user, recruitments); + recruitMockData.makeAnswer(application, question1, "๋‹ต๋ณ€ 1"); + recruitMockData.makeAnswer(application, question2, question2.getCheckLists().get(0).getId()); + + //when + List forms = new ArrayList<>(); + String newAnswerText = "์ƒˆ๋กœ์šด ๋‹ต๋ณ€"; + FormRequest newTextForm = new TextFormRequest(question1.getId(), InputType.TEXT, newAnswerText); + forms.add(newTextForm); + FormRequest newCheckListForm = new CheckListFormRequest(question2.getId(), InputType.SINGLE_CHECK, + Collections.singletonList(question2.getCheckLists().get(1).getId())); + forms.add(newCheckListForm); + FormPatchRequestDto requestDto = new FormPatchRequestDto(forms); + String content = objectMapper.writeValueAsString(requestDto); + + String url = "/recruitments/" + recruitments.getId() + + "/applications/" + application.getId(); + mockMvc.perform(patch(url) + .header("Authorization", "Bearer " + accessToken) + .contentType("application/json") + .content(content)) + .andExpect(status().isNoContent()); + + //then + List allAnswers = recruitMockData.getAllAnswers(user.getId(), + recruitments.getId(), application.getId()); + assertEquals(2, allAnswers.size()); + allAnswers.stream().forEach(answer -> { + if (answer.getQuestionId().equals(question1.getId())) { + assertEquals(newAnswerText, answer.getAnswer()); + } else if (answer.getQuestionId().equals(question2.getId())) { + assertEquals(question2.getCheckLists().get(1).getContent(), answer.getAnswer()); + } + }); + } } diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java index 69768acf0..17cf2eb90 100644 --- a/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java +++ b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java @@ -3,6 +3,7 @@ import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; @@ -14,4 +15,14 @@ public interface ApplicationAnswerRepository extends JpaRepository findAllAnswers(@Param("userId") Long userId, @Param("recruitId") Long recruitId, @Param("applicationId") Long applicationId); + + @Query("SELECT a FROM ApplicationAnswer a WHERE a.application.user.id = :userId " + + "AND a.application.recruit.id = :recruitmentId " + + "AND a.application.id = :applicationId " + + "AND a.question.id IN :questionIds") + List findAllByQuestionIds( + @Param("userId") Long userId, + @Param("applicationId") Long applicationId, + @Param("recruitmentId") Long recruitmentId, + @Param("questionIds") List questionIds); } diff --git a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/CheckListRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/CheckListRepository.java index 41097f49a..8516c3bf1 100644 --- a/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/CheckListRepository.java +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/CheckListRepository.java @@ -4,10 +4,11 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import gg.data.recruit.recruitment.CheckList; public interface CheckListRepository extends JpaRepository { - @Query("SELECT c FROM CheckList c ") - List findAllByRecruitId(Long recruitId); + @Query("SELECT c FROM CheckList c WHERE c.question.id IN :questionIds") + List findAllByQuestionIds(@Param("questionIds") List questionIds); } From 307954ebcf1c12cd45d4ba27965bfaeff0e71f14 Mon Sep 17 00:00:00 2001 From: wken5577 Date: Sat, 23 Mar 2024 21:16:56 +0900 Subject: [PATCH 12/12] [FIX] compile --- .../api/admin/match/service/MatchAdminServiceTest.java | 6 +++--- .../admin/match/service/MatchAdminServiceUnitTest.java | 4 ++-- .../src/testFixtures/java/gg/utils/TestDataUtils.java | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/match/service/MatchAdminServiceTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/match/service/MatchAdminServiceTest.java index 61b2d0fad..3fa2745b9 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/match/service/MatchAdminServiceTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/match/service/MatchAdminServiceTest.java @@ -13,9 +13,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.MatchKey; -import gg.data.match.type.Option; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.MatchKey; +import gg.data.pingpong.match.type.Option; import gg.data.user.User; import gg.pingpong.api.admin.match.service.dto.MatchUser; import gg.pingpong.api.user.match.utils.MatchIntegrationTestUtils; diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/match/service/MatchAdminServiceUnitTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/match/service/MatchAdminServiceUnitTest.java index fe0c16b44..1dfc5b60e 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/match/service/MatchAdminServiceUnitTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/match/service/MatchAdminServiceUnitTest.java @@ -20,8 +20,8 @@ import gg.admin.repo.match.RedisMatchTimeAdminRepository; import gg.admin.repo.user.UserAdminRepository; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.Option; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.Option; import gg.data.user.User; import gg.pingpong.api.admin.match.service.dto.MatchUser; import gg.utils.annotation.UnitTest; diff --git a/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java b/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java index 6052231d5..6a12cd174 100644 --- a/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java +++ b/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java @@ -13,6 +13,11 @@ import gg.data.manage.Announcement; import gg.data.noti.Noti; import gg.data.noti.type.NotiType; +import gg.data.party.Category; +import gg.data.party.PartyPenalty; +import gg.data.party.Room; +import gg.data.party.UserRoom; +import gg.data.party.type.RoomType; import gg.data.pingpong.game.Game; import gg.data.pingpong.game.PChange; import gg.data.pingpong.game.Team; @@ -31,11 +36,6 @@ import gg.data.pingpong.tournament.type.TournamentRound; import gg.data.pingpong.tournament.type.TournamentStatus; import gg.data.pingpong.tournament.type.TournamentType; -import gg.data.party.Category; -import gg.data.party.PartyPenalty; -import gg.data.party.Room; -import gg.data.party.UserRoom; -import gg.data.party.type.RoomType; import gg.data.user.User; import gg.data.user.UserImage; import gg.data.user.type.RacketType;