woals 07-29
240729 권민수 학생 정보 api 변경 및 단어장 임시 crud 추가
@6409bdba190f8d69e2780deb38d2ee2f52e7503a
src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
--- src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
+++ src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
@@ -72,6 +72,7 @@
                 .requestMatchers("/classBook/**").permitAll() // 반 - 책 정보 진입 허용
                 .requestMatchers("/unit/**").permitAll()
                 .requestMatchers("/photo/**").permitAll()
+                .requestMatchers("/wordbook/**").permitAll()
                 .anyRequest().authenticated()); // 나머지 경로는 인증 필요
 
         // jwt 필터 처리 적용
src/main/java/com/takensoft/ai_lms/lms/student/web/StudentInfoController.java
--- src/main/java/com/takensoft/ai_lms/lms/student/web/StudentInfoController.java
+++ src/main/java/com/takensoft/ai_lms/lms/student/web/StudentInfoController.java
@@ -7,6 +7,8 @@
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Map;
+
 /**
  * @author 권민수
  * @since 2024.07.25
@@ -23,13 +25,13 @@
     private final StudentInfoService studentInfoService;
 
     // 학생 정보 불러오는 api
-    @GetMapping("/student/{userId}")
-    public StudentInfoVO getStudentInfo(@PathVariable String userId) {
-        return studentInfoService.getStudentInfo(userId);
+    @PostMapping("/getInfo.json")
+    public StudentInfoVO getStudentInfo(@RequestBody Map<String, String> req) {
+        return studentInfoService.getStudentInfo(req.get("userId"));
     }
 
     // 학생 질문 사항 수정하는 api
-    @PostMapping("/student/updateQuestion")
+    @PostMapping("/updateQuestion.json")
     public void updateStudentQuestion(@RequestBody UpdateStudentQuestionDTO request) {
         studentInfoService.updateStudentQuestion(request.getUserId(), request.getStudentQuestion());
     }
 
src/main/resources/mybatis/mapper/lms/word_book-SQL.xml (added)
+++ src/main/resources/mybatis/mapper/lms/word_book-SQL.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.takensoft.ai_lms.lms.word_book.dao.WordBookDAO">
+
+    <!--
+        작 성 자 : 권민수
+        작 성 일 : 2024.07.29
+        내   용 : 단어장 정보 관련 sql 매핑 xml 문서
+    -->
+
+    <resultMap id="WordBookResultMap" type="com.takensoft.ai_lms.lms.word_book.vo.WordBookVO">
+        <id property="wdBookId" column="wd_book_id"/>
+        <result property="wdBookTypeId" column="wd_book_type_id"/>
+        <result property="textId" column="text_id"/>
+        <result property="userId" column="user_id"/>
+    </resultMap>
+
+    <select id="getAllWordBooks" resultMap="WordBookResultMap">
+        SELECT
+            wd_book_id,
+            wd_book_type_id,
+            text_id,
+            user_id
+        FROM ai_lms.wordbook
+    </select>
+
+    <select id="getWordBookById" parameterType="string" resultMap="WordBookResultMap">
+        SELECT
+            wd_book_id,
+            wd_book_type_id,
+            text_id,
+            user_id
+        FROM ai_lms.wordbook
+        WHERE wd_book_id = #{wdBookId}
+    </select>
+
+    <insert id="insertWordBook" parameterType="com.takensoft.ai_lms.lms.word_book.vo.WordBookVO">
+        INSERT INTO
+            ai_lms.wordbook (wd_book_id,
+                             wd_book_type_id,
+                             text_id,
+                             user_id)
+        VALUES (#{wdBookId},
+                #{wdBookTypeId},
+                #{textId},
+                #{userId})
+    </insert>
+
+    <update id="updateWordBook" parameterType="com.takensoft.ai_lms.lms.word_book.vo.WordBookVO">
+        UPDATE ai_lms.wordbook
+        SET wd_book_type_id = #{wdBookTypeId},
+            text_id = #{textId},
+            user_id = #{userId}
+        WHERE wd_book_id = #{wdBookId}
+    </update>
+
+    <delete id="deleteWordBook" parameterType="string">
+        DELETE FROM ai_lms.wordbook
+        WHERE wd_book_id = #{wdBookId}
+    </delete>
+
+</mapper>(파일 끝에 줄바꿈 문자 없음)
Add a comment
List