diff --git a/.gitignore b/.gitignore
index c2065bc..94c4a30 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,3 +35,6 @@ out/
### VS Code ###
.vscode/
+
+### DB 비밀번호 ###
+/src/main/resources/db.properties
diff --git a/build.gradle b/build.gradle
index cb4b4ae..bc83ee5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -25,8 +25,17 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
+
+ // 테스트코드 @Slf4j 사용
+ testCompileOnly 'org.projectlombok:lombok'
+ testAnnotationProcessor 'org.projectlombok:lombok'
+
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
+
+ // JDBC, MySQL
+ implementation 'org.springframework.boot:spring-boot-starter-jdbc'
+ runtimeOnly 'com.mysql:mysql-connector-j'
}
tasks.named('test') {
diff --git a/src/main/java/com/web/mzvoca/repository/ConnectionConst.java b/src/main/java/com/web/mzvoca/repository/ConnectionConst.java
new file mode 100644
index 0000000..9ad7163
--- /dev/null
+++ b/src/main/java/com/web/mzvoca/repository/ConnectionConst.java
@@ -0,0 +1,7 @@
+package com.web.mzvoca.repository;
+
+public abstract class ConnectionConst {
+ public static final String URL = "";
+ public static final String userName = "root";
+ public static final String password = "";
+}
diff --git a/src/main/java/com/web/mzvoca/repository/QuestionRepository.java b/src/main/java/com/web/mzvoca/repository/QuestionRepository.java
new file mode 100644
index 0000000..10f25c3
--- /dev/null
+++ b/src/main/java/com/web/mzvoca/repository/QuestionRepository.java
@@ -0,0 +1,8 @@
+package com.web.mzvoca.repository;
+
+public interface QuestionRepository {
+
+ public void questionWrongCountRead();
+
+ public void questionWrongCountUpdate();
+}
diff --git a/src/main/java/com/web/mzvoca/repository/QuestionRepositoryImpl.java b/src/main/java/com/web/mzvoca/repository/QuestionRepositoryImpl.java
new file mode 100644
index 0000000..9ebcb67
--- /dev/null
+++ b/src/main/java/com/web/mzvoca/repository/QuestionRepositoryImpl.java
@@ -0,0 +1,16 @@
+package com.web.mzvoca.repository;
+
+import org.springframework.stereotype.Repository;
+
+@Repository
+public class QuestionRepositoryImpl implements QuestionRepository {
+ @Override
+ public void questionWrongCountRead() {
+
+ }
+
+ @Override
+ public void questionWrongCountUpdate() {
+
+ }
+}
diff --git a/src/main/java/com/web/mzvoca/repository/TotalCountRepository.java b/src/main/java/com/web/mzvoca/repository/TotalCountRepository.java
new file mode 100644
index 0000000..43ad4c9
--- /dev/null
+++ b/src/main/java/com/web/mzvoca/repository/TotalCountRepository.java
@@ -0,0 +1,8 @@
+package com.web.mzvoca.repository;
+
+public interface TotalCountRepository {
+
+ public int totalCountRead();
+
+ public void totalCountUpdate();
+}
diff --git a/src/main/java/com/web/mzvoca/repository/TotalCountRepositoryImpl.java b/src/main/java/com/web/mzvoca/repository/TotalCountRepositoryImpl.java
new file mode 100644
index 0000000..453dc4d
--- /dev/null
+++ b/src/main/java/com/web/mzvoca/repository/TotalCountRepositoryImpl.java
@@ -0,0 +1,80 @@
+package com.web.mzvoca.repository;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.jdbc.datasource.DataSourceUtils;
+import org.springframework.jdbc.support.JdbcUtils;
+import org.springframework.stereotype.Repository;
+
+import javax.sql.DataSource;
+import java.sql.*;
+import java.util.NoSuchElementException;
+
+@Repository
+@RequiredArgsConstructor
+@Slf4j
+public class TotalCountRepositoryImpl implements TotalCountRepository {
+
+ private final DataSource dataSource;
+
+ @Override
+ public int totalCountRead() {
+ String sql = "select * from totalcount";
+
+ Connection con = null;
+ PreparedStatement pstmt = null;
+ ResultSet rs = null;
+
+ try {
+ con = getConnection();
+ pstmt = con.prepareStatement(sql);
+ rs = pstmt.executeQuery();
+ if (rs.next()) {
+ // 가져온 데이터가 있을 때 실행할 부분
+ int totalCount = rs.getInt("total_count");
+ return totalCount;
+ } else {
+ throw new NoSuchElementException("값이 없습니다.");
+ }
+
+ } catch (SQLException e) {
+ throw new RuntimeException(e);
+ } finally {
+ close(con, pstmt, rs);
+ }
+ }
+
+ @Override
+ public void totalCountUpdate() {
+ // Update문을 통해 totalCount 값을 1 증가
+ String sql = "update totalcount set total_count = total_count + 1";
+
+ Connection con = null;
+ PreparedStatement pstmt = null;
+
+ try {
+ con = getConnection();
+ pstmt = con.prepareStatement(sql);
+ int result = pstmt.executeUpdate();
+ log.info("실행된 행 개수={}", result);
+ } catch (SQLException e) {
+ log.info("db Error", e);
+ throw new RuntimeException(e);
+ } finally {
+ close(con, pstmt, null);
+ }
+ }
+
+ private Connection getConnection() throws SQLException {
+ // 트랜잭션 동기화를 위해 DataSourceUtils 메서드 사용
+ Connection con = DataSourceUtils.getConnection(dataSource);
+ return con;
+ }
+
+ private void close(Connection con, Statement stmt, ResultSet rs) {
+ JdbcUtils.closeResultSet(rs);
+ JdbcUtils.closeStatement(stmt);
+ // 트랜잭션 동기화를 위해 DataSourceUtils 메서드 사용
+ DataSourceUtils.releaseConnection(con, dataSource);
+ }
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 8b13789..63383a3 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1 +1,2 @@
-
+# DB ?? ??
+spring.profiles.include = db
diff --git a/src/main/resources/templates/css/main.css b/src/main/resources/templates/css/main.css
index 4456526..d134b0d 100644
--- a/src/main/resources/templates/css/main.css
+++ b/src/main/resources/templates/css/main.css
@@ -1,15 +1,14 @@
-
.mainbody{
- margin-top:10px;
- margin-bottom:10px;
- padding-top:5px;
background: url("../images/v1_3.png");
text-align: center;
background-size:cover;
- height:90vdh;
+ height:100dvh;
+ margin: 0 auto;
}
body{
background-color: pink;
+ margin: 0;
+ padding: 0;
}
ul{
border: 1px solid;
@@ -32,3 +31,59 @@ th{
*{
font-family: 'Noto Serif KR', serif;
}
+@media (min-width: 1024px) {
+ .mainbody {
+ height: 100dvh;
+ width: 864px;
+ min-width: 864px;
+ font-size: 140px;
+
+ }
+ .container{
+ display: flex;
+ justify-content: center; /* 수평 가운데 정렬 */
+ align-items: center; /* 수직 가운데 정렬 */
+ text-align: center;
+ }
+ /* PC에 대한 추가 스타일 */
+}
+@media all and (min-width:768px) and (max-width:1023px) {
+ .mainbody {
+ height: 100dvh;
+ width: 100dvw;
+ font-size: 140px;
+ padding:0;
+ margin:0;
+ }
+ .container{
+ padding:0;
+ margin:0;
+ }
+ }
+ /*태블릿*/
+
+/* 모바일 스타일 */
+@media (max-width: 767px) {
+ .mainbody {
+ height: 100dvh;
+ width: 100dvw;
+ font-size:11vh;
+ }
+ .container {
+ padding:0;
+ margin:0;
+ }
+
+}
+@media (min-width: 280px)and (max-width: 319px) and (orientation: portrait) {
+ .mainbody {
+ height: 100%;
+ width: 100dvw;
+ font-size:80px;
+ }
+ .container {
+ padding:0;
+ margin:0;
+ }
+}
+/*갤럭시폴드*/
\ No newline at end of file
diff --git a/src/main/resources/templates/css/questions.css b/src/main/resources/templates/css/questions.css
new file mode 100644
index 0000000..1d4a885
--- /dev/null
+++ b/src/main/resources/templates/css/questions.css
@@ -0,0 +1,115 @@
+#qna{
+ display: none;
+}
+#result{
+ display:none;
+}
+#commentary{
+ display: none;
+}
+#ranking{
+ display: none;
+}
+.mainbody{
+ background: url("../images/v1_3.png");
+ text-align: center;
+ background-size:cover;
+ height:100dvh;
+ margin: 0 auto;
+
+}
+
+.questionstyle{
+ font-size: 0.30em;
+}
+.answerstyle{
+ font-size: 0.24em;
+ text-align: left;
+}
+.commentarystyle{
+ font-size:0.18em;
+}
+body{
+ background-color: pink;
+ margin: 0;
+ padding: 0;
+}
+
+.btn1{
+ background-color: gray;
+ color:black;
+}
+*{
+ font-family: 'Noto Serif KR', serif;
+}
+.answerbutton{
+ border-radius: 50%;
+ width: 33.6px;
+ height: 33.6px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ float: left;
+}
+.answerbutton:active{
+ background-color: red;
+}
+@media (min-width: 1024px) {
+ .mainbody {
+ height: 100dvh;
+ width: 864px;
+ min-width: 864px;
+ font-size: 140px;
+
+ }
+ .container{
+ display: flex;
+ justify-content: center; /* 수평 가운데 정렬 */
+ align-items: center; /* 수직 가운데 정렬 */
+ text-align: center;
+ }
+ /* PC에 대한 추가 스타일 */
+}
+@media all and (min-width:768px) and (max-width:1023px) {
+ .mainbody {
+ height: 100dvh;
+ width: 100dvw;
+ font-size: 140px;
+ padding:0;
+ margin:0;
+
+ }
+ .container{
+ padding:0;
+ margin:0;
+ }
+ }
+ /*태블릿*/
+
+/* 모바일 스타일 */
+@media (max-width: 767px) {
+ .mainbody {
+ height: 100dvh;
+ width: 100dvw;
+ font-size:11vh;
+
+ }
+ .container {
+ padding:0;
+ margin:0;
+ }
+
+}
+@media (min-width: 280px)and (max-width: 319px) and (orientation: portrait) {
+ .mainbody {
+ height: 100%;
+ width: 100dvw;
+ font-size:80px;
+
+ }
+ .container {
+ padding:0;
+ margin:0;
+ }
+}
+/*갤럭시폴드*/
\ No newline at end of file
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index 3974d9b..f00a3b8 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -6,44 +6,146 @@
Document
+
-
-
제 2교시
-
2023학년도 MZ어휘력고사 문제지
-
문해력 영역
-
-
-
+
+
+
-
-
+
2023학년도 MZ어휘력고사 문제지
+
문해력 영역
+
+
+ - 자신이 선택한 과목의 문제지인지 확인하시오.
+ - 매 선택과목마다 문제지의 해당란에 성명과 수험번호를 정확히 쓰시오.
+ - 답안지의 필적 확인란에 다음의 문구를 정자로 기재하시오.
+ MZ 특: 이런거 자세히 안봄
+
+ - 답안지의 해당란에 성명과 수험번호를 쓰고, 또 수험번호, 문형(홀수/짝수), 답을 정확히 표시하시오.
+ - 문항에 따라 배점이 같으니 안심하고 푸세요.
+
+
+
※ 시험이 시작되기 전까지 표지를 넘기지 마시오.
+
+
한국MZ평가원
-
- - 자신이 선택한 과목의 문제지인지 확인하시오.
- - 매 선택과목마다 문제지의 해당란에 성명과 수험번호를 정확히 쓰시오.
- - 답안지의 필적 확인란에 다음의 문구를 정자로 기재하시오.
- MZ 특: 이런거 자세히 안봄
-
- - 답안지의 해당란에 성명과 수험번호를 쓰고, 또 수험번호, 문형(홀수/짝수), 답을 정확히 표시하시오.
- - 문항에 따라 배점이 같으니 안심하고 푸세요.
-
-
-
※ 시험이 시작되기 전까지 표지를 넘기지 마시오.
-
-
한국MZ평가원
-
+
+
+
+
+
+
2023학년도 MZ어휘력고사 문제지
+
+
+
+
+
한국MZ평가원
+
+
+
+
+
2023학년도 MZ어휘력고사 성적통지표
+
+
+
+ | 수험번호 |
+ 성명 |
+ 출신고교 |
+
+
+
+
+ | 123-45678 |
+ 김잼민 |
+ MZ고등학교 |
+
+
+ | 영역 |
+ 문해력 영역 |
+ MZ력 영역 |
+
+
+ | 선택과목 |
+ 문해력과 맞춤법 |
+ MZ어 |
+
+
+ | 표준점수 |
+ |
+ |
+
+
+ | 백분위 |
+ |
+ |
+
+
+ | 등급 |
+ |
+ |
+
+
+
+
2023.08.12
+
한국MZ평가원장
+
+
+
+
+
+
+
+
-