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
... | ... | @@ -72,6 +72,7 @@ |
72 | 72 |
.requestMatchers("/classBook/**").permitAll() // 반 - 책 정보 진입 허용 |
73 | 73 |
.requestMatchers("/unit/**").permitAll() |
74 | 74 |
.requestMatchers("/photo/**").permitAll() |
75 |
+ .requestMatchers("/wordbook/**").permitAll() |
|
75 | 76 |
.anyRequest().authenticated()); // 나머지 경로는 인증 필요 |
76 | 77 |
|
77 | 78 |
// 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
... | ... | @@ -7,6 +7,8 @@ |
7 | 7 |
import lombok.extern.slf4j.Slf4j; |
8 | 8 |
import org.springframework.web.bind.annotation.*; |
9 | 9 |
|
10 |
+import java.util.Map; |
|
11 |
+ |
|
10 | 12 |
/** |
11 | 13 |
* @author 권민수 |
12 | 14 |
* @since 2024.07.25 |
... | ... | @@ -23,13 +25,13 @@ |
23 | 25 |
private final StudentInfoService studentInfoService; |
24 | 26 |
|
25 | 27 |
// 학생 정보 불러오는 api |
26 |
- @GetMapping("/student/{userId}") |
|
27 |
- public StudentInfoVO getStudentInfo(@PathVariable String userId) { |
|
28 |
- return studentInfoService.getStudentInfo(userId); |
|
28 |
+ @PostMapping("/getInfo.json") |
|
29 |
+ public StudentInfoVO getStudentInfo(@RequestBody Map<String, String> req) { |
|
30 |
+ return studentInfoService.getStudentInfo(req.get("userId")); |
|
29 | 31 |
} |
30 | 32 |
|
31 | 33 |
// 학생 질문 사항 수정하는 api |
32 |
- @PostMapping("/student/updateQuestion") |
|
34 |
+ @PostMapping("/updateQuestion.json") |
|
33 | 35 |
public void updateStudentQuestion(@RequestBody UpdateStudentQuestionDTO request) { |
34 | 36 |
studentInfoService.updateStudentQuestion(request.getUserId(), request.getStudentQuestion()); |
35 | 37 |
} |
+++ src/main/resources/mybatis/mapper/lms/word_book-SQL.xml
... | ... | @@ -0,0 +1,62 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.takensoft.ai_lms.lms.word_book.dao.WordBookDAO"> | |
4 | + | |
5 | + <!-- | |
6 | + 작 성 자 : 권민수 | |
7 | + 작 성 일 : 2024.07.29 | |
8 | + 내 용 : 단어장 정보 관련 sql 매핑 xml 문서 | |
9 | + --> | |
10 | + | |
11 | + <resultMap id="WordBookResultMap" type="com.takensoft.ai_lms.lms.word_book.vo.WordBookVO"> | |
12 | + <id property="wdBookId" column="wd_book_id"/> | |
13 | + <result property="wdBookTypeId" column="wd_book_type_id"/> | |
14 | + <result property="textId" column="text_id"/> | |
15 | + <result property="userId" column="user_id"/> | |
16 | + </resultMap> | |
17 | + | |
18 | + <select id="getAllWordBooks" resultMap="WordBookResultMap"> | |
19 | + SELECT | |
20 | + wd_book_id, | |
21 | + wd_book_type_id, | |
22 | + text_id, | |
23 | + user_id | |
24 | + FROM ai_lms.wordbook | |
25 | + </select> | |
26 | + | |
27 | + <select id="getWordBookById" parameterType="string" resultMap="WordBookResultMap"> | |
28 | + SELECT | |
29 | + wd_book_id, | |
30 | + wd_book_type_id, | |
31 | + text_id, | |
32 | + user_id | |
33 | + FROM ai_lms.wordbook | |
34 | + WHERE wd_book_id = #{wdBookId} | |
35 | + </select> | |
36 | + | |
37 | + <insert id="insertWordBook" parameterType="com.takensoft.ai_lms.lms.word_book.vo.WordBookVO"> | |
38 | + INSERT INTO | |
39 | + ai_lms.wordbook (wd_book_id, | |
40 | + wd_book_type_id, | |
41 | + text_id, | |
42 | + user_id) | |
43 | + VALUES (#{wdBookId}, | |
44 | + #{wdBookTypeId}, | |
45 | + #{textId}, | |
46 | + #{userId}) | |
47 | + </insert> | |
48 | + | |
49 | + <update id="updateWordBook" parameterType="com.takensoft.ai_lms.lms.word_book.vo.WordBookVO"> | |
50 | + UPDATE ai_lms.wordbook | |
51 | + SET wd_book_type_id = #{wdBookTypeId}, | |
52 | + text_id = #{textId}, | |
53 | + user_id = #{userId} | |
54 | + WHERE wd_book_id = #{wdBookId} | |
55 | + </update> | |
56 | + | |
57 | + <delete id="deleteWordBook" parameterType="string"> | |
58 | + DELETE FROM ai_lms.wordbook | |
59 | + WHERE wd_book_id = #{wdBookId} | |
60 | + </delete> | |
61 | + | |
62 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?