Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public List<ProblemSetSearchGetResponse> search(String problemSetTitle, String p
.from(problemSet)
.leftJoin(problem).on(problem.id.in(problemSet.problemIds)) // 문제 세트 내 포함된 문항과 조인
.where(
problemSet.isDeleted.isFalse(),
containsProblemSetTitle(problemSetTitle),
containsProblemTitle(problemTitle)
)
Expand All @@ -51,7 +50,6 @@ public List<ProblemSetSearchGetResponse> 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)
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/insert-problem-set.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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');

-- 문제 세트에 포함된 문제 추가
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/insert-problem-set2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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');

-- 문제 세트에 포함된 문제 추가
Expand Down
17 changes: 10 additions & 7 deletions src/test/resources/insert-problem.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
);

-- 자식 문제 데이터 삽입
Expand All @@ -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 (
Expand Down
30 changes: 17 additions & 13 deletions src/test/resources/insert-problem2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -94,20 +96,22 @@ 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,
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)
Expand Down