-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 발송 옵션 선택하지 못한 편지를 위한 sendOptionId 컬럼 추가 #3
- Loading branch information
Showing
6 changed files
with
25 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,6 @@ public class LetterRequest { | |
private Sticker sticker; | ||
|
||
private Long questionId; | ||
|
||
private Long sendOptionId; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/main/java/com/nexters/covid/letter/domain/sendoption/SendOptionRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package com.nexters.covid.letter.domain.sendoption; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
public interface SendOptionRepository extends JpaRepository<SendOption, Long> { | ||
|
||
@Query("select o from SendOption o join fetch o.questions") | ||
List<SendOption> findAllJoinFetch(); | ||
|
||
Optional<SendOption> findSendOptionById(Long sendOptionId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
insert into user (email, identifier, name) values ('email', 'identifier', 'name'); | ||
insert into user (email, identifier, name) values ('[email protected]', '1', '김아무개'); | ||
|
||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, state, title, user_id, created_date) | ||
values ('64K07Jqp7JqU7Jqp7Jqp7Jqp', 'ENCRYPTED', 'LETTER_TO', 'email', 'HAPPY', 1 , 'PENDING', 'TITLE', 1, '2021-08-11T12:09:59.342635'); | ||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, state, title, user_id, created_date) | ||
values ('64K07Jqp7JqU7Jqp7Jqp7Jqp', 'ENCRYPTED1', 'LETTER_TO1', 'email', 'BLUE', 2, 'PENDING', 'TITLE1', 1, '2021-08-09T12:09:59.342635'); | ||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, state, title, user_id, created_date) | ||
values ('64K07Jqp7JqU7Jqp7Jqp7Jqp', 'ENCRYPTED1', 'LETTER_TO1', 'email', 'BLUE', 8, 'PENDING', 'TITLE1', 1, '2021-08-04T12:09:59.342635'); | ||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, send_option_id, state, title, user_id, created_date) | ||
values ('64K07Jqp7JqU7Jqp7Jqp7Jqp', 'ENCRYPTED', 'LETTER_TO', 'email', 'HAPPY', 1 , 1, 'PENDING', 'TITLE', 1, '2021-08-11T12:09:59.342635'); | ||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, send_option_id, state, title, user_id, created_date) | ||
values ('64K07Jqp7JqU7Jqp7Jqp7Jqp', 'ENCRYPTED1', 'LETTER_TO1', 'email', 'BLUE', 2, 1, 'PENDING', 'TITLE1', 1, '2021-08-09T12:09:59.342635'); | ||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, send_option_id, state, title, user_id, created_date) | ||
values ('64K07Jqp7JqU7Jqp7Jqp7Jqp', 'ENCRYPTED2', 'LETTER_TO1', 'email', 'BLUE', 8, 2, 'PENDING', 'TITLE1', 1, '2021-08-04T12:09:59.342635'); | ||
|
||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, state, title, user_id) | ||
values ('CONTENTS2', 'ENCRYPTED2', 'LETTER_TO2', '[email protected]', 'BLUE', 2, 'PENDING', 'TITLE2', 2); | ||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, state, title, user_id) | ||
values ('CONTENTS3', 'ENCRYPTED3', 'LETTER_TO3', '[email protected]', 'BLUE', 2, 'PENDING', 'TITLE3', 2); | ||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, send_option_id, state, title, user_id) | ||
values ('CONTENTS2', 'ENCRYPTED2', 'LETTER_TO2', '[email protected]', 'BLUE', 2, 7, 'PENDING', 'TITLE2', 2); | ||
insert into letter (contents, encrypted_id, letter_to, email, sticker, question_id, send_option_id, state, title, user_id) | ||
values ('CONTENTS3', 'ENCRYPTED3', 'LETTER_TO3', '[email protected]', 'BLUE', 2, 7, 'PENDING', 'TITLE3', 2); | ||
|
||
-- 발송 옵션 | ||
insert into send_option (text, covid_stat) values ('실내에서 마스크를 벗을 수 있을 때', 1000); | ||
|
@@ -20,6 +20,7 @@ insert into send_option (text, covid_stat) values ('하루 확진자 수 100명 | |
insert into send_option (text, covid_stat) values ('백신 접종율이 50% 이상일 때', 0); | ||
insert into send_option (text, covid_stat) values ('코로나 종식 선언할 때', 0); | ||
insert into send_option (text, covid_stat) values ('공통 질문', 0); | ||
insert into send_option (text, covid_stat) values ('미선택', 0); | ||
|
||
-- 1. 질문 실내에서 마스크를 벗을 수 있을 때 | ||
insert into question (text, send_option_id) values ('코로나가 끝나면 누구와 어떤 공간을 가장 가고 싶나요?', 1); | ||
|