diff --git a/src/main/java/com/moplus/moplus_server/domain/problemset/repository/ProblemSetSearchRepositoryCustom.java b/src/main/java/com/moplus/moplus_server/domain/problemset/repository/ProblemSetSearchRepositoryCustom.java index 7abd8a2..38ef534 100644 --- a/src/main/java/com/moplus/moplus_server/domain/problemset/repository/ProblemSetSearchRepositoryCustom.java +++ b/src/main/java/com/moplus/moplus_server/domain/problemset/repository/ProblemSetSearchRepositoryCustom.java @@ -25,7 +25,6 @@ public List search(String problemSetTitle, String p .from(problemSet) .leftJoin(problem).on(problem.id.in(problemSet.problemIds)) // 문제 세트 내 포함된 문항과 조인 .where( - problemSet.isDeleted.isFalse(), containsProblemSetTitle(problemSetTitle), containsProblemTitle(problemTitle) ) @@ -51,7 +50,6 @@ public List confirmSearch(String problemSetTitle, S .from(problemSet) .leftJoin(problem).on(problem.id.in(problemSet.problemIds)) // 문제 세트 내 포함된 문항과 조인 .where( - problemSet.isDeleted.isFalse(), problemSet.confirmStatus.eq(CONFIRMED), containsProblemSetTitle(problemSetTitle), containsProblemTitle(problemTitle) diff --git a/src/test/resources/insert-problem-set.sql b/src/test/resources/insert-problem-set.sql index ffca03e..ace9d0c 100644 --- a/src/test/resources/insert-problem-set.sql +++ b/src/test/resources/insert-problem-set.sql @@ -4,9 +4,9 @@ DELETE FROM problem_set; -- 문제 세트 추가 -INSERT INTO problem_set (problem_set_id, title, is_deleted, confirm_status) +INSERT INTO problem_set (problem_set_id, title, deleted, confirm_status) VALUES (1, '2025년 5월 고2 모의고사 문제 세트', false, 'NOT_CONFIRMED'); -INSERT INTO problem_set (problem_set_id, title, is_deleted, confirm_status) +INSERT INTO problem_set (problem_set_id, title, deleted, confirm_status) VALUES (2, '2025년 5월 고3 모의고사 문제 세트', false, 'CONFIRMED'); -- 문제 세트에 포함된 문제 추가 diff --git a/src/test/resources/insert-problem-set2.sql b/src/test/resources/insert-problem-set2.sql index ee87ce3..a2ca064 100644 --- a/src/test/resources/insert-problem-set2.sql +++ b/src/test/resources/insert-problem-set2.sql @@ -2,7 +2,7 @@ DELETE FROM problem_set_problems; DELETE FROM problem_set; -- 문제 세트 추가 -INSERT INTO problem_set (problem_set_id, title, is_deleted, confirm_status) +INSERT INTO problem_set (problem_set_id, title, deleted, confirm_status) VALUES (1, '2025년 5월 고2 모의고사 문제 세트', false, 'CONFIRMED'); -- 문제 세트에 포함된 문제 추가 diff --git a/src/test/resources/insert-problem.sql b/src/test/resources/insert-problem.sql index 1e8006c..a5dc8d4 100644 --- a/src/test/resources/insert-problem.sql +++ b/src/test/resources/insert-problem.sql @@ -21,13 +21,14 @@ INSERT INTO problem (problem_id, answer_type, is_confirmed, recommended_minute, - recommended_second) + recommended_second, + deleted) VALUES (1, '1224052001', 1, 1, 'GICHUL_PROBLEM', '제목1', '1', 5, '기존 문제 설명 1', 'mainProblem.png1', 'mainAnalysis.png1', 'readingTip.png1', 'seniorTip.png1', - 'prescription.png1', 'MULTIPLE_CHOICE', false, 30, 45), + 'prescription.png1', 'MULTIPLE_CHOICE', false, 30, 45, false), (2, '1224052002', 1, 1, 'GICHUL_PROBLEM', '제목2', '1', 5, '기존 문제 설명 2', 'mainProblem.png2', 'mainAnalysis.png2', 'readingTip.png2', 'seniorTip.png2', - 'prescription.png2', 'MULTIPLE_CHOICE', false, 25, 30); + 'prescription.png2', 'MULTIPLE_CHOICE', false, 25, 30, false); -- 자식 문제 테이블 생성 CREATE TABLE IF NOT EXISTS child_problem ( @@ -36,7 +37,8 @@ CREATE TABLE IF NOT EXISTS child_problem ( image_url VARCHAR(255), answer_type VARCHAR(50), answer VARCHAR(255), - sequence INT + sequence INT, + deleted BOOLEAN ); -- 자식 문제 데이터 삽입 @@ -45,9 +47,10 @@ INSERT INTO child_problem (child_problem_id, image_url, answer_type, answer, - sequence) -VALUES (1, 1, 'child1.png', 'MULTIPLE_CHOICE', '1', 0), - (2, 1, 'child2.png', 'SHORT_ANSWER', '정답2', 1); + sequence, + deleted) +VALUES (1, 1, 'child1.png', 'MULTIPLE_CHOICE', '1', 0, false), + (2, 1, 'child2.png', 'SHORT_ANSWER', '정답2', 1, false); -- 문제-컨셉 태그 연결 테이블 생성 CREATE TABLE IF NOT EXISTS problem_concept ( diff --git a/src/test/resources/insert-problem2.sql b/src/test/resources/insert-problem2.sql index 550bcc7..f755e84 100644 --- a/src/test/resources/insert-problem2.sql +++ b/src/test/resources/insert-problem2.sql @@ -26,21 +26,22 @@ INSERT INTO problem (problem_id, answer_type, is_confirmed, recommended_minute, - recommended_second) + recommended_second, + deleted) VALUES (1, '24052001001', 1, 1, 'GICHUL_PROBLEM', '제목1', '1', 5, '기존 문제 설명', 'mainProblem.png', 'mainAnalysis.png', 'mainHandwriting1.png', 'readingTip.png', 'seniorTip.png', 'prescription1.png, prescription2.png', 'MULTIPLE_CHOICE', false, - 30, 0), + 30, 0, false), (2, '24052001002', 1, 2, 'GICHUL_PROBLEM', '제목2', '2', 4, '문제 2 설명', 'mainProblem2.png', 'mainAnalysis2.png', 'mainHandwriting2.png', 'readingTip2.png', 'seniorTip2.png', 'prescription3.png, prescription4.png', 'MULTIPLE_CHOICE', false, - 20, 30), + 20, 30, false), (3, '24052001003', 1, 3, 'GICHUL_PROBLEM', '제목3', '3', 3, '문제 3 설명', 'mainProblem3.png', 'mainAnalysis3.png', 'mainHandwriting3.png', 'readingTip3.png', 'seniorTip3.png', 'prescription5.png, prescription6.png', 'SHORT_ANSWER', true, - 15, 45); + 15, 45, false); -- 자식 문제 데이터 삽입 INSERT INTO child_problem (child_problem_id, @@ -49,11 +50,12 @@ INSERT INTO child_problem (child_problem_id, answer_type, answer, sequence, - prescription_image_urls) -VALUES (1, 1, 'child1.png', 'MULTIPLE_CHOICE', '1', 0, 'child1_prescription1.png, child1_prescription2.png'), - (2, 1, 'child2.png', 'SHORT_ANSWER', '정답2', 1, 'child2_prescription1.png, child2_prescription2.png'), - (3, 2, 'child3.png', 'MULTIPLE_CHOICE', '2', 0, 'child3_prescription1.png, child3_prescription2.png'), - (4, 3, 'child4.png', 'SHORT_ANSWER', '3', 0, 'child4_prescription1.png, child4_prescription2.png'); + prescription_image_urls, + deleted) +VALUES (1, 1, 'child1.png', 'MULTIPLE_CHOICE', '1', 0, 'child1_prescription1.png, child1_prescription2.png', false), + (2, 1, 'child2.png', 'SHORT_ANSWER', '정답2', 1, 'child2_prescription1.png, child2_prescription2.png', false), + (3, 2, 'child3.png', 'MULTIPLE_CHOICE', '2', 0, 'child3_prescription1.png, child3_prescription2.png', false), + (4, 3, 'child4.png', 'SHORT_ANSWER', '3', 0, 'child4_prescription1.png, child4_prescription2.png', false); -- 문제-컨셉 태그 연결 INSERT INTO problem_concept (problem_id, concept_tag_id) @@ -94,11 +96,12 @@ INSERT INTO problem (problem_id, answer_type, is_confirmed, recommended_minute, - recommended_second) + recommended_second, + deleted) VALUES (4, '24052001004', 1, 4, 'GICHUL_PROBLEM', '제목4', '4', 1, '유효한 문제로 수정', 'mainProblem4.png', 'mainAnalysis4.png', 'mainHandwriting4.png', 'readingTip4.png', 'seniorTip4.png', 'prescription7.png, prescription8.png', 'MULTIPLE_CHOICE', false, - 20, 0); + 20, 0, false); -- problem 4에 대한 자식 문제 추가 INSERT INTO child_problem (child_problem_id, @@ -106,8 +109,9 @@ INSERT INTO child_problem (child_problem_id, image_url, answer_type, answer, - sequence) -VALUES (5, 4, 'child5.png', 'MULTIPLE_CHOICE', '4', 0); + sequence, + deleted) +VALUES (5, 4, 'child5.png', 'MULTIPLE_CHOICE', '4', 0, false); -- problem 4와 자식 문제에 대한 컨셉 태그 추가 INSERT INTO problem_concept (problem_id, concept_tag_id)