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/.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/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-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 0a90712bf..fdfe0bdb8 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 a28835aa4..afb3d4b98 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/match/RedisMatchTimeAdminRepository.java b/gg-admin-repo/src/main/java/gg/admin/repo/match/RedisMatchTimeAdminRepository.java index 781f5f59a..632ce95f3 100644 --- a/gg-admin-repo/src/main/java/gg/admin/repo/match/RedisMatchTimeAdminRepository.java +++ b/gg-admin-repo/src/main/java/gg/admin/repo/match/RedisMatchTimeAdminRepository.java @@ -9,8 +9,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-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/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..eb7b50247 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/Application.java @@ -0,0 +1,63 @@ +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.Getter; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +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 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; + } + + 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/application/ApplicationAnswer.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java new file mode 100644 index 000000000..40f0613fe --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java @@ -0,0 +1,55 @@ +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) +@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 question; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "application_id", nullable = false) + @Getter + private Application application; + + public InputType getInputType() { + return question.getInputType(); + } + + public Long getQuestionId() { + return question.getId(); + } + + public abstract String getAnswer(); + + 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 new file mode 100644 index 000000000..9c81b1d3e --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java @@ -0,0 +1,42 @@ +package gg.data.recruit.application; + +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +import gg.data.recruit.recruitment.CheckList; +import gg.data.recruit.recruitment.Question; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED) +@DiscriminatorValue("CHECK_LIST") +public class ApplicationAnswerCheckList extends ApplicationAnswer { + + @Id + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @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(), + 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/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 new file mode 100644 index 000000000..55ce791a1 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java @@ -0,0 +1,36 @@ +package gg.data.recruit.application; + +import javax.persistence.Column; +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import javax.persistence.Id; + +import gg.data.recruit.recruitment.Question; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = lombok.AccessLevel.PROTECTED) +@DiscriminatorValue("TEXT") +public class ApplicationAnswerText extends ApplicationAnswer { + + @Id + private Long id; + + @Column(length = 1000) + private String answer; + + @Override + public String getAnswer() { + return answer; + } + + @Override + 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/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/application/RecruitStatus.java b/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java new file mode 100644 index 000000000..6ab7e2aff --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java @@ -0,0 +1,36 @@ +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.Getter; +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 application; + + @Getter + private LocalDateTime interviewDate; + + public RecruitStatus(Application application) { + this.application = application; + } +} 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..74dadd719 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java @@ -0,0 +1,38 @@ +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.Getter; +import lombok.NoArgsConstructor; + +@Entity +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Getter +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 question; + + @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 new file mode 100644 index 000000000..f608a5143 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java @@ -0,0 +1,59 @@ +package gg.data.recruit.recruitment; + +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +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 javax.persistence.OneToMany; + +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 + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "recruit_id", nullable = false) + private Recruitments recruit; + + @Enumerated(EnumType.STRING) + @Column(length = 20, nullable = false) + private InputType inputType; + + @Column(length = 300) + private String question; + + @OneToMany(mappedBy = "question", cascade = CascadeType.ALL) + private List checkLists = new ArrayList<>(); + + 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; + } + + protected void addCheckList(CheckList checkList) { + this.checkLists.add(checkList); + } +} 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..e08807138 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java @@ -0,0 +1,59 @@ +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.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@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; + + 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; + } + + public void del() { + this.isDeleted = true; + } + + public Boolean isEnd() { + return LocalDateTime.now().isAfter(this.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..fde979896 --- /dev/null +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/enums/InputType.java @@ -0,0 +1,13 @@ +package gg.data.recruit.recruitment.enums; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public enum InputType { + + TEXT("text", "ํ…์ŠคํŠธ"), + SINGLE_CHECK("single_check", "์‹ฑ๊ธ€ ์ฒดํฌ๋ฆฌ์ŠคํŠธ"), + MULTI_CHECK("multi_check", "๋ฉ€ํ‹ฐ ์ฒดํฌ๋ฆฌ์ŠคํŠธ"); + 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/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/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/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/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/game/service/GameAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/game/service/GameAdminService.java index cc99aeee7..39951ffff 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/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/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/match/controller/MatchAdminController.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/controller/MatchAdminController.java index bcbbd7b4b..93e294f25 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/controller/MatchAdminController.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/controller/MatchAdminController.java @@ -12,7 +12,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.admin.match.controller.response.EnrolledMatchesResponseDto; import gg.pingpong.api.admin.match.service.MatchAdminService; import gg.pingpong.api.admin.match.service.dto.MatchUser; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/service/MatchAdminService.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/service/MatchAdminService.java index 4ee5251d1..f6c3239ae 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/service/MatchAdminService.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/service/MatchAdminService.java @@ -11,9 +11,9 @@ import gg.admin.repo.manage.AdminSlotManagementsRepository; import gg.admin.repo.match.RedisMatchTimeAdminRepository; import gg.admin.repo.user.UserAdminRepository; -import gg.data.manage.SlotManagement; -import gg.data.match.RedisMatchUser; -import gg.data.match.type.Option; +import gg.data.pingpong.manage.SlotManagement; +import gg.data.pingpong.match.RedisMatchUser; +import gg.data.pingpong.match.type.Option; import gg.pingpong.api.admin.match.service.dto.MatchUser; import gg.utils.exception.match.SlotNotFoundException; import gg.utils.exception.user.UserNotFoundException; diff --git a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/service/dto/MatchUser.java b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/service/dto/MatchUser.java index 563522334..d52ccd844 100644 --- a/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/service/dto/MatchUser.java +++ b/gg-pingpong-api/src/main/java/gg/pingpong/api/admin/match/service/dto/MatchUser.java @@ -1,7 +1,7 @@ package gg.pingpong.api.admin.match.service.dto; -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 lombok.AccessLevel; import lombok.Builder; import lombok.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/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/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/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/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/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 d1fae17d5..b03e80b42 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 @@ -8,7 +8,7 @@ import gg.admin.repo.store.CoinPolicyAdminRepository; import gg.admin.repo.user.UserAdminRepository; import gg.auth.UserDto; -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 d86a916f7..4fa42f0e6 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 @@ -10,7 +10,7 @@ import gg.admin.repo.store.ItemAdminRepository; import gg.auth.UserDto; -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/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/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/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 { 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/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 2eed60354..74543d8d8 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 @@ -18,7 +18,7 @@ import gg.auth.UserDto; import gg.auth.argumentresolver.Login; -import gg.data.game.type.Mode; +import gg.data.pingpong.game.type.Mode; import gg.pingpong.api.user.game.controller.request.GameListReqDto; import gg.pingpong.api.user.game.controller.request.NormalGameListReqDto; import gg.pingpong.api.user.game.controller.request.NormalResultReqDto; 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/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/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 e6a4fc1c6..64f2eae70 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 @@ -17,7 +17,7 @@ import gg.auth.UserDto; import gg.auth.argumentresolver.Login; -import gg.data.match.type.Option; +import gg.data.pingpong.match.type.Option; import gg.pingpong.api.user.match.controller.request.MatchRequestDto; import gg.pingpong.api.user.match.controller.response.MatchStatusResponseListDto; import gg.pingpong.api.user.match.controller.response.SlotStatusResponseListDto; 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 82a2ca8ec..a42deb0c9 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 @@ -6,11 +6,11 @@ import org.springframework.stereotype.Service; import gg.auth.UserDto; -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 d490b063b..1a5d9f4af 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 @@ -11,15 +11,15 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.UserDto; -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 6d2ffaf07..5dbd3c9c8 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 @@ -10,16 +10,16 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.UserDto; -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/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/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 25da63494..82e31ba3b 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 @@ -12,8 +12,8 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.UserDto; -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/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/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 edd733c25..a63463d63 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 @@ -10,10 +10,10 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.UserDto; -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 0c9450f11..0449a70ea 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 @@ -10,11 +10,11 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.UserDto; -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..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 @@ -1,8 +1,8 @@ package gg.pingpong.api.user.tournament.controller.request; -import gg.data.tournament.type.TournamentStatus; -import gg.data.tournament.type.TournamentType; -import gg.pingpong.api.global.dto.PageRequestDto; +import gg.data.pingpong.tournament.type.TournamentStatus; +import gg.data.pingpong.tournament.type.TournamentType; +import gg.utils.dto.PageRequestDto; import lombok.Getter; @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 ca924417b..4d71e4f2e 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 @@ -16,14 +16,14 @@ import gg.auth.UserDto; 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 0cbb1a6fd..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 @@ -28,10 +28,9 @@ import gg.auth.UserDto; import gg.auth.argumentresolver.Login; -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; 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/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 eb51ce05f..0303d0b7a 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 @@ -17,16 +17,16 @@ import org.springframework.web.multipart.MultipartFile; import gg.auth.UserDto; -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..9a5fc3359 --- /dev/null +++ b/gg-pingpong-api/src/main/resources/db/migration/V2__recruit.sql @@ -0,0 +1,105 @@ +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 , + `answer_type` varchar(20) 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, + `check_list_id` bigint NOT NULL, + KEY `FKqdnt92yg8t27q74he0ersyiax` (`id`), + KEY `FK3mf6hfr08f2ex01aqejikxk9w` (`check_list_id`), + CONSTRAINT `FK3mf6hfr08f2ex01aqejikxk9w` FOREIGN KEY (`check_list_id`) REFERENCES `check_list` (`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 , + `answer` varchar(1000) DEFAULT NULL, + KEY `FKlhk4m3hi4r3v8xqk8lx4bx5g7` (`id`), + CONSTRAINT `FKlhk4m3hi4r3v8xqk8lx4bx5g7` FOREIGN KEY (`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/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-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 243ecb2b8..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 @@ -19,7 +19,7 @@ import gg.admin.repo.store.CoinPolicyAdminRepository; import gg.auth.utils.AuthTokenProvider; -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; @@ -35,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-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 ccfff6fdc..57e53a5b4 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 @@ -26,10 +26,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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; @@ -54,122 +54,32 @@ class GameAdminControllerTest { @Autowired TestDataUtils testDataUtils; - - @Autowired - private MockMvc mockMvc; - @Autowired ObjectMapper objectMapper; - @Autowired AuthTokenProvider tokenProvider; - @Autowired GameRepository gameRepository; - @Autowired UserRepository userRepository; - @Autowired GameUpdateService gameUpdateService; - @Autowired GameService gameService; - @Autowired RankRepository rankRepository; - @Autowired RankRedisRepository rankRedisRepository; @Autowired EntityManager entityManager; + @Autowired + private MockMvc mockMvc; @AfterEach void redisDown() { rankRedisRepository.deleteAll(); } - @Nested - @DisplayName("[GET] /pingpong/admin/games/users?intraId=${intraId}&page=${pageNumber}&size={sizeNum}") - class GetUserGameList { - String accessToken; - Long userId; - User user; - Season season; - - static final int TOTAL_PAGE_SIZE = 18; - static final int TOURNAMENT_GAME_SIZE = 4; - static final String INTRA_ID = "nheo"; - - @BeforeEach - void setUp() { - accessToken = testDataUtils.getAdminLoginAccessToken(); - userId = tokenProvider.getUserIdFromAccessToken(accessToken); - user = testDataUtils.createNewUser(INTRA_ID); - season = testDataUtils.createSeason(); - testDataUtils.createUserRank(user, "status message", season); - for (int i = 0; i < TOTAL_PAGE_SIZE; i++) { - testDataUtils.createMockMatchWithMockRank(user, season, LocalDateTime.now().minusMinutes(20 + i * 15), - LocalDateTime.now().minusMinutes(5 + i * 15)); - } - for (int i = TOTAL_PAGE_SIZE; i < TOTAL_PAGE_SIZE + TOURNAMENT_GAME_SIZE; i++) { - testDataUtils.createMockMatch(testDataUtils.createNewUser("testUser" + i), season, - LocalDateTime.now().minusMinutes(20 + i * 15), LocalDateTime.now().minusMinutes(5 + i * 15), - Mode.TOURNAMENT); - } - } - - private GameLogListAdminResponseDto getPageResult(int currentPage, int pageSize) - throws Exception { - String url = "/pingpong/admin/games/users?intraId=" - + INTRA_ID + "&page=" + currentPage + "&size=" + pageSize; - - String contentAsString = mockMvc - .perform(get(url) - .header(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken)) - .andExpect(status().isOk()) - .andReturn().getResponse().getContentAsString(); - - return objectMapper.readValue(contentAsString, GameLogListAdminResponseDto.class); - } - - @Test - @Transactional - @DisplayName("First page") - void getUserGameListFirstPage() throws Exception { - //given - int pageSize = 5; - //when - GameLogListAdminResponseDto result = getPageResult(1, pageSize); - //then - assertThat(result.getGameLogList().size()).isEqualTo(pageSize); - } - - @Test - @Transactional - @DisplayName("Middle page") - void getUserGameListMidPage() throws Exception { - //given - int pageSize = 5; - //when - GameLogListAdminResponseDto result = getPageResult(2, pageSize); - //then - assertThat(result.getGameLogList().size()).isEqualTo(pageSize); - } - - @Test - @Transactional - @DisplayName("End page") - void getUserGameListEndPage() throws Exception { - //given - int pageSize = 5; - //when - GameLogListAdminResponseDto result = getPageResult(4, pageSize); - //then - assertThat(result.getGameLogList().size()).isEqualTo(TOTAL_PAGE_SIZE % pageSize); - } - } - @Test @DisplayName("[PUT] /pingpong/admin/games ๊ด€๋ฆฌ์ž๊ฒŒ์ž„์ „์ ์ˆ˜์ •ํ…Œ์ŠคํŠธ") @Transactional @@ -281,4 +191,84 @@ public void admingamestatUpdate() throws Exception { assertThat(enemyUser2Rank.getLosses()).isEqualTo(1); // assertThat(enemyUser2Rank.getPpp()).isEqualTo() } + + @Nested + @DisplayName("[GET] /pingpong/admin/games/users?intraId=${intraId}&page=${pageNumber}&size={sizeNum}") + class GetUserGameList { + static final int TOTAL_PAGE_SIZE = 18; + static final int TOURNAMENT_GAME_SIZE = 4; + static final String INTRA_ID = "nheo"; + String accessToken; + Long userId; + User user; + Season season; + + @BeforeEach + void setUp() { + accessToken = testDataUtils.getAdminLoginAccessToken(); + userId = tokenProvider.getUserIdFromAccessToken(accessToken); + user = testDataUtils.createNewUser(INTRA_ID); + season = testDataUtils.createSeason(); + testDataUtils.createUserRank(user, "status message", season); + for (int i = 0; i < TOTAL_PAGE_SIZE; i++) { + testDataUtils.createMockMatchWithMockRank(user, season, LocalDateTime.now().minusMinutes(20 + i * 15), + LocalDateTime.now().minusMinutes(5 + i * 15)); + } + for (int i = TOTAL_PAGE_SIZE; i < TOTAL_PAGE_SIZE + TOURNAMENT_GAME_SIZE; i++) { + testDataUtils.createMockMatch(testDataUtils.createNewUser("testUser" + i), season, + LocalDateTime.now().minusMinutes(20 + i * 15), LocalDateTime.now().minusMinutes(5 + i * 15), + Mode.TOURNAMENT); + } + } + + private GameLogListAdminResponseDto getPageResult(int currentPage, int pageSize) + throws Exception { + String url = "/pingpong/admin/games/users?intraId=" + + INTRA_ID + "&page=" + currentPage + "&size=" + pageSize; + + String contentAsString = mockMvc + .perform(get(url) + .header(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken)) + .andExpect(status().isOk()) + .andReturn().getResponse().getContentAsString(); + + return objectMapper.readValue(contentAsString, GameLogListAdminResponseDto.class); + } + + @Test + @Transactional + @DisplayName("First page") + void getUserGameListFirstPage() throws Exception { + //given + int pageSize = 5; + //when + GameLogListAdminResponseDto result = getPageResult(1, pageSize); + //then + assertThat(result.getGameLogList().size()).isEqualTo(pageSize); + } + + @Test + @Transactional + @DisplayName("Middle page") + void getUserGameListMidPage() throws Exception { + //given + int pageSize = 5; + //when + GameLogListAdminResponseDto result = getPageResult(2, pageSize); + //then + assertThat(result.getGameLogList().size()).isEqualTo(pageSize); + } + + @Test + @Transactional + @DisplayName("End page") + void getUserGameListEndPage() throws Exception { + //given + int pageSize = 5; + //when + GameLogListAdminResponseDto result = getPageResult(4, pageSize); + //then + assertThat(result.getGameLogList().size()).isEqualTo(TOTAL_PAGE_SIZE % pageSize); + } + } } 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 1b0016ac2..eaefbf250 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 @@ -26,8 +26,8 @@ import gg.admin.repo.store.ItemAdminRepository; import gg.auth.utils.AuthTokenProvider; -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 bf9041e63..b520c6f5b 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 @@ -22,7 +22,7 @@ import gg.admin.repo.store.ItemAdminRepository; import gg.auth.UserDto; -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/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-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 7cc97f041..02efd5849 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 @@ -20,8 +20,8 @@ import gg.admin.repo.store.ReceiptAdminRepository; import gg.auth.utils.AuthTokenProvider; -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 6eef3fec4..86dc08f88 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 @@ -21,8 +21,8 @@ import gg.admin.repo.season.SeasonAdminRepository; import gg.auth.utils.AuthTokenProvider; -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; @@ -50,33 +50,24 @@ class SeasonAdminControllerTest { @Autowired ObjectMapper objectMapper; - - @Autowired - private SeasonAdminRepository seasonAdminRepository; - @Autowired AuthTokenProvider tokenProvider; - @Autowired TestDataUtils testDataUtils; - @Autowired RankRepository rankRepository; - @Autowired RankRedisRepository rankRedisRepository; - @Autowired SeasonAdminService seasonAdminService; - @Autowired RankAdminService rankAdminService; - @Autowired RankRedisAdminService rankRedisAdminService; - SeasonListAdminResponseDto responseDto; Long dbSeasonId; + @Autowired + private SeasonAdminRepository seasonAdminRepository; @AfterEach void tearDown() { 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 a76eaba89..406cd80ad 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 @@ -19,7 +19,7 @@ import gg.admin.repo.manage.AdminSlotManagementsRepository; import gg.auth.utils.AuthTokenProvider; -import gg.data.manage.SlotManagement; +import gg.data.pingpong.manage.SlotManagement; import gg.pingpong.api.admin.manage.controller.request.SlotCreateRequestDto; import gg.repo.manage.SlotManagementRepository; import gg.utils.TestDataUtils; @@ -33,21 +33,16 @@ public class SlotAdminControllerFailTest { @Autowired TestDataUtils testDataUtils; - - @Autowired - private MockMvc mockMvc; - @Autowired ObjectMapper objectMapper; - @Autowired AuthTokenProvider tokenProvider; - @Autowired AdminSlotManagementsRepository adminSlotManagementRepository; - @Autowired SlotManagementRepository slotManagementRepository; + @Autowired + private MockMvc mockMvc; @Test @DisplayName("fail[Post]/pingpong/admin/slot-management") 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 fca73ff02..1c1094393 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 @@ -20,7 +20,7 @@ import gg.admin.repo.manage.AdminSlotManagementsRepository; import gg.auth.utils.AuthTokenProvider; -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; @@ -36,21 +36,16 @@ class SlotAdminControllerTest { @Autowired TestDataUtils testDataUtils; - - @Autowired - private MockMvc mockMvc; - @Autowired ObjectMapper objectMapper; - @Autowired AuthTokenProvider tokenProvider; - @Autowired AdminSlotManagementsRepository adminSlotManagementRepository; - @Autowired SlotManagementRepository slotManagementRepository; + @Autowired + private MockMvc mockMvc; @BeforeEach void setUp() { 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 c3ef6dc5c..6666fa2df 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 @@ -22,14 +22,14 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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; @@ -899,10 +899,10 @@ void userNotFound() throws Exception { @Nested @DisplayName("[Patch] /pingpong/admin/tournaments/{tournamentId}/games") class AdminUpdateTournamentGameTest { + Season season; private String accessToken; private Tournament tournament; private List allTournamentGames; - Season season; @BeforeEach void setUp() { 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 64cb3601b..fe293e8ff 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 @@ -17,7 +17,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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; @@ -33,6 +33,8 @@ @Slf4j public class TournamentAdminUserControllerTest { + final int joinUserCnt = 8; + final int notJoinUserCnt = 4; @Autowired MockMvc mockMvc; @Autowired @@ -41,10 +43,7 @@ public class TournamentAdminUserControllerTest { ObjectMapper objectMapper; @Autowired AuthTokenProvider tokenProvider; - String accessToken; - final int joinUserCnt = 8; - final int notJoinUserCnt = 4; String testName = "42_gg_tester_"; Tournament tournament; String adminUrl = "/pingpong/admin/tournaments/"; 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 3ef8eb665..7a4893131 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 @@ -11,8 +11,8 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.utils.AuthTokenProvider; -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.user.store.service.CoinHistoryService; import gg.repo.store.CoinHistoryRepository; 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 cda866e20..4b5cd8551 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 @@ -11,12 +11,12 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.utils.AuthTokenProvider; -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.user.store.dto.UserGameCoinResultDto; import gg.pingpong.api.user.store.service.CoinHistoryService; 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 88feebf15..bb4542ff0 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 @@ -26,18 +26,18 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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; @@ -97,11 +97,12 @@ public class GameControllerTest { @Autowired GameFindService gameFindService; @Autowired - private MockMvc mockMvc; - @Autowired ObjectMapper objectMapper; @Autowired AuthTokenProvider tokenProvider; + ArrayList tiers; + @Autowired + private MockMvc mockMvc; private String accessToken; private Season season; private User user1; @@ -109,7 +110,6 @@ public class GameControllerTest { private User user3; private Game game1; private Game game2; - ArrayList tiers; @BeforeEach void init() { 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 3b0f3e0b8..817d29b9e 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 @@ -18,11 +18,11 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.utils.AuthTokenProvider; -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.repo.game.GameRepository; 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 4c725dedc..5c5c8ab3a 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 @@ -17,12 +17,12 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.utils.AuthTokenProvider; -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.user.game.controller.response.GameListResDto; import gg.pingpong.api.user.game.controller.response.GameResultResDto; 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 4f77b2a9c..e9fed2e93 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 @@ -11,15 +11,15 @@ import org.springframework.transaction.annotation.Transactional; import gg.auth.utils.AuthTokenProvider; -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.user.game.controller.request.RankResultReqDto; import gg.repo.game.GameRepository; 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 163dd489a..df5164a5b 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 f13ebd4cc..6e2d148db 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 @@ -21,10 +21,10 @@ import org.springframework.data.domain.Pageable; import gg.auth.UserDto; -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 b5bcd42b9..59bb459fd 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 @@ -20,11 +20,11 @@ import gg.admin.repo.manage.PenaltyAdminRepository; import gg.auth.UserDto; -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 6dcce6d48..38d7504f4 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 @@ -22,14 +22,14 @@ import org.mockito.junit.jupiter.MockitoExtension; import gg.auth.UserDto; -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; @@ -46,6 +46,15 @@ @UnitTest @ExtendWith(MockitoExtension.class) public class MatchFindServiceUnitTest { + private static final SlotManagement slotManagement = SlotManagement.builder() + .pastSlotTime(0) + .futureSlotTime(12) + .openMinute(5) + .gameInterval(15) + .startTime(LocalDateTime.now()) + .build(); + private static final Season season = Season.builder().startTime(LocalDateTime.now()).startPpp(123).build(); + private static final Tier tier = new Tier(); @InjectMocks MatchFindService matchFindService; @Mock @@ -65,16 +74,6 @@ public class MatchFindServiceUnitTest { @Mock private TierRepository tierRepository; - private static final SlotManagement slotManagement = SlotManagement.builder() - .pastSlotTime(0) - .futureSlotTime(12) - .openMinute(5) - .gameInterval(15) - .startTime(LocalDateTime.now()) - .build(); - private static final Season season = Season.builder().startTime(LocalDateTime.now()).startPpp(123).build(); - private static final Tier tier = new Tier(); - @BeforeEach public void init() { setFieldWithReflection(slotManagement, "id", 1L); 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 c017f78be..45aee4440 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 @@ -24,22 +24,22 @@ import gg.admin.repo.manage.PenaltyAdminRepository; import gg.auth.UserDto; -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 86d5b2621..d243ebfc3 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 @@ -18,11 +18,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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; @@ -42,24 +42,18 @@ class MegaphoneControllerTest { @Autowired TestDataUtils testDataUtils; - - @Autowired - private MockMvc mockMvc; - @Autowired ObjectMapper objectMapper; - @Autowired AuthTokenProvider tokenProvider; - @Autowired MegaphoneRepository megaphoneRepository; - @Autowired ReceiptRepository receiptRepository; - @Autowired ItemTestUtils itemTestUtils; + @Autowired + private MockMvc mockMvc; @Test @Transactional 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 305d43fe1..7be892d2c 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 @@ -23,11 +23,11 @@ import org.mockito.junit.jupiter.MockitoExtension; import gg.auth.UserDto; -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 4184dbe88..c439a99e7 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 @@ -20,7 +20,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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/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 fc3ab3884..3edd4295d 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 @@ -18,7 +18,7 @@ import org.springframework.data.domain.PageRequest; import gg.auth.UserDto; -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; @@ -42,41 +42,6 @@ class RankServiceTest { @InjectMocks private RankService rankService; - @BeforeEach - void setUp() { - // ํ˜„์žฌ ์‹œ์ฆŒ ๊ฐ€์ ธ์˜ค๊ธฐ - given(seasonFindService.findCurrentSeason(any())) - .willReturn(Season.builder() - .seasonName("Test Season") - .build()); - } - - @AfterEach - void tearDown() { - } - - @Test - void getExpRankPage() { - PageRequest pageRequest = PageRequest.of(0, 10); - // exp ranking user list, total page size ์กฐํšŒ - given(userRepository.findAllByTotalExpGreaterThan(pageRequest, 0)) - .willReturn(new PageImpl<>(new ArrayList(), pageRequest, 1)); - - // exp ranking list ์กฐํšŒ - List expRankV2DtoList = expRankingSampleData(); - given(userRepository.findExpRank(pageRequest.getPageNumber(), pageRequest.getPageSize(), - null)) - .willReturn(expRankV2DtoList); - ExpRankPageResponseDto testRes = rankService.getExpRankPage(pageRequest, UserDto - .builder() - .intraId("TestUser") - .id(1L) - .totalExp(0) - .build()); - assertThat(testRes.getMyRank()).isEqualTo(-1); - assertThat(testRes.getRankList().get(0).getIntraId()).isEqualTo("Test User"); - } - private static List expRankingSampleData() { List expRankV2Dtos = new ArrayList<>(); expRankV2Dtos.add(new ExpRankV2Dto() { @@ -113,31 +78,6 @@ public Integer getRanking() { return expRankV2Dtos; } - @Test - void getRankPageV2() { - PageRequest pageRequest = PageRequest.of(0, 10); - // ํ˜„์žฌ ์‹œ์ฆŒ id ์— ํ•ด๋‹นํ•˜๋Š” ๋žญํฌ ์œ ์ € ๋ฆฌ์ŠคํŠธ์˜ ํŽ˜์ด์ง€ ์ˆ˜ - given(rankRepository.countRankUserBySeasonId(any())) - .willReturn(1); - // ํ˜„์žฌ ์œ ์ € ranking - given(rankRepository.findRankByUserIdAndSeasonId(any(), any())) - .willReturn(Optional.of(1)); - // sample data - List rankV2DtoList = pppRankingSampleData(); - given(rankRepository.findPppRankBySeasonId(anyInt(), anyInt(), any())) - .willReturn(rankV2DtoList); - RankPageResponseDto result = rankService.getRankPageV2(pageRequest, - UserDto - .builder() - .intraId("TestUser") - .id(1L) - .totalExp(0) - .build(), - any()); - assertThat(result.getCurrentPage()).isEqualTo(pageRequest.getPageNumber() + 1); - assertThat(result.getRankList().size()).isEqualTo(rankV2DtoList.size()); - } - private static List pppRankingSampleData() { List rankV2DtoList = new ArrayList<>(); rankV2DtoList.add(new RankV2Dto() { @@ -173,4 +113,64 @@ public Integer getRanking() { }); return rankV2DtoList; } + + @BeforeEach + void setUp() { + // ํ˜„์žฌ ์‹œ์ฆŒ ๊ฐ€์ ธ์˜ค๊ธฐ + given(seasonFindService.findCurrentSeason(any())) + .willReturn(Season.builder() + .seasonName("Test Season") + .build()); + } + + @AfterEach + void tearDown() { + } + + @Test + void getExpRankPage() { + PageRequest pageRequest = PageRequest.of(0, 10); + // exp ranking user list, total page size ์กฐํšŒ + given(userRepository.findAllByTotalExpGreaterThan(pageRequest, 0)) + .willReturn(new PageImpl<>(new ArrayList(), pageRequest, 1)); + + // exp ranking list ์กฐํšŒ + List expRankV2DtoList = expRankingSampleData(); + given(userRepository.findExpRank(pageRequest.getPageNumber(), pageRequest.getPageSize(), + null)) + .willReturn(expRankV2DtoList); + ExpRankPageResponseDto testRes = rankService.getExpRankPage(pageRequest, UserDto + .builder() + .intraId("TestUser") + .id(1L) + .totalExp(0) + .build()); + assertThat(testRes.getMyRank()).isEqualTo(-1); + assertThat(testRes.getRankList().get(0).getIntraId()).isEqualTo("Test User"); + } + + @Test + void getRankPageV2() { + PageRequest pageRequest = PageRequest.of(0, 10); + // ํ˜„์žฌ ์‹œ์ฆŒ id ์— ํ•ด๋‹นํ•˜๋Š” ๋žญํฌ ์œ ์ € ๋ฆฌ์ŠคํŠธ์˜ ํŽ˜์ด์ง€ ์ˆ˜ + given(rankRepository.countRankUserBySeasonId(any())) + .willReturn(1); + // ํ˜„์žฌ ์œ ์ € ranking + given(rankRepository.findRankByUserIdAndSeasonId(any(), any())) + .willReturn(Optional.of(1)); + // sample data + List rankV2DtoList = pppRankingSampleData(); + given(rankRepository.findPppRankBySeasonId(anyInt(), anyInt(), any())) + .willReturn(rankV2DtoList); + RankPageResponseDto result = rankService.getRankPageV2(pageRequest, + UserDto + .builder() + .intraId("TestUser") + .id(1L) + .totalExp(0) + .build(), + any()); + assertThat(result.getCurrentPage()).isEqualTo(pageRequest.getPageNumber() + 1); + assertThat(result.getRankList().size()).isEqualTo(rankV2DtoList.size()); + } } 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 7cf130d07..9d6634787 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 @@ -19,7 +19,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -import gg.data.season.Season; +import gg.data.pingpong.season.Season; import gg.pingpong.api.user.season.controller.response.SeasonListResDto; import gg.pingpong.api.user.season.controller.response.SeasonResDto; import gg.pingpong.api.user.season.service.SeasonService; @@ -36,14 +36,13 @@ public class SeasonTestController { @Autowired MockMvc mvc; @Autowired - private SeasonService seasonService; - @Autowired TestDataUtils testDataUtils; @Autowired AuthTokenProvider tokenProvider; @Autowired ObjectMapper objectMapper; - + @Autowired + private SeasonService seasonService; @Autowired private SeasonRepository seasonRepository; 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 b512dd3c2..e059b8c16 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 @@ -17,8 +17,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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.repo.season.SeasonRepository; import gg.utils.TestDataUtils; import gg.utils.annotation.IntegrationTest; 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 18a222941..088da5551 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 @@ -21,10 +21,10 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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 f871c55d7..9e749bb8f 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 @@ -19,12 +19,12 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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 9cf4c8d46..9eda15bf6 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 @@ -25,15 +25,15 @@ import org.springframework.data.domain.Pageable; import gg.auth.UserDto; -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; @@ -76,6 +76,36 @@ class TournamentServiceUnitTest { @InjectMocks TournamentService tournamentService; + private Tournament createTournament(Long id, TournamentStatus status, LocalDateTime startTime, + LocalDateTime endTime) { + Tournament tournament = Tournament.builder() + .title(id + "st tournament") + .contents("") + .startTime(startTime) + .endTime(endTime) + .type(TournamentType.ROOKIE) + .status(status) + .build(); + ReflectionUtilsForUnitTest.setFieldWithReflection(tournament, "id", id); + return tournament; + } + + /** + * ์œ ์ € ์ƒ์„ฑ ๋งค์„œ๋“œ - intraId๋กœ๋งŒ ์ดˆ๊ธฐํ™” + * @param intraId + * @return + */ + private User createUser(String intraId) { + return User.builder() + .eMail("email") + .intraId(intraId) + .racketType(RacketType.PENHOLDER) + .snsNotiOpt(SnsType.NONE) + .roleType(RoleType.USER) + .totalExp(1000) + .build(); + } + @Nested @DisplayName("getAllTournamentList") class GetAllTournamentList { @@ -585,34 +615,4 @@ void tournamentGameAndGameExist() { verify(gameRepository, times(7)).findTeamsByGameId(any(Long.class)); } } - - private Tournament createTournament(Long id, TournamentStatus status, LocalDateTime startTime, - LocalDateTime endTime) { - Tournament tournament = Tournament.builder() - .title(id + "st tournament") - .contents("") - .startTime(startTime) - .endTime(endTime) - .type(TournamentType.ROOKIE) - .status(status) - .build(); - ReflectionUtilsForUnitTest.setFieldWithReflection(tournament, "id", id); - return tournament; - } - - /** - * ์œ ์ € ์ƒ์„ฑ ๋งค์„œ๋“œ - intraId๋กœ๋งŒ ์ดˆ๊ธฐํ™” - * @param intraId - * @return - */ - private User createUser(String intraId) { - return User.builder() - .eMail("email") - .intraId(intraId) - .racketType(RacketType.PENHOLDER) - .snsNotiOpt(SnsType.NONE) - .roleType(RoleType.USER) - .totalExp(1000) - .build(); - } } 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 9d57c29c2..38d9abf55 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 @@ -28,17 +28,17 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.auth.utils.AuthTokenProvider; -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; @@ -87,46 +87,30 @@ class UserControllerTest { @Autowired TestDataUtils testDataUtils; - - @Autowired - private MockMvc mockMvc; - @Autowired ObjectMapper objectMapper; - @Autowired AuthTokenProvider tokenProvider; - @Autowired UserRepository userRepository; - @Autowired RankRedisRepository redisRepository; - @Autowired TierRepository tierRepository; - @Autowired RankRepository rankRepository; - @Autowired SeasonRepository seasonRepository; - @Autowired GameRepository gameRepository; - @Autowired GameService gameService; - @Autowired CoinPolicyRepository coinPolicyRepository; - @Autowired CoinHistoryRepository coinHistoryRepository; - @Autowired ReceiptRepository receiptRepository; - @Autowired CoinHistoryService coinHistoryService; @Autowired @@ -134,6 +118,8 @@ class UserControllerTest { @MockBean UserImageHandler userImageHandler; User admin; + @Autowired + private MockMvc mockMvc; @BeforeEach public void setUp() { diff --git a/gg-recruit-api/build.gradle b/gg-recruit-api/build.gradle new file mode 100644 index 000000000..4f8e11d62 --- /dev/null +++ b/gg-recruit-api/build.gradle @@ -0,0 +1,29 @@ +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.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/user/controller/ApplicationController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java new file mode 100644 index 000000000..0338260d4 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/ApplicationController.java @@ -0,0 +1,93 @@ +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.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; +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.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; +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.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; +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; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/recruitments") +public class ApplicationController { + + private final ApplicationService applicationService; + + @GetMapping("/applications") + public MyApplicationsResDto getMyApplications(@Login UserDto userDto) { + ApplicationListSvcDto res = applicationService.findMyApplications(userDto.getId()); + return new MyApplicationsResDto(res); + } + + @GetMapping("{recruitmentId}/applications/{applicationId}") + public MyApplicationDetailResDto getMyApplication(@Login @Parameter(hidden = true) UserDto userDto, + @PathVariable Long recruitmentId, @PathVariable Long applicationId) { + ApplicationWithAnswerSvcDto res = applicationService + .findMyApplicationDetail(new FindApplicationDetailParam(userDto.getId(), recruitmentId, applicationId)); + 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) { + ApplicationResultSvcDto res = applicationService.findApplicationResult( + new FindApplicationResultParam(userDto.getId(), + recruitmentId, applicationId)); + 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) { + 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/controller/RecruitmentController.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java new file mode 100644 index 000000000..82b635d4c --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/RecruitmentController.java @@ -0,0 +1,39 @@ +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.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 +@RequiredArgsConstructor +@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/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/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/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/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/controller/response/ApplicationResDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResDto.java new file mode 100644 index 000000000..7a1f20401 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResDto.java @@ -0,0 +1,29 @@ +package gg.recruit.api.user.controller.response; + +import java.time.LocalDateTime; + +import gg.recruit.api.user.service.response.ApplicationSvcDto; +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(ApplicationSvcDto 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/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..b31271b81 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/ApplicationResultResDto.java @@ -0,0 +1,25 @@ +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; +import lombok.NoArgsConstructor; + +@Getter +@AllArgsConstructor(access = AccessLevel.PROTECTED) +@NoArgsConstructor +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/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/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/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/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 new file mode 100644 index 000000000..434ba0e3c --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/controller/response/MyApplicationsResDto.java @@ -0,0 +1,21 @@ +package gg.recruit.api.user.controller.response; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.recruit.api.user.service.response.ApplicationListSvcDto; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class MyApplicationsResDto { + private List applications; + + public MyApplicationsResDto(ApplicationListSvcDto applicationListDto) { + applications = applicationListDto.getApplications() + .stream() + .map(ApplicationResDto::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/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/service/ApplicationService.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java new file mode 100644 index 000000000..4c62f2177 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/ApplicationService.java @@ -0,0 +1,175 @@ +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; +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.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; +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.ForbiddenException; +import gg.utils.exception.custom.NotExistException; +import lombok.RequiredArgsConstructor; + +@Service +@RequiredArgsConstructor +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); + } + + 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); + } + + public Long findApplicationByUserAndRecruit(Long userId, Long recruitId) { + Optional application = applicationRepository.findByUserIdAndRecruitId(userId, 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()); + 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; + } + + @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()) + .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/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 new file mode 100644 index 000000000..04cb7552d --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/RecruitmentService.java @@ -0,0 +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/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/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/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/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/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/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-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/main/java/gg/recruit/api/user/service/response/ApplicationListSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListSvcDto.java new file mode 100644 index 000000000..3b824536e --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationListSvcDto.java @@ -0,0 +1,17 @@ +package gg.recruit.api.user.service.response; + +import java.util.List; +import java.util.stream.Collectors; + +import gg.data.recruit.application.Application; +import lombok.Getter; + +@Getter +public class ApplicationListSvcDto { + List applications; + + 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/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/main/java/gg/recruit/api/user/service/response/ApplicationSvcDto.java b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationSvcDto.java new file mode 100644 index 000000000..3473ad125 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/user/service/response/ApplicationSvcDto.java @@ -0,0 +1,29 @@ +package gg.recruit.api.user.service.response; + +import java.time.LocalDateTime; + +import gg.data.recruit.application.Application; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class ApplicationSvcDto { + private Long recruitId; + private Long applicationId; + private LocalDateTime startDate; + private LocalDateTime endDate; + private String title; + private String generation; + private String status; + + public ApplicationSvcDto(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/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/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/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/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/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-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/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/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/RecruitMockData.java b/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java new file mode 100644 index 000000000..e477eaedd --- /dev/null +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/RecruitMockData.java @@ -0,0 +1,96 @@ +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; + +@Component +@RequiredArgsConstructor +public class RecruitMockData { + private final RecruitmentRepository recruitmentRepository; + 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", + LocalDateTime.now(), LocalDateTime.now().plusDays(1)); + 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 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); + } + + public Question createQuestion(Recruitments recruitments) { + Question question = new Question(recruitments, InputType.TEXT, "question", 1); + 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 new file mode 100644 index 000000000..448b64d67 --- /dev/null +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/ApplicationControllerTest.java @@ -0,0 +1,231 @@ +package gg.recruit.api.user.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 java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +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.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; +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()); + } + + @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 { + //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()); + } + + @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()); + } + + @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-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..8287f0cce --- /dev/null +++ b/gg-recruit-api/src/test/java/gg/recruit/api/user/controller/RecruitmentControllerTest.java @@ -0,0 +1,111 @@ +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.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.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); + } + + @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-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/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 f2a46cbb4..6a877fe14 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/recruit/user/application/ApplicationAnswerRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java new file mode 100644 index 000000000..17cf2eb90 --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationAnswerRepository.java @@ -0,0 +1,28 @@ +package gg.repo.recruit.user.application; + +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; + +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); + + @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/application/ApplicationRepository.java b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java new file mode 100644 index 000000000..af4802015 --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/application/ApplicationRepository.java @@ -0,0 +1,30 @@ +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; + +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(@Param("userId") 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); + + @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-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..8516c3bf1 --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/CheckListRepository.java @@ -0,0 +1,14 @@ +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 org.springframework.data.repository.query.Param; + +import gg.data.recruit.recruitment.CheckList; + +public interface CheckListRepository extends JpaRepository { + @Query("SELECT c FROM CheckList c WHERE c.question.id IN :questionIds") + List findAllByQuestionIds(@Param("questionIds") List questionIds); +} 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 new file mode 100644 index 000000000..53eda0661 --- /dev/null +++ b/gg-repo/src/main/java/gg/repo/recruit/user/recruitment/RecruitmentRepository.java @@ -0,0 +1,23 @@ +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; +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, 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); + + @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-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-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/build.gradle b/gg-utils/build.gradle index e07dc545d..3c6d27f6b 100644 --- a/gg-utils/build.gradle +++ b/gg-utils/build.gradle @@ -94,12 +94,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-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 47d737a29..a39ec103b 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; 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 f0949c8fe..0db612d88 100644 --- a/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java +++ b/gg-utils/src/main/java/gg/utils/exception/ErrorCode.java @@ -126,6 +126,8 @@ 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"), + FORBIDDEN(403, "CM010", "์ ‘๊ทผ์ด ๊ธˆ์ง€๋œ ์š”์ฒญ์ž…๋‹ˆ๋‹ค."), //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); + } } 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); + } } 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/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 c485f1ba9..6a12cd174 100644 --- a/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java +++ b/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java @@ -10,14 +10,7 @@ import org.springframework.stereotype.Component; import gg.auth.utils.AuthTokenProvider; -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.party.Category; @@ -25,17 +18,24 @@ import gg.data.party.Room; import gg.data.party.UserRoom; import gg.data.party.type.RoomType; -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; 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'