-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from GDSC-snowflowerthon/feat/quiz-32
[feat] 재난 퀴즈 엔티티 생성
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.ALGo.ALGo_server.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
public class Quiz { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long quiz_id; | ||
|
||
@Column(nullable = false) | ||
private String question; | ||
|
||
@Column(nullable = false) | ||
private boolean answer; | ||
|
||
@Column(nullable = false) | ||
private String description; | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/ALGo/ALGo_server/repository/QuizRepository.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.ALGo.ALGo_server.repository; | ||
|
||
import com.ALGo.ALGo_server.entity.Quiz; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface QuizRepository extends JpaRepository<Quiz, Long> { | ||
|
||
Quiz findByQuiz_id(Long quiz_id); | ||
|
||
} |