diff --git a/gg-data/src/main/java/gg/data/recruit/application/Application.java b/gg-data/src/main/java/gg/data/recruit/application/Application.java index 52af72d91..58624b88c 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/Application.java +++ b/gg-data/src/main/java/gg/data/recruit/application/Application.java @@ -27,16 +27,16 @@ public class Application extends BaseTimeEntity { private Long id; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "user_id") + @JoinColumn(name = "user_id", nullable = false) private User user; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "recruit_id") + @JoinColumn(name = "recruit_id", nullable = false) private Recruitments recruitId; private Boolean isDeleted; @Enumerated(EnumType.STRING) - @Column(length = 15) + @Column(length = 15, nullable = false) private ApplicationStatus status; } diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java index 24008742c..5f3279089 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswer.java @@ -22,10 +22,10 @@ public class ApplicationAnswer extends BaseTimeEntity { private Long id; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "question_id") + @JoinColumn(name = "question_id", nullable = false) private Question questionId; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "application_id") + @JoinColumn(name = "application_id", nullable = false) private Application applicationId; } diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java index 867cf642e..58594f2c1 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerCheckList.java @@ -20,10 +20,10 @@ public class ApplicationAnswerCheckList extends BaseTimeEntity { private Long id; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "application_answer_id") + @JoinColumn(name = "application_answer_id", nullable = false) private ApplicationAnswer applicationAnswerId; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "check_list_id") + @JoinColumn(name = "check_list_id", nullable = false) private CheckList checkListId; } diff --git a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java index b399a7134..3da2b03d8 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java +++ b/gg-data/src/main/java/gg/data/recruit/application/ApplicationAnswerText.java @@ -20,7 +20,7 @@ public class ApplicationAnswerText extends BaseTimeEntity { private Long id; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "application_answer_id") + @JoinColumn(name = "application_answer_id", nullable = false) private ApplicationAnswer applicationAnswerId; @Column(length = 1000) diff --git a/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java b/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java index 20360d834..27c413246 100644 --- a/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java +++ b/gg-data/src/main/java/gg/data/recruit/application/RecruitStatus.java @@ -23,7 +23,7 @@ public class RecruitStatus extends BaseTimeEntity { private Long id; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "application_id") + @JoinColumn(name = "application_id", nullable = false) private Application applicationId; private LocalDateTime interviewDate; 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 index 14431154e..723994ff5 100644 --- a/gg-data/src/main/java/gg/data/recruit/manage/ResultMessage.java +++ b/gg-data/src/main/java/gg/data/recruit/manage/ResultMessage.java @@ -24,7 +24,7 @@ public class ResultMessage extends BaseTimeEntity { @Column(length = 100) private String content; - @Column(length = 15) + @Column(length = 15, nullable = false) @Enumerated(EnumType.STRING) private MessageType messageType; diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java b/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java index 23abb7cac..844fa183f 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/CheckList.java @@ -22,7 +22,7 @@ public class CheckList extends BaseTimeEntity { private Long id; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "question_id") + @JoinColumn(name = "question_id", nullable = false) private Question questionId; @Column(length = 100) diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java index 3a08efdf2..67f0824a8 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Question.java @@ -24,11 +24,11 @@ public class Question extends BaseTimeEntity { private Long id; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "recruit_id") + @JoinColumn(name = "recruit_id", nullable = false) private Recruitments recruitId; @Enumerated(EnumType.STRING) - @Column(length = 20) + @Column(length = 20, nullable = false) private InputType inputType; @Column(length = 300) diff --git a/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java index 098cda54b..1e6f5c48b 100644 --- a/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java +++ b/gg-data/src/main/java/gg/data/recruit/recruitment/Recruitments.java @@ -31,7 +31,9 @@ public class Recruitments extends BaseTimeEntity { private Boolean isDeleted; + @Column(nullable = false) private LocalDateTime startTime; + @Column(nullable = false) private LocalDateTime endTime; } 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 55a35e801..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,5 +1,7 @@ package gg.pingpong.api.admin.tournament.service; +import static gg.data.pingpong.match.type.TournamentMatchStatus.*; + import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; 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 e7f14eb5e..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,5 +1,8 @@ package gg.pingpong.api.user.match.service; +import static gg.data.pingpong.match.type.TournamentMatchStatus.*; +import static gg.data.pingpong.tournament.type.RoundNumber.*; + import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Comparator; 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..4a6f4d98a --- /dev/null +++ b/gg-pingpong-api/src/main/resources/db/migration/V2_recruit.sql @@ -0,0 +1,113 @@ +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 `application_answer` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `application_id` bigint NOT NULL , + `question_id` bigint NOT NULL , + PRIMARY KEY (`id`), + KEY `FKn2ayp7tptdv0yycdqkp2hcm63` (`application_id`), + KEY `FK59sj9jdfki14kkp34kc2jdhyj` (`question_id`), + CONSTRAINT `FK59sj9jdfki14kkp34kc2jdhyj` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), + CONSTRAINT `FKn2ayp7tptdv0yycdqkp2hcm63` FOREIGN KEY (`application_id`) REFERENCES `application` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci + + +CREATE TABLE `application_answer_check_list` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `application_answer_id` bigint NOT NULL, + `check_list_id` bigint NOT NULL, + PRIMARY KEY (`id`), + KEY `FKqdnt92yg8t27q74he0ersyiax` (`application_answer_id`), + KEY `FK3mf6hfr08f2ex01aqejikxk9w` (`check_list_id`), + CONSTRAINT `FK3mf6hfr08f2ex01aqejikxk9w` FOREIGN KEY (`check_list_id`) REFERENCES `check_list` (`id`), + CONSTRAINT `FKqdnt92yg8t27q74he0ersyiax` FOREIGN KEY (`application_answer_id`) REFERENCES `application_answer` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci + +CREATE TABLE `application_answer_text` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `answer` varchar(1000) DEFAULT NULL, + `application_answer_id` bigint NOT NULL , + PRIMARY KEY (`id`), + KEY `FKlhk4m3hi4r3v8xqk8lx4bx5g7` (`application_answer_id`), + CONSTRAINT `FKlhk4m3hi4r3v8xqk8lx4bx5g7` FOREIGN KEY (`application_answer_id`) REFERENCES `application_answer` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci + + +CREATE TABLE `recruit_status` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `created_at` datetime(6) NOT NULL, + `modified_at` datetime(6) DEFAULT NULL, + `interview_date` datetime(6) DEFAULT NULL, + `application_id` bigint NOT NULL , + PRIMARY KEY (`id`), + KEY `FKrn9y1gwvfmkkoshsxyx3l4pbn` (`application_id`), + CONSTRAINT `FKrn9y1gwvfmkkoshsxyx3l4pbn` FOREIGN KEY (`application_id`) REFERENCES `application` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci + +CREATE TABLE `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 `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 `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 `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