![](/assets/images/project_default_logo.png)
![](/assets/images/default-avatar-128.png)
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
@f2dc0eda18228da54e800e6495d2ceee6f2e47f7
--- gradle/wrapper/gradle-wrapper.properties
+++ gradle/wrapper/gradle-wrapper.properties
... | ... | @@ -1,7 +1,6 @@ |
1 |
+#Wed Jul 24 13:48:54 KST 2024 |
|
2 |
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip |
|
1 | 3 |
distributionBase=GRADLE_USER_HOME |
2 | 4 |
distributionPath=wrapper/dists |
3 |
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip |
|
4 |
-networkTimeout=10000 |
|
5 |
-validateDistributionUrl=true |
|
6 |
-zipStoreBase=GRADLE_USER_HOME |
|
7 | 5 |
zipStorePath=wrapper/dists |
6 |
+zipStoreBase=GRADLE_USER_HOME |
--- src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
+++ src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
... | ... | @@ -62,8 +62,14 @@ |
62 | 62 |
.requestMatchers( "/auth/**", "/auth/login.json").permitAll() // /user/** 경로는 모두 허용 |
63 | 63 |
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll() // swagger 진입 허용 |
64 | 64 |
.requestMatchers("/test/**").permitAll() |
65 |
+ .requestMatchers("/text/**").permitAll() // 지문 정보 진입 허용 |
|
66 |
+ .requestMatchers("/schedule/**").permitAll() // 학습일정 정보 진입 허용 |
|
65 | 67 |
.requestMatchers("/studentInfo/**").permitAll() // 학생 정보 진입 허용(민수) |
66 | 68 |
.requestMatchers("/board/**").permitAll() // 게시판 정보 진입 허용 |
69 |
+ .requestMatchers("/book/**").permitAll() // 교재 정보 진입 허용 |
|
70 |
+ .requestMatchers("/file/**").permitAll() // 파일 정보 진입 허용 |
|
71 |
+ .requestMatchers("/classes/**").permitAll() // 반 정보 진입 허용 |
|
72 |
+ .requestMatchers("/classBook/**").permitAll() // 반 - 책 정보 진입 허용 |
|
67 | 73 |
.requestMatchers("/unit/**").permitAll() |
68 | 74 |
.requestMatchers("/photo/**").permitAll() |
69 | 75 |
.anyRequest().authenticated()); // 나머지 경로는 인증 필요 |
--- src/main/java/com/takensoft/ai_lms/lms/board/web/BoardController.java
+++ src/main/java/com/takensoft/ai_lms/lms/board/web/BoardController.java
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 |
|
4 | 4 |
import com.takensoft.ai_lms.lms.board.service.BoardService; |
5 | 5 |
import com.takensoft.ai_lms.lms.board.vo.BoardVO; |
6 |
+import com.takensoft.ai_lms.lms.file.service.FileService; |
|
6 | 7 |
import lombok.RequiredArgsConstructor; |
7 | 8 |
import lombok.extern.slf4j.Slf4j; |
8 | 9 |
import org.springframework.http.HttpStatus; |
+++ src/main/java/com/takensoft/ai_lms/lms/book/dao/BookDAO.java
... | ... | @@ -0,0 +1,56 @@ |
1 | +package com.takensoft.ai_lms.lms.book.dao; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.book.vo.BookVO; | |
4 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * @author : 구자현 | |
10 | + * @since : 2024.07.25 | |
11 | + * | |
12 | + * 교재 관련 Mapper | |
13 | + */ | |
14 | +@Mapper("bookDAO") | |
15 | +public interface BookDAO { | |
16 | + | |
17 | + /** | |
18 | + * @author : 구자현 | |
19 | + * @since : 2024.07.25 | |
20 | + * | |
21 | + * 전체 교재 목록 출력 | |
22 | + */ | |
23 | + List<BookVO> getAllBooks(); | |
24 | + | |
25 | + /** | |
26 | + * @author : 구자현 | |
27 | + * @since : 2024.07.25 | |
28 | + * | |
29 | + * 책의 상세 정보 | |
30 | + */ | |
31 | + BookVO getBookById(String book_id); | |
32 | + | |
33 | + /** | |
34 | + * @author : 구자현 | |
35 | + * @since : 2024.07.25 | |
36 | + * | |
37 | + * 교재 등록 | |
38 | + */ | |
39 | + void insertBook(BookVO book); | |
40 | + | |
41 | + /** | |
42 | + * @author : 구자현 | |
43 | + * @since : 2024.07.25 | |
44 | + * | |
45 | + * 교재 제목 수정 | |
46 | + */ | |
47 | + void updateBook(BookVO book); | |
48 | + | |
49 | + /** | |
50 | + * @author : 구자현 | |
51 | + * @since : 2024.07.25 | |
52 | + * | |
53 | + * 교재 삭제 | |
54 | + */ | |
55 | + void deleteBook(String book_id); | |
56 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/book/service/BookService.java
... | ... | @@ -0,0 +1,53 @@ |
1 | +package com.takensoft.ai_lms.lms.book.service; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.book.vo.BookVO; | |
4 | +import java.util.List; | |
5 | + | |
6 | +/** | |
7 | + * @author : 구자현 | |
8 | + * @since : 2024.07.25 | |
9 | + * | |
10 | + * 교재 관련 Service 클래스 | |
11 | + */ | |
12 | +public interface BookService { | |
13 | + | |
14 | + /** | |
15 | + * @author : 구자현 | |
16 | + * @since : 2024.07.25 | |
17 | + * | |
18 | + * 전체 교재 목록 출력 | |
19 | + */ | |
20 | + List<BookVO> getAllBooks(); | |
21 | + | |
22 | + /** | |
23 | + * @author : 구자현 | |
24 | + * @since : 2024.07.25 | |
25 | + * | |
26 | + * 책의 상세 정보 | |
27 | + */ | |
28 | + BookVO getBookById(String book_id); | |
29 | + | |
30 | + /** | |
31 | + * @author : 구자현 | |
32 | + * @since : 2024.07.25 | |
33 | + * | |
34 | + * 교재 등록 | |
35 | + */ | |
36 | + void insertBook(BookVO book); | |
37 | + | |
38 | + /** | |
39 | + * @author : 구자현 | |
40 | + * @since : 2024.07.25 | |
41 | + * | |
42 | + * 교재 제목 수정 | |
43 | + */ | |
44 | + void updateBook(BookVO book); | |
45 | + | |
46 | + /** | |
47 | + * @author : 구자현 | |
48 | + * @since : 2024.07.25 | |
49 | + * | |
50 | + * 교재 삭제 | |
51 | + */ | |
52 | + void deleteBook(String book_id); | |
53 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/book/service/Impl/BookServiceImpl.java
... | ... | @@ -0,0 +1,82 @@ |
1 | +package com.takensoft.ai_lms.lms.book.service.Impl; | |
2 | + | |
3 | +import com.takensoft.ai_lms.common.idgen.service.IdgenService; | |
4 | +import com.takensoft.ai_lms.lms.book.dao.BookDAO; | |
5 | +import com.takensoft.ai_lms.lms.book.service.BookService; | |
6 | +import com.takensoft.ai_lms.lms.book.vo.BookVO; | |
7 | +import lombok.RequiredArgsConstructor; | |
8 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
9 | +import org.springframework.stereotype.Service; | |
10 | +import java.util.List; | |
11 | + | |
12 | +/** | |
13 | + * @author : 구자현 | |
14 | + * @since : 2024.07.25 | |
15 | + * | |
16 | + * 교재 관련 ServiceImpl 클래스 | |
17 | + */ | |
18 | +@Service | |
19 | +@RequiredArgsConstructor | |
20 | +public class BookServiceImpl extends EgovAbstractServiceImpl implements BookService { | |
21 | + | |
22 | + private final BookDAO bookDAO; | |
23 | + | |
24 | + private final IdgenService bookIdgn; | |
25 | + | |
26 | + /** | |
27 | + * @author : 구자현 | |
28 | + * @since : 2024.07.25 | |
29 | + * | |
30 | + * 전체 교재 목록 출력 | |
31 | + */ | |
32 | + @Override | |
33 | + public List<BookVO> getAllBooks() { | |
34 | + return bookDAO.getAllBooks(); | |
35 | + } | |
36 | + | |
37 | + /** | |
38 | + * @author : 구자현 | |
39 | + * @since : 2024.07.25 | |
40 | + * | |
41 | + * 책의 상세 정보 | |
42 | + */ | |
43 | + @Override | |
44 | + public BookVO getBookById(String book_id) { | |
45 | + return bookDAO.getBookById(book_id); | |
46 | + } | |
47 | + | |
48 | + /** | |
49 | + * @author : 구자현 | |
50 | + * @since : 2024.07.25 | |
51 | + * | |
52 | + * 교재 등록 | |
53 | + */ | |
54 | + @Override | |
55 | + public void insertBook(BookVO book) { | |
56 | + String book_id = bookIdgn.getNextStringId(); | |
57 | + book.setBook_id(book_id); | |
58 | + bookDAO.insertBook(book); | |
59 | + } | |
60 | + | |
61 | + /** | |
62 | + * @author : 구자현 | |
63 | + * @since : 2024.07.25 | |
64 | + * | |
65 | + * 교재 제목 수정 | |
66 | + */ | |
67 | + @Override | |
68 | + public void updateBook(BookVO book) { | |
69 | + bookDAO.updateBook(book); | |
70 | + } | |
71 | + | |
72 | + /** | |
73 | + * @author : 구자현 | |
74 | + * @since : 2024.07.25 | |
75 | + * | |
76 | + * 교재 삭제 | |
77 | + */ | |
78 | + @Override | |
79 | + public void deleteBook(String book_id) { | |
80 | + bookDAO.deleteBook(book_id); | |
81 | + } | |
82 | +}(No newline at end of file) |
+++ src/main/java/com/takensoft/ai_lms/lms/book/vo/BookVO.java
... | ... | @@ -0,0 +1,23 @@ |
1 | +package com.takensoft.ai_lms.lms.book.vo; | |
2 | + | |
3 | +import lombok.AllArgsConstructor; | |
4 | +import lombok.Getter; | |
5 | +import lombok.NoArgsConstructor; | |
6 | +import lombok.Setter; | |
7 | + | |
8 | +/** | |
9 | + * @author : 구자현 | |
10 | + * @since : 2024.07.25 | |
11 | + * | |
12 | + * 교재 관련 VO | |
13 | + */ | |
14 | +@Setter | |
15 | +@Getter | |
16 | +@NoArgsConstructor | |
17 | +@AllArgsConstructor | |
18 | +public class BookVO { | |
19 | + // 교재 아이디 | |
20 | + private String book_id; | |
21 | + // 교재 제목 | |
22 | + private String book_nm; | |
23 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/book/web/BookController.java
... | ... | @@ -0,0 +1,77 @@ |
1 | +package com.takensoft.ai_lms.lms.book.web; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.book.service.Impl.BookServiceImpl; | |
4 | +import com.takensoft.ai_lms.lms.book.vo.BookVO; | |
5 | +import lombok.RequiredArgsConstructor; | |
6 | +import org.springframework.web.bind.annotation.*; | |
7 | + | |
8 | +import java.util.List; | |
9 | + | |
10 | +/** | |
11 | + * @author : 구자현 | |
12 | + * @since : 2024.07.25 | |
13 | + * | |
14 | + * 교재 관련 Controller 클래스 | |
15 | + */ | |
16 | +@RequiredArgsConstructor | |
17 | +@RestController | |
18 | +@RequestMapping("/book") | |
19 | +public class BookController { | |
20 | + | |
21 | + private final BookServiceImpl bookServiceImpl; | |
22 | + | |
23 | + /** | |
24 | + * @author : 구자현 | |
25 | + * @since : 2024.07.25 | |
26 | + * | |
27 | + * 전체 교재 목록 출력 | |
28 | + */ | |
29 | + @GetMapping | |
30 | + public List<BookVO> getAllBooks() { | |
31 | + return bookServiceImpl.getAllBooks(); | |
32 | + } | |
33 | + | |
34 | + /** | |
35 | + * @author : 구자현 | |
36 | + * @since : 2024.07.25 | |
37 | + * | |
38 | + * 책의 상세 정보 | |
39 | + */ | |
40 | + @GetMapping("/{book_id}") | |
41 | + public BookVO getBookById(@PathVariable String book_id) { | |
42 | + return bookServiceImpl.getBookById(book_id); | |
43 | + } | |
44 | + | |
45 | + /** | |
46 | + * @author : 구자현 | |
47 | + * @since : 2024.07.25 | |
48 | + * | |
49 | + * 교재 등록 | |
50 | + */ | |
51 | + @PostMapping | |
52 | + public void insertBook(@RequestBody BookVO book) { | |
53 | + bookServiceImpl.insertBook(book); | |
54 | + } | |
55 | + | |
56 | + /** | |
57 | + * @author : 구자현 | |
58 | + * @since : 2024.07.25 | |
59 | + * | |
60 | + * 교재 제목 수정 | |
61 | + */ | |
62 | + @PutMapping | |
63 | + public void updateBook(@RequestBody BookVO book) { | |
64 | + bookServiceImpl.updateBook(book); | |
65 | + } | |
66 | + | |
67 | + /** | |
68 | + * @author : 구자현 | |
69 | + * @since : 2024.07.25 | |
70 | + * | |
71 | + * 교재 삭제 | |
72 | + */ | |
73 | + @DeleteMapping("/{book_id}") | |
74 | + public void deleteBook(@PathVariable String book_id) { | |
75 | + bookServiceImpl.deleteBook(book_id); | |
76 | + } | |
77 | +}(No newline at end of file) |
+++ src/main/java/com/takensoft/ai_lms/lms/class_book/dao/ClassBookDAO.java
... | ... | @@ -0,0 +1,22 @@ |
1 | +package com.takensoft.ai_lms.lms.class_book.dao; | |
2 | + | |
3 | + | |
4 | +import com.takensoft.ai_lms.lms.class_book.vo.ClassBookVO; | |
5 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
6 | + | |
7 | +/** | |
8 | + * @author : 박세훈 | |
9 | + * since : 2024.07.20 | |
10 | + * | |
11 | + * class - book관련 Mapper | |
12 | + */ | |
13 | + | |
14 | +@Mapper("classBookDAO") | |
15 | +public interface ClassBookDAO { | |
16 | + | |
17 | + // 책 등록 | |
18 | + int registerBook(ClassBookVO classBookVO) throws Exception; | |
19 | + | |
20 | + // 책 삭제 | |
21 | + int deleteClassBook(ClassBookVO classBookVO) throws Exception; | |
22 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/class_book/service/ClassBookService.java
... | ... | @@ -0,0 +1,20 @@ |
1 | +package com.takensoft.ai_lms.lms.class_book.service; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.class_book.vo.ClassBookVO; | |
4 | + | |
5 | + | |
6 | +/** | |
7 | + * @author : 박세훈 | |
8 | + * since : 2024.07.20 | |
9 | + * | |
10 | + * class - book관련 Service | |
11 | + */ | |
12 | + | |
13 | +public interface ClassBookService { | |
14 | + | |
15 | + // 책 등록 | |
16 | + int registerBook(ClassBookVO classBookVO) throws Exception; | |
17 | + | |
18 | + // 책 삭제 | |
19 | + int deleteClassBook(ClassBookVO classBookVO) throws Exception; | |
20 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/class_book/service/Impl/ClassBookServiceImpl.java
... | ... | @@ -0,0 +1,32 @@ |
1 | +package com.takensoft.ai_lms.lms.class_book.service.Impl; | |
2 | + | |
3 | + | |
4 | +import com.takensoft.ai_lms.lms.class_book.dao.ClassBookDAO; | |
5 | +import com.takensoft.ai_lms.lms.class_book.service.ClassBookService; | |
6 | +import com.takensoft.ai_lms.lms.class_book.vo.ClassBookVO; | |
7 | +import lombok.RequiredArgsConstructor; | |
8 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
9 | +import org.springframework.stereotype.Service; | |
10 | + | |
11 | + | |
12 | +/** | |
13 | + * @author : 박세훈 | |
14 | + * since : 2024.07.20 | |
15 | + * | |
16 | + * class - book관련 ServiceImpl | |
17 | + */ | |
18 | +@Service("classBookService") | |
19 | +@RequiredArgsConstructor | |
20 | +public class ClassBookServiceImpl extends EgovAbstractServiceImpl implements ClassBookService { | |
21 | + | |
22 | + private final ClassBookDAO classBookDAO; | |
23 | + | |
24 | + @Override | |
25 | + public int registerBook(ClassBookVO classBookVO) throws Exception { | |
26 | + return classBookDAO.registerBook(classBookVO); | |
27 | + } | |
28 | + @Override | |
29 | + public int deleteClassBook(ClassBookVO classBookVO) throws Exception { | |
30 | + return classBookDAO.deleteClassBook(classBookVO); | |
31 | + } | |
32 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/class_book/vo/ClassBookVO.java
... | ... | @@ -0,0 +1,20 @@ |
1 | +package com.takensoft.ai_lms.lms.class_book.vo; | |
2 | + | |
3 | + | |
4 | +import lombok.AllArgsConstructor; | |
5 | +import lombok.Getter; | |
6 | +import lombok.NoArgsConstructor; | |
7 | +import lombok.Setter; | |
8 | + | |
9 | +@Getter | |
10 | +@Setter | |
11 | +@AllArgsConstructor | |
12 | +@NoArgsConstructor | |
13 | +public class ClassBookVO { | |
14 | + // 반 아이디 | |
15 | + private String sclsId; | |
16 | + | |
17 | + // 책 아이디 | |
18 | + private String bookId; | |
19 | + | |
20 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/class_book/web/ClassBookController.java
... | ... | @@ -0,0 +1,67 @@ |
1 | +package com.takensoft.ai_lms.lms.class_book.web; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.class_book.service.ClassBookService; | |
4 | +import com.takensoft.ai_lms.lms.class_book.vo.ClassBookVO; | |
5 | +import lombok.RequiredArgsConstructor; | |
6 | +import org.springframework.web.bind.annotation.*; | |
7 | + | |
8 | +import java.util.HashMap; | |
9 | + | |
10 | +@RestController | |
11 | +@RequiredArgsConstructor | |
12 | +@RequestMapping(value = "/classBook") | |
13 | +public class ClassBookController { | |
14 | + | |
15 | + private final ClassBookService classBookService; | |
16 | + | |
17 | + /** | |
18 | + * @author 박세훈 | |
19 | + * @since 2024.07.29 | |
20 | + * param ClassBookDAO | |
21 | + * @return | |
22 | + * @throws Exception | |
23 | + * | |
24 | + * 반 책 등록 | |
25 | + */ | |
26 | + @PostMapping("/register.json") | |
27 | + public String registerBook(@RequestBody ClassBookVO classBookVO) throws Exception { | |
28 | + try { | |
29 | + int result = classBookService.registerBook(classBookVO); | |
30 | + if (result > 0) { | |
31 | + return "success"; | |
32 | + } else { | |
33 | + return "fail"; | |
34 | + } | |
35 | + } catch (Exception e) { | |
36 | + e.printStackTrace(); | |
37 | + return "Error"; | |
38 | + } | |
39 | + } | |
40 | + | |
41 | + | |
42 | + /** | |
43 | + * @author 박세훈 | |
44 | + * @since 2024.07.29 | |
45 | + * param ClassBookDAO | |
46 | + * @return | |
47 | + * @throws Exception | |
48 | + * | |
49 | + * 반 책 삭제 | |
50 | + */ | |
51 | + @DeleteMapping("/deleteClassBook.json") | |
52 | + public String deleteClassBook(@RequestBody ClassBookVO classBookVO) throws Exception { | |
53 | + try { | |
54 | + int result = classBookService.deleteClassBook(classBookVO); | |
55 | + System.out.println("result = " + result); | |
56 | + if (result > 0) { | |
57 | + return "success"; | |
58 | + } else { | |
59 | + return "fail"; | |
60 | + } | |
61 | + } catch (Exception e) { | |
62 | + e.printStackTrace(); | |
63 | + return "Error"; | |
64 | + } | |
65 | + } | |
66 | + | |
67 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/classes/dao/ClassDAO.java
... | ... | @@ -0,0 +1,30 @@ |
1 | +package com.takensoft.ai_lms.lms.classes.dao; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.classes.vo.ClassVO; | |
4 | +import org.apache.ibatis.annotations.Mapper; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * @author : 정다정 | |
10 | + * @since : 2024.07.25 | |
11 | + * | |
12 | + * 반 관련 Mapper | |
13 | + */ | |
14 | +@Mapper() | |
15 | +public interface ClassDAO { | |
16 | + // 반 조회 | |
17 | + public List<ClassVO> selectClass(String userId) throws Exception; | |
18 | + | |
19 | + // 반 생성 | |
20 | + public int insertClass(ClassVO classVO) throws Exception; | |
21 | + | |
22 | + // 반 수정 | |
23 | + public int updateClass(ClassVO classVO) throws Exception; | |
24 | + | |
25 | + // 반 삭체 | |
26 | + public int deleteClass(String sclsId) throws Exception; | |
27 | + | |
28 | + // 반 아이디(scls_id) 존재 확인 | |
29 | + public int existsClassById(String sclsId) throws Exception; | |
30 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/classes/service/ClassService.java
... | ... | @@ -0,0 +1,28 @@ |
1 | +package com.takensoft.ai_lms.lms.classes.service; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.classes.vo.ClassVO; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author : 정다정 | |
9 | + * since : 2024.07.25 | |
10 | + * | |
11 | + * 반 조회 관련 인터페이스 | |
12 | + */ | |
13 | +public interface ClassService { | |
14 | + // 반 조회 | |
15 | + public List<ClassVO> selectClass(String userId) throws Exception; | |
16 | + | |
17 | + // 반 생성 | |
18 | + public int insertClass(ClassVO classVO) throws Exception; | |
19 | + | |
20 | + // 반 수정 | |
21 | + public int updateClass(ClassVO classVO) throws Exception; | |
22 | + | |
23 | + // 반 삭제 | |
24 | + public int deleteClass(String sclsId) throws Exception; | |
25 | + | |
26 | + // 반 아이디(scls_id) 존재 확인 | |
27 | + boolean existsClassById(String sclsId) throws Exception; | |
28 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/classes/service/Impl/ClassServiceImpl.java
... | ... | @@ -0,0 +1,67 @@ |
1 | +package com.takensoft.ai_lms.lms.classes.service.Impl; | |
2 | + | |
3 | +import com.takensoft.ai_lms.common.idgen.service.IdgenService; | |
4 | +import com.takensoft.ai_lms.lms.classes.dao.ClassDAO; | |
5 | +import com.takensoft.ai_lms.lms.classes.service.ClassService; | |
6 | +import com.takensoft.ai_lms.lms.classes.vo.ClassVO; | |
7 | +import lombok.RequiredArgsConstructor; | |
8 | +import org.springframework.stereotype.Service; | |
9 | +import org.springframework.transaction.annotation.Transactional; | |
10 | + | |
11 | +import java.util.List; | |
12 | + | |
13 | +@Service | |
14 | +@RequiredArgsConstructor | |
15 | +public class ClassServiceImpl implements ClassService { | |
16 | + | |
17 | + private final ClassDAO classDAO; | |
18 | + | |
19 | + private final IdgenService classIdgn; | |
20 | + | |
21 | + /** | |
22 | + * 반 조회 | |
23 | + */ | |
24 | + @Override | |
25 | + @Transactional | |
26 | + public List<ClassVO> selectClass(String userId) throws Exception{ | |
27 | + return classDAO.selectClass(userId); | |
28 | + } | |
29 | + | |
30 | + /** | |
31 | + * 반 생성 | |
32 | + */ | |
33 | + @Override | |
34 | + @Transactional | |
35 | + public int insertClass(ClassVO classVO) throws Exception{ | |
36 | + String sclsId = classIdgn.getNextStringId(); | |
37 | + classVO.setSclsId(sclsId); | |
38 | + return classDAO.insertClass(classVO); | |
39 | + } | |
40 | + | |
41 | + /** | |
42 | + * 반 수정 | |
43 | + */ | |
44 | + @Override | |
45 | + @Transactional | |
46 | + public int updateClass(ClassVO classVO) throws Exception{ | |
47 | + return classDAO.updateClass(classVO); | |
48 | + } | |
49 | + | |
50 | + /** | |
51 | + * 반 삭제 | |
52 | + */ | |
53 | + @Override | |
54 | + @Transactional | |
55 | + public int deleteClass(String sclsId) throws Exception { | |
56 | + return classDAO.deleteClass(sclsId); | |
57 | + } | |
58 | + | |
59 | + /** | |
60 | + * 반 아이디(scls_id) 존재 확인 | |
61 | + */ | |
62 | + @Override | |
63 | + @Transactional | |
64 | + public boolean existsClassById(String sclsId) throws Exception { | |
65 | + return classDAO.existsClassById(sclsId) > 0; | |
66 | + } | |
67 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/classes/vo/ClassVO.java
... | ... | @@ -0,0 +1,20 @@ |
1 | +package com.takensoft.ai_lms.lms.classes.vo; | |
2 | + | |
3 | +import lombok.AllArgsConstructor; | |
4 | +import lombok.Getter; | |
5 | +import lombok.NoArgsConstructor; | |
6 | +import lombok.Setter; | |
7 | + | |
8 | +@Setter | |
9 | +@Getter | |
10 | +@NoArgsConstructor | |
11 | +@AllArgsConstructor | |
12 | + | |
13 | +public class ClassVO { | |
14 | + // 반 아이디 | |
15 | + public String sclsId; | |
16 | + // 사용자 아이디(선생) | |
17 | + public String userId; | |
18 | + // 반 이름 | |
19 | + public String sclsNm; | |
20 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/classes/web/ClassController.java
... | ... | @@ -0,0 +1,174 @@ |
1 | +package com.takensoft.ai_lms.lms.classes.web; | |
2 | + | |
3 | +import com.google.gson.Gson; | |
4 | +import com.google.gson.JsonObject; | |
5 | +import com.takensoft.ai_lms.lms.classes.service.ClassService; | |
6 | +import com.takensoft.ai_lms.lms.classes.vo.ClassVO; | |
7 | +import io.swagger.v3.oas.annotations.Operation; | |
8 | +import lombok.RequiredArgsConstructor; | |
9 | +import lombok.extern.slf4j.Slf4j; | |
10 | +import org.springframework.web.bind.annotation.*; | |
11 | + | |
12 | +import java.util.List; | |
13 | +import java.util.Map; | |
14 | + | |
15 | +@RestController | |
16 | +@RequiredArgsConstructor | |
17 | +@Slf4j | |
18 | +@RequestMapping(value="/classes") | |
19 | +public class ClassController { | |
20 | + | |
21 | + private final ClassService classService; | |
22 | + | |
23 | + /** | |
24 | + * @author 정다정 | |
25 | + * @since 2024.07.25 | |
26 | + * param ClassDAO | |
27 | + * @return | |
28 | + * @throws Exception | |
29 | + * | |
30 | + * 반 조회 | |
31 | + */ | |
32 | + @PostMapping("/selectClass.json") | |
33 | + @Operation(summary = "반 조회") | |
34 | + public String selectClass(@RequestBody Map<String, Object> params) throws Exception { | |
35 | + Gson gson = new Gson(); | |
36 | + JsonObject response = new JsonObject(); | |
37 | + | |
38 | + try { | |
39 | + String userId = params.get("userId").toString(); | |
40 | + List<ClassVO> result = classService.selectClass(userId); | |
41 | + | |
42 | + response.addProperty("status", "success"); | |
43 | + response.add("data", gson.toJsonTree(result)); | |
44 | + | |
45 | + return gson.toJson(response); | |
46 | + } catch (Exception e) { | |
47 | + e.printStackTrace(); | |
48 | + | |
49 | + response.addProperty("status", "error"); | |
50 | + response.addProperty("message", e.getMessage()); | |
51 | + | |
52 | + return gson.toJson(response); | |
53 | + } | |
54 | + } | |
55 | + | |
56 | + /** | |
57 | + * @author 정다정 | |
58 | + * @since 2024.07.25 | |
59 | + * param ClassDAO | |
60 | + * @return | |
61 | + * @throws Exception | |
62 | + * | |
63 | + * 반 생성 | |
64 | + */ | |
65 | + @PostMapping("/insertClass.json") | |
66 | + @Operation(summary = "반 생성") | |
67 | + public String insertClass(@RequestBody ClassVO classVO) throws Exception{ | |
68 | + Gson gson = new Gson(); | |
69 | + JsonObject response = new JsonObject(); | |
70 | + | |
71 | + try{ | |
72 | + // userId 또는 sclsNm(반 이름)이 비어있으면 fail | |
73 | + if (classVO.getUserId() == null || classVO.getUserId().isEmpty() || | |
74 | + classVO.getSclsNm() == null || classVO.getSclsNm().isEmpty()) { | |
75 | + response.addProperty("status", "fail"); | |
76 | + response.addProperty("message", "userId 또는 반 이름이 비어있습니다."); | |
77 | + return gson.toJson(response); | |
78 | + } | |
79 | + | |
80 | + int result = classService.insertClass(classVO); | |
81 | + | |
82 | + if(result == -1){ | |
83 | + response.addProperty("status", "fail"); | |
84 | + return gson.toJson(response); | |
85 | + } | |
86 | + | |
87 | + response.addProperty("status", "success"); | |
88 | + return gson.toJson(response); | |
89 | + } catch (Exception e) { | |
90 | + e.printStackTrace(); | |
91 | + | |
92 | + response.addProperty("status", "error"); | |
93 | + response.addProperty("message", e.getMessage()); | |
94 | + | |
95 | + return gson.toJson(response); | |
96 | + } | |
97 | + } | |
98 | + | |
99 | + /** | |
100 | + * @author 정다정 | |
101 | + * @since 2024.07.25 | |
102 | + * param ClassDAO | |
103 | + * @return | |
104 | + * @throws Exception | |
105 | + * | |
106 | + * 반 수정 | |
107 | + */ | |
108 | + @PostMapping("/updateClass.json") | |
109 | + @Operation(summary = "반 수정") | |
110 | + public String updateClass(@RequestBody ClassVO classVO) throws Exception{ | |
111 | + Gson gson = new Gson(); | |
112 | + JsonObject response = new JsonObject(); | |
113 | + | |
114 | + try{ | |
115 | + // 반 아이디(scls_id)가 존재하는지 확인 | |
116 | + if (!classService.existsClassById(classVO.getSclsId())) { | |
117 | + // 반 아이디(scls_id)가 db에 존재 하지 않으면 수정 실패 | |
118 | + response.addProperty("status", "fail"); | |
119 | + response.addProperty("message", "존재 하지 않는 반 아이디(sclsId)입니다."); | |
120 | + return gson.toJson(response); | |
121 | + } | |
122 | + | |
123 | + int result = classService.updateClass(classVO); | |
124 | + | |
125 | + if(result == -1){ | |
126 | + response.addProperty("status", "fail"); | |
127 | + return gson.toJson(response); | |
128 | + } | |
129 | + | |
130 | + response.addProperty("status", "success"); | |
131 | + return gson.toJson(response); | |
132 | + } catch (Exception e) { | |
133 | + e.printStackTrace(); | |
134 | + | |
135 | + response.addProperty("status", "error"); | |
136 | + response.addProperty("message", e.getMessage()); | |
137 | + | |
138 | + return gson.toJson(response); | |
139 | + } | |
140 | + } | |
141 | + | |
142 | + | |
143 | + /** | |
144 | + * @author 정다정 | |
145 | + * @since 2024.07.25 | |
146 | + * param ClassDAO | |
147 | + * @return | |
148 | + * @throws Exception | |
149 | + * | |
150 | + * 반 삭제 | |
151 | + */ | |
152 | + @DeleteMapping("/deleteClass.json") | |
153 | + @Operation(summary = "반 삭제") | |
154 | + public String deleteClass(@RequestBody Map<String, Object> params) throws Exception{ | |
155 | + Gson gson = new Gson(); | |
156 | + JsonObject response = new JsonObject(); | |
157 | + | |
158 | + try { | |
159 | + String sclsId = params.get("sclsId").toString(); | |
160 | + classService.deleteClass(sclsId); | |
161 | + response.addProperty("status", "success"); | |
162 | + return gson.toJson(response); | |
163 | + } catch (Exception e) { | |
164 | + e.printStackTrace(); | |
165 | + | |
166 | + response.addProperty("status", "error"); | |
167 | + response.addProperty("message", e.getMessage()); | |
168 | + | |
169 | + return gson.toJson(response); | |
170 | + } | |
171 | + } | |
172 | + | |
173 | + | |
174 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/file/dao/FileDAO.java
... | ... | @@ -0,0 +1,22 @@ |
1 | +package com.takensoft.ai_lms.lms.file.dao; | |
2 | + | |
3 | + | |
4 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
5 | + | |
6 | +import java.util.HashMap; | |
7 | +import java.util.List; | |
8 | + | |
9 | +/** | |
10 | + * @author : 홍아랑 | |
11 | + * since : 2024.07.26 | |
12 | + * | |
13 | + * 파일 관련 Mapper | |
14 | + */ | |
15 | + | |
16 | +@Mapper("FileDAO") | |
17 | + | |
18 | +public interface FileDAO { | |
19 | + | |
20 | + // 파일 정보 조회 | |
21 | + List<HashMap<String, Object>> findByFileId(HashMap<String, Object> params) throws Exception; | |
22 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/file/service/FileService.java
... | ... | @@ -0,0 +1,16 @@ |
1 | +package com.takensoft.ai_lms.lms.file.service; | |
2 | + | |
3 | + | |
4 | +import java.util.HashMap; | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author : 홍아랑 | |
9 | + * since : 2024.07.26 | |
10 | + * | |
11 | + * 파일 관련 Service | |
12 | + */ | |
13 | +public interface FileService { | |
14 | + // 파일 정보 조회 | |
15 | + List<HashMap<String, Object>> findByFileId(HashMap<String, Object> params) throws Exception; | |
16 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/file/service/impl/FileServiceImpl.java
... | ... | @@ -0,0 +1,22 @@ |
1 | +package com.takensoft.ai_lms.lms.file.service.impl; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.file.dao.FileDAO; | |
4 | +import com.takensoft.ai_lms.lms.file.service.FileService; | |
5 | +import lombok.RequiredArgsConstructor; | |
6 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.HashMap; | |
10 | +import java.util.List; | |
11 | + | |
12 | +@Service("FileService") | |
13 | +@RequiredArgsConstructor | |
14 | +public class FileServiceImpl extends EgovAbstractServiceImpl implements FileService { | |
15 | + private final FileDAO fileDAO; | |
16 | + | |
17 | + // 파일 정보 조회 | |
18 | + // @Override | |
19 | + public List<HashMap<String, Object>> findByFileId(HashMap<String, Object> params) throws Exception { | |
20 | + return fileDAO.findByFileId(params); | |
21 | + } | |
22 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/file/vo/FileVO.java
... | ... | @@ -0,0 +1,46 @@ |
1 | +package com.takensoft.ai_lms.lms.file.vo; | |
2 | + | |
3 | +import lombok.AllArgsConstructor; | |
4 | +import lombok.Getter; | |
5 | +import lombok.NoArgsConstructor; | |
6 | +import lombok.Setter; | |
7 | + | |
8 | +/** | |
9 | + * @author : 홍아랑 | |
10 | + * since : 2024.07.26 | |
11 | + * | |
12 | + * 파일 관련 VO | |
13 | + */ | |
14 | + | |
15 | + | |
16 | + | |
17 | +@Getter | |
18 | +@Setter | |
19 | +@AllArgsConstructor | |
20 | +@NoArgsConstructor | |
21 | +public class FileVO { | |
22 | + | |
23 | + // 파일 아이디 | |
24 | + private String fileId; | |
25 | + // 파일 관리 아이디 | |
26 | + private String fileMngId; | |
27 | + // 파일명 | |
28 | + private String fileNm; | |
29 | + // 마스크명 | |
30 | + private String fileEncptNm; | |
31 | + // 절대 경로 | |
32 | + private String fileApath; | |
33 | + // 상대 경로 | |
34 | + private String fileRpath; | |
35 | + // 확장자 | |
36 | + private String fileExtn; | |
37 | + // 파일 크기 | |
38 | + private String fileSz; | |
39 | + // 파일 타입 | |
40 | + private String fileClsf; | |
41 | + // 등록자 | |
42 | + private String reg; | |
43 | + // 등록 일자 | |
44 | + private String regDt; | |
45 | + | |
46 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/file/web/FileController.java
... | ... | @@ -0,0 +1,39 @@ |
1 | +package com.takensoft.ai_lms.lms.file.web; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.file.service.FileService; | |
4 | +import lombok.RequiredArgsConstructor; | |
5 | +import org.springframework.http.HttpStatus; | |
6 | +import org.springframework.http.ResponseEntity; | |
7 | +import org.springframework.web.bind.annotation.PostMapping; | |
8 | +import org.springframework.web.bind.annotation.RequestBody; | |
9 | +import org.springframework.web.bind.annotation.RequestMapping; | |
10 | +import org.springframework.web.bind.annotation.RestController; | |
11 | + | |
12 | +import java.util.HashMap; | |
13 | + | |
14 | +/** | |
15 | + * @author : 홍아랑 | |
16 | + * since : 2024.07.26 | |
17 | + * 파일 관련 Controller | |
18 | + */ | |
19 | +@RestController | |
20 | +//@Slf4j | |
21 | +@RequiredArgsConstructor | |
22 | +@RequestMapping(value = "/file") | |
23 | +public class FileController { | |
24 | + private final FileService fileService; | |
25 | + | |
26 | + /** | |
27 | + * @author 홍아랑 | |
28 | + * @since 2024.07.26 | |
29 | + * | |
30 | + * 파일 정보 조회 | |
31 | + */ | |
32 | + @PostMapping("/find.json") | |
33 | + public ResponseEntity<?> findByFileId(@RequestBody HashMap<String, Object> params) throws Exception { | |
34 | + HashMap<String, Object> result = new HashMap<>(); | |
35 | + | |
36 | + result.put("list", fileService.findByFileId(params)); | |
37 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
38 | + } | |
39 | +} |
--- src/main/java/com/takensoft/ai_lms/lms/student/dao/StudentInfoDAO.java
+++ src/main/java/com/takensoft/ai_lms/lms/student/dao/StudentInfoDAO.java
... | ... | @@ -4,6 +4,8 @@ |
4 | 4 |
import org.apache.ibatis.annotations.Param; |
5 | 5 |
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; |
6 | 6 |
|
7 |
+import java.util.List; |
|
8 |
+ |
|
7 | 9 |
/** |
8 | 10 |
* @author 권민수 |
9 | 11 |
* @since 2024.07.25 |
--- src/main/java/com/takensoft/ai_lms/lms/student/service/Impl/StudentInfoServiceImpl.java
+++ src/main/java/com/takensoft/ai_lms/lms/student/service/Impl/StudentInfoServiceImpl.java
... | ... | @@ -6,6 +6,8 @@ |
6 | 6 |
import lombok.RequiredArgsConstructor; |
7 | 7 |
import org.springframework.stereotype.Service; |
8 | 8 |
|
9 |
+import java.util.List; |
|
10 |
+ |
|
9 | 11 |
/** |
10 | 12 |
* @author 권민수 |
11 | 13 |
* @since 2024.07.25 |
+++ src/main/java/com/takensoft/ai_lms/lms/student/vo/HistoryVO.java
... | ... | @@ -0,0 +1,25 @@ |
1 | +package com.takensoft.ai_lms.lms.student.vo; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.Setter; | |
5 | + | |
6 | +import java.sql.Timestamp; | |
7 | + | |
8 | +/** | |
9 | + * @author 권민수 | |
10 | + * @since 2024.07.26 | |
11 | + * | |
12 | + * 학생 최근 학습 정보 VO 클래스 | |
13 | + */ | |
14 | + | |
15 | +@Getter | |
16 | +@Setter | |
17 | +public class HistoryVO { | |
18 | + | |
19 | + private String bookId; | |
20 | + private String bookName; | |
21 | + private String unitId; | |
22 | + private String unitName; | |
23 | + private String completionTime; | |
24 | + | |
25 | +} |
--- src/main/java/com/takensoft/ai_lms/lms/student/vo/StudentInfoVO.java
+++ src/main/java/com/takensoft/ai_lms/lms/student/vo/StudentInfoVO.java
... | ... | @@ -3,6 +3,8 @@ |
3 | 3 |
import lombok.Getter; |
4 | 4 |
import lombok.Setter; |
5 | 5 |
|
6 |
+import java.util.List; |
|
7 |
+ |
|
6 | 8 |
/** |
7 | 9 |
* @author 권민수 |
8 | 10 |
* @since 2024.07.25 |
... | ... | @@ -10,14 +12,17 @@ |
10 | 12 |
* 학생 불러오는 정보 VO 클래스 |
11 | 13 |
*/ |
12 | 14 |
|
13 |
-@Setter |
|
14 | 15 |
@Getter |
16 |
+@Setter |
|
15 | 17 |
public class StudentInfoVO { |
18 |
+ |
|
16 | 19 |
private String studentName; |
17 | 20 |
private String institutionName; |
18 |
- private String grade; |
|
21 |
+ private int grade; |
|
19 | 22 |
private String className; |
20 | 23 |
private String studentQuestion; |
24 |
+ private int totalProblemsSolved; |
|
25 |
+ private List<HistoryVO> history; |
|
21 | 26 |
|
22 | 27 |
} |
23 | 28 |
|
+++ src/main/java/com/takensoft/ai_lms/lms/text/dao/TextDAO.java
... | ... | @@ -0,0 +1,37 @@ |
1 | +package com.takensoft.ai_lms.lms.text.dao; | |
2 | + | |
3 | +import com.takensoft.ai_lms.lms.text.vo.TextVO; | |
4 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
5 | + | |
6 | +import java.util.HashMap; | |
7 | +import java.util.List; | |
8 | + | |
9 | +/** | |
10 | + * @author : 이은진 | |
11 | + * @since : 2024.07.25 | |
12 | + * | |
13 | + * 지문 관련 Mapper | |
14 | + */ | |
15 | +@Mapper("TextDAO") | |
16 | +public interface TextDAO { | |
17 | + // 지문 등록 | |
18 | + int insertText(TextVO TextVO) throws Exception; | |
19 | + | |
20 | + // 지문 리스트 조회 | |
21 | + List<HashMap<String, Object>> selectTextList(HashMap<String, Object> params) throws Exception; | |
22 | + | |
23 | + // 지문 수 조회 | |
24 | + int textCount(HashMap<String, Object> params) throws Exception; | |
25 | + | |
26 | + // 지문 출력 | |
27 | + List<HashMap<String, Object>> selectOneText(HashMap<String, Object> params) throws Exception; | |
28 | + | |
29 | + // 지문 수정 | |
30 | + int textUpdate(TextVO TextVO) throws Exception; | |
31 | + | |
32 | + // 지문 삭제 | |
33 | + int textDelete(String textId) throws Exception; | |
34 | + | |
35 | + // 지문 검색 | |
36 | + List<HashMap<String, Object>> searchText(HashMap<String, Object> params) throws Exception; | |
37 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/text/service/Impl/TextServiceImpl.java
... | ... | @@ -0,0 +1,92 @@ |
1 | +package com.takensoft.ai_lms.lms.text.service.Impl; | |
2 | + | |
3 | +import com.takensoft.ai_lms.common.idgen.service.IdgenService; | |
4 | +import com.takensoft.ai_lms.lms.text.dao.TextDAO; | |
5 | +import com.takensoft.ai_lms.lms.text.service.TextService; | |
6 | +import com.takensoft.ai_lms.lms.text.vo.TextVO; | |
7 | +import lombok.RequiredArgsConstructor; | |
8 | +import org.springframework.stereotype.Service; | |
9 | +import org.springframework.transaction.annotation.Transactional; | |
10 | +import org.springframework.web.servlet.ModelAndView; | |
11 | + | |
12 | +import java.util.HashMap; | |
13 | +import java.util.List; | |
14 | + | |
15 | +/** | |
16 | + * @author : 이은진 | |
17 | + * @since : 2024.07.25 | |
18 | + */ | |
19 | + | |
20 | +@Service("textService") | |
21 | +@RequiredArgsConstructor | |
22 | +public class TextServiceImpl implements TextService { | |
23 | + | |
24 | + private final TextDAO textDAO; | |
25 | + private final IdgenService textIdgn; | |
26 | + | |
27 | + /** | |
28 | + * 지문 등록 | |
29 | + */ | |
30 | + @Override | |
31 | + @Transactional | |
32 | + public int insertText(TextVO textVO) throws Exception { | |
33 | + String textID = textIdgn.getNextStringId(); | |
34 | + textVO.setTextId(textID); | |
35 | + return textDAO.insertText(textVO); | |
36 | + } | |
37 | + | |
38 | + /** | |
39 | + * 지문 리스트 조회 | |
40 | + */ | |
41 | + @Override | |
42 | + public List<HashMap<String, Object>> selectTextList(HashMap<String, Object> params) throws Exception { | |
43 | + int page = Integer.parseInt(params.get("page").toString()); | |
44 | + int pageSize = Integer.parseInt(params.get("pageSize").toString()); | |
45 | + | |
46 | + int startIndex = (page - 1) * pageSize; | |
47 | + params.put("startIndex", startIndex); | |
48 | + params.put("pageSize", pageSize); | |
49 | + return textDAO.selectTextList(params); | |
50 | + } | |
51 | + | |
52 | + /** | |
53 | + * 지문 수 조회 | |
54 | + */ | |
55 | + @Override | |
56 | + public int textCount(HashMap<String, Object> params) throws Exception { | |
57 | + return textDAO.textCount(params); | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * 지문 출력 | |
62 | + */ | |
63 | + @Override | |
64 | + public List<HashMap<String, Object>> selectOneText(HashMap<String, Object> params) throws Exception { | |
65 | + return textDAO.selectOneText(params); | |
66 | + } | |
67 | + | |
68 | + /** | |
69 | + * 지문 수정 | |
70 | + */ | |
71 | + @Override | |
72 | + public int textUpdate(TextVO textVO) throws Exception { | |
73 | + return textDAO.textUpdate(textVO); | |
74 | + } | |
75 | + | |
76 | + /** | |
77 | + * 지문 삭제 | |
78 | + */ | |
79 | + @Override | |
80 | + public int textDelete(String textId) throws Exception { | |
81 | + return textDAO.textDelete(textId); | |
82 | + } | |
83 | + | |
84 | + | |
85 | + /** | |
86 | + * 지문 검색 | |
87 | + */ | |
88 | + @Override | |
89 | + public List<HashMap<String, Object>> searchText(HashMap<String, Object> params) throws Exception { | |
90 | + return textDAO.searchText(params); | |
91 | + } | |
92 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/text/service/TextService.java
... | ... | @@ -0,0 +1,35 @@ |
1 | +package com.takensoft.ai_lms.lms.text.service; | |
2 | +import com.takensoft.ai_lms.lms.text.vo.TextVO; | |
3 | + | |
4 | +import java.util.HashMap; | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author : 이은진 | |
9 | + * since : 2024.07.25 | |
10 | + * | |
11 | + * 지문 관련 인터페이스 | |
12 | + */ | |
13 | + | |
14 | +public interface TextService { | |
15 | + // 지문 등록 | |
16 | + int insertText(TextVO textVO) throws Exception; | |
17 | + | |
18 | + // 지문 리스트 조회 | |
19 | + List<HashMap<String, Object>> selectTextList(HashMap<String, Object> params) throws Exception; | |
20 | + | |
21 | + // 지문 수 조회 | |
22 | + int textCount(HashMap<String, Object> params) throws Exception; | |
23 | + | |
24 | + // 지문 출력 | |
25 | + List<HashMap<String, Object>> selectOneText(HashMap<String, Object> params) throws Exception; | |
26 | + | |
27 | + // 지문 수정 | |
28 | + int textUpdate(TextVO textVO) throws Exception; | |
29 | + | |
30 | + // 지문 삭제 | |
31 | + int textDelete(String textId) throws Exception; | |
32 | + | |
33 | + // 지문 검색 | |
34 | + public List<HashMap<String, Object>> searchText(HashMap<String, Object> params) throws Exception; | |
35 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/text/vo/TextVO.java
... | ... | @@ -0,0 +1,34 @@ |
1 | +package com.takensoft.ai_lms.lms.text.vo; | |
2 | + | |
3 | +import lombok.AllArgsConstructor; | |
4 | +import lombok.Getter; | |
5 | +import lombok.NoArgsConstructor; | |
6 | +import lombok.Setter; | |
7 | + | |
8 | +import java.time.LocalDateTime; | |
9 | + | |
10 | +/** | |
11 | + * @author : 이은진 | |
12 | + * since : 2024.07.26 | |
13 | + * | |
14 | + * 지문 관련 VO | |
15 | + */ | |
16 | + | |
17 | +@Setter | |
18 | +@Getter | |
19 | +@NoArgsConstructor | |
20 | +@AllArgsConstructor | |
21 | +public class TextVO { | |
22 | + | |
23 | + // 지문 아이디 | |
24 | + private String textId; | |
25 | + // 지문 내용 | |
26 | + private String textCnt; | |
27 | + // 등록일 | |
28 | + private String regDt; | |
29 | + // 파일 관리 아이디 | |
30 | + private String fileMngId; | |
31 | + // 유형 아이디 | |
32 | + private String textTypeId; | |
33 | + | |
34 | +} |
+++ src/main/java/com/takensoft/ai_lms/lms/text/web/TextController.java
... | ... | @@ -0,0 +1,156 @@ |
1 | +package com.takensoft.ai_lms.lms.text.web; | |
2 | + | |
3 | +import com.google.gson.Gson; | |
4 | +import com.google.gson.JsonObject; | |
5 | +import com.takensoft.ai_lms.lms.text.service.TextService; | |
6 | +import com.takensoft.ai_lms.lms.text.vo.TextVO; | |
7 | +import io.swagger.v3.oas.annotations.Operation; | |
8 | +import lombok.RequiredArgsConstructor; | |
9 | +import lombok.extern.slf4j.Slf4j; | |
10 | +import org.springframework.http.HttpStatus; | |
11 | +import org.springframework.http.ResponseEntity; | |
12 | +import org.springframework.web.bind.annotation.*; | |
13 | +import org.springframework.web.servlet.ModelAndView; | |
14 | + | |
15 | +import java.util.HashMap; | |
16 | +import java.util.List; | |
17 | +import java.util.Map; | |
18 | + | |
19 | +/** | |
20 | + * @author 이은진 | |
21 | + * @since 2024.07.25 | |
22 | + */ | |
23 | + | |
24 | + | |
25 | +@RestController | |
26 | +@RequiredArgsConstructor | |
27 | +@Slf4j | |
28 | +@RequestMapping(value = "/text") | |
29 | +public class TextController { | |
30 | + | |
31 | + private final TextService TextService; | |
32 | + | |
33 | + /** | |
34 | + * 지문 등록 | |
35 | + */ | |
36 | + @PostMapping("/insertText.json") | |
37 | + @Operation(summary = "지문 등록") | |
38 | + public String insertText(@RequestBody TextVO textVO) throws Exception { | |
39 | + Gson gson = new Gson(); | |
40 | + JsonObject response = new JsonObject(); | |
41 | + | |
42 | + try { | |
43 | + int result = TextService.insertText(textVO); | |
44 | + if (result > 0) { | |
45 | + response.addProperty("status", "success"); | |
46 | + response.addProperty("message", "지문이 등록되었습니다."); | |
47 | + return gson.toJson(response); | |
48 | + } else { | |
49 | + response.addProperty("message", "지문 등록 실패"); | |
50 | + return gson.toJson(response); | |
51 | + } | |
52 | + } catch (Exception e) { | |
53 | + response.addProperty("status", "error"); | |
54 | + response.addProperty("message", e.getMessage()); | |
55 | + return gson.toJson(response); | |
56 | + } | |
57 | + } | |
58 | + | |
59 | + | |
60 | + /** | |
61 | + * 지문 리스트 조회 | |
62 | + */ | |
63 | + @GetMapping("/selectTextList.json") | |
64 | + @Operation(summary = "지문 리스트 조회") | |
65 | + public HashMap<String, Object> getTextList(@RequestBody HashMap<String, Object> params) throws Exception { | |
66 | + HashMap<String, Object> result = new HashMap<>(); | |
67 | + | |
68 | + int page = Integer.parseInt(params.get("page").toString()); | |
69 | + int pageSize = Integer.parseInt(params.get("pageSize").toString()); | |
70 | + | |
71 | + int totalText = TextService.textCount(params); | |
72 | + result.put("totalText", totalText); | |
73 | + result.put("texts", TextService.selectTextList(params)); | |
74 | + | |
75 | + return result; | |
76 | + } | |
77 | + | |
78 | + /** | |
79 | + * 지문 출력 | |
80 | + */ | |
81 | + @GetMapping("/selectOneText.json") | |
82 | + @Operation(summary = "지문 출력") | |
83 | + public List<HashMap<String, Object>> selectOneText(@RequestParam HashMap<String, Object> textId) throws Exception { | |
84 | + return TextService.selectOneText(textId); | |
85 | + } | |
86 | + | |
87 | + | |
88 | + /** | |
89 | + * 지문 수정 | |
90 | + */ | |
91 | + @PutMapping(value = "/textUpdate.json") | |
92 | + @Operation(summary = "지문 수정") | |
93 | + public String textUpdate(@RequestBody TextVO textVO) throws Exception { | |
94 | + Gson gson = new Gson(); | |
95 | + JsonObject response = new JsonObject(); | |
96 | + | |
97 | + try { | |
98 | + int result = TextService.textUpdate(textVO); | |
99 | + if (result > 0) { | |
100 | + response.addProperty("status", "success"); | |
101 | + response.addProperty("message", "지문이 수정되었습니다."); | |
102 | + return gson.toJson(response); | |
103 | + } else { | |
104 | + response.addProperty("message", "수정 실패"); | |
105 | + return gson.toJson(response); | |
106 | + } | |
107 | + } catch (Exception e) { | |
108 | + response.addProperty("status", "error"); | |
109 | + response.addProperty("message", e.getMessage()); | |
110 | + return gson.toJson(response); | |
111 | + } | |
112 | + } | |
113 | + | |
114 | + | |
115 | + /** | |
116 | + * 지문 삭제 | |
117 | + */ | |
118 | + @DeleteMapping(value = "/textDelete.json") | |
119 | + @Operation(summary = "지문 삭제") | |
120 | + public String textDelete(@RequestBody Map<String, String> request) throws Exception { | |
121 | + Gson gson = new Gson(); | |
122 | + JsonObject response = new JsonObject(); | |
123 | + | |
124 | + String textId = request.get("textId"); | |
125 | + int result = TextService.textDelete(textId); | |
126 | + try { | |
127 | + if (result > 0) { | |
128 | + response.addProperty("status", "success"); | |
129 | + response.addProperty("message", "사용자가 삭제되었습니다."); | |
130 | + return gson.toJson(response); | |
131 | + } else { | |
132 | + response.addProperty("message", "삭제 실패"); | |
133 | + return gson.toJson(response); | |
134 | + } | |
135 | + } catch (Exception e) { | |
136 | + response.addProperty("status", "error"); | |
137 | + response.addProperty("message", e.getMessage()); | |
138 | + return gson.toJson(response); | |
139 | + } | |
140 | + } | |
141 | + | |
142 | + | |
143 | + /** | |
144 | + * 지문 검색 | |
145 | + */ | |
146 | + @GetMapping("/textSearch.json") | |
147 | + @Operation(summary = "지문 검색") | |
148 | + public HashMap<String, Object> searchText(@RequestBody HashMap<String, Object> params) throws Exception { | |
149 | + HashMap<String, Object> result = new HashMap<>(); | |
150 | + List<HashMap<String, Object>> textList = TextService.searchText(params); | |
151 | + result.put("list", textList); | |
152 | + return result; | |
153 | + } | |
154 | + | |
155 | +} | |
156 | + |
--- src/main/resources/mybatis/mapper/lms/board-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/board-SQL.xml
... | ... | @@ -1,19 +1,14 @@ |
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | 3 |
<mapper namespace="com.takensoft.ai_lms.lms.board.dao.BoardDAO"> |
4 |
- <!-- |
|
5 |
- 작 성 자 : 박민혁 |
|
6 |
- 작 성 일 : 2024.07.25 |
|
7 |
- 내 용 : 경로 생성을 위해 만들어 놓은 xml, |
|
8 |
- CRUD를 이용하는데 삭제하거나 수정해서 사용해주세요 |
|
9 |
- --> |
|
4 |
+ |
|
10 | 5 |
<resultMap id="boardMap" type="BoardVO"> |
11 | 6 |
<result property="bbsId" column="bbs_id"/> |
12 |
- <result property="bbsTitle" column="bbs_ttl"/> |
|
13 |
- <result property="bbsCategory" column="bbs_cls"/> |
|
14 |
- <result property="bbsContents" column="bbs_cnt"/> |
|
15 |
- <result property="bbsTime" column="bbs_tm"/> |
|
16 |
- <result property="fileManageId" column="file_mng_id"/> |
|
7 |
+ <result property="bbsTtl" column="bbs_ttl"/> |
|
8 |
+ <result property="bbsCls" column="bbs_cls"/> |
|
9 |
+ <result property="bbsCnt" column="bbs_cnt"/> |
|
10 |
+ <result property="bbsTm" column="bbs_tm"/> |
|
11 |
+ <result property="fileMngId" column="file_mng_id"/> |
|
17 | 12 |
<result property="sclsId" column="scls_id"/> |
18 | 13 |
</resultMap> |
19 | 14 |
|
... | ... | @@ -24,8 +19,20 @@ |
24 | 19 |
내 용 : 게시글 등록 관련 |
25 | 20 |
--> |
26 | 21 |
<insert id="insertBoard" parameterType="BoardVO"> |
27 |
- INSERT INTO board(bbs_id, bbs_ttl, bbs_cls, bbs_cnt,bbs_tm, file_mng_id, scls_id) |
|
28 |
- VALUES ( #{bbsId}, #{bbsTitle}, #{bbsCategory}, #{bbsContents}, now(), #{fileManageId}, #{sclsId}); |
|
22 |
+ INSERT INTO board(bbs_id, |
|
23 |
+ bbs_ttl, |
|
24 |
+ bbs_cls, |
|
25 |
+ bbs_cnt, |
|
26 |
+ bbs_tm, |
|
27 |
+ file_mng_id, |
|
28 |
+ scls_id) |
|
29 |
+ VALUES (#{bbsId}, |
|
30 |
+ #{bbsTtl}, |
|
31 |
+ #{bbsCls}, |
|
32 |
+ #{bbsCnt}, |
|
33 |
+ now(), |
|
34 |
+ #{fileMngId}, |
|
35 |
+ #{sclsId}); |
|
29 | 36 |
</insert> |
30 | 37 |
|
31 | 38 |
<!-- |
... | ... | @@ -75,10 +82,10 @@ |
75 | 82 |
WHERE 1 = 1 |
76 | 83 |
<if test="option != null and keyword != null"> |
77 | 84 |
<choose> |
78 |
- <when test="option == 'bbsTitle'"> |
|
85 |
+ <when test="option == 'bbsTtl'"> |
|
79 | 86 |
AND bbs_ttl LIKE CONCAT('%', #{keyword}, '%') |
80 | 87 |
</when> |
81 |
- <when test="option == 'bbsCategory'"> |
|
88 |
+ <when test="option == 'bbsCls'"> |
|
82 | 89 |
AND bbs_cls LIKE CONCAT('%', #{keyword}, '%') |
83 | 90 |
</when> |
84 | 91 |
<otherwise> |
... | ... | @@ -97,11 +104,11 @@ |
97 | 104 |
--> |
98 | 105 |
<update id="updateBoard" parameterType="BoardVO"> |
99 | 106 |
UPDATE board |
100 |
- SET bbs_ttl = #{bbsTitle}, |
|
101 |
- bbs_cls = #{bbsCategory}, |
|
102 |
- bbs_cnt = #{bbsContents}, |
|
107 |
+ SET bbs_ttl = #{bbsTtl}, |
|
108 |
+ bbs_cls = #{bbsCls}, |
|
109 |
+ bbs_cnt = #{bbsCnt}, |
|
103 | 110 |
bbs_tm = now(), |
104 |
- file_mng_id = #{fileManageId} |
|
111 |
+ file_mng_id = #{fileMngId} |
|
105 | 112 |
WHERE |
106 | 113 |
bbs_id = #{bbsId} |
107 | 114 |
</update> |
+++ src/main/resources/mybatis/mapper/lms/book-SQL.xml
... | ... | @@ -0,0 +1,65 @@ |
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.book.dao.BookDAO"> | |
4 | + | |
5 | + <resultMap id="bookMap" type="BookVO"> | |
6 | + <result property="book_id" column="book_id"/> | |
7 | + <result property="book_nm" column="book_nm"/> | |
8 | + </resultMap> | |
9 | + | |
10 | + <!-- | |
11 | + 작 성 자 : 구자현 | |
12 | + 작 성 일 : 2024.07.25 | |
13 | + 내 용 : 전체 교재 목록 출력 | |
14 | + --> | |
15 | + <select id="getAllBooks" resultMap="bookMap"> | |
16 | + SELECT | |
17 | + book_id, | |
18 | + book_nm | |
19 | + FROM book | |
20 | + </select> | |
21 | + | |
22 | + <!-- | |
23 | + 작 성 자 : 구자현 | |
24 | + 작 성 일 : 2024.07.25 | |
25 | + 내 용 : 책의 상세 정보 | |
26 | + --> | |
27 | + <select id="getBookById" parameterType="String" resultMap="bookMap"> | |
28 | + SELECT | |
29 | + book_id, | |
30 | + book_nm | |
31 | + FROM book | |
32 | + WHERE book_id = #{book_id} | |
33 | + </select> | |
34 | + | |
35 | + <!-- | |
36 | + 작 성 자 : 구자현 | |
37 | + 작 성 일 : 2024.07.25 | |
38 | + 내 용 : 교재 등록 | |
39 | + --> | |
40 | + <insert id="insertBook" parameterType="bookVO"> | |
41 | + INSERT INTO book (book_id, book_nm) | |
42 | + VALUES (#{book_id}, #{book_nm}) | |
43 | + </insert> | |
44 | + | |
45 | + <!-- | |
46 | + 작 성 자 : 구자현 | |
47 | + 작 성 일 : 2024.07.25 | |
48 | + 내 용 : 교재 제목 수정 | |
49 | + --> | |
50 | + <update id="updateBook" parameterType="bookVO"> | |
51 | + UPDATE book | |
52 | + SET book_nm = #{book_nm} | |
53 | + WHERE book_id = #{book_id} | |
54 | + </update> | |
55 | + | |
56 | + <!-- | |
57 | + 작 성 자 : 구자현 | |
58 | + 작 성 일 : 2024.07.25 | |
59 | + 내 용 : 교재 삭제 | |
60 | + --> | |
61 | + <delete id="deleteBook" parameterType="String"> | |
62 | + DELETE FROM book | |
63 | + WHERE book_id = #{book_id} | |
64 | + </delete> | |
65 | +</mapper>(No newline at end of file) |
+++ src/main/resources/mybatis/mapper/lms/class_book-SQL.xml
... | ... | @@ -0,0 +1,36 @@ |
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.class_book.dao.ClassBookDAO"> | |
4 | + | |
5 | + | |
6 | + <resultMap id="classBookMap" type="ClassBookVO" > | |
7 | + <result property="sclsId" column="scls_id"/> | |
8 | + <result property="sclsNm" column="scls_nm"/> | |
9 | + </resultMap> | |
10 | + | |
11 | + <!-- | |
12 | + 작성자 : 박세훈 | |
13 | + 작성일 : 2024.07.26 | |
14 | + 내 용 : 반에 책 등록 | |
15 | + --> | |
16 | + <insert id="registerBook" parameterType="String" > | |
17 | + INSERT INTO class_book( book_id, | |
18 | + scls_id | |
19 | + ) VALUES ( #{bookId}, | |
20 | + #{sclsId} | |
21 | + ); | |
22 | + </insert> | |
23 | + | |
24 | + <!-- | |
25 | + 작성자 : 박세훈 | |
26 | + 작성일 : 2024.07.26 | |
27 | + 내 용 : 반에 등록 된 책 삭제 | |
28 | + --> | |
29 | + <delete id="deleteClassBook" parameterType="String"> | |
30 | + DELETE FROM class_book | |
31 | + WHERE | |
32 | + book_id = #{bookId} AND | |
33 | + scls_id = #{sclsId} | |
34 | + </delete> | |
35 | + | |
36 | +</mapper>(No newline at end of file) |
+++ src/main/resources/mybatis/mapper/lms/classes-SQL.xml
... | ... | @@ -0,0 +1,79 @@ |
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.classes.dao.ClassDAO"> | |
4 | + | |
5 | + <resultMap id="classMap" type="ClassVO"> | |
6 | + <result property="sclsId" column="scls_id"/> | |
7 | + <result property="userId" column="user_id"/> | |
8 | + <result property="sclsNm" column="scls_nm"/> | |
9 | + </resultMap> | |
10 | + | |
11 | + <!-- | |
12 | + 작성자 : 정다정 | |
13 | + 작성일 : 2024.07.25 | |
14 | + 내 용 : 반 조회 | |
15 | + --> | |
16 | + <select id="selectClass" parameterType="String" resultMap="classMap"> | |
17 | + SELECT scls_id | |
18 | + , user_id | |
19 | + , scls_nm | |
20 | + FROM | |
21 | + class | |
22 | + WHERE | |
23 | + user_id = #{userId} | |
24 | + </select> | |
25 | + | |
26 | + <!-- | |
27 | + 작성자 : 정다정 | |
28 | + 작성일 : 2024.07.26 | |
29 | + 내 용 : 반 생성 | |
30 | + --> | |
31 | + <insert id="insertClass" parameterType="ClassVO"> | |
32 | + INSERT INTO class( scls_id | |
33 | + , user_id | |
34 | + , scls_nm | |
35 | + ) VALUES ( #{sclsId} | |
36 | + , #{userId} | |
37 | + , #{sclsNm} | |
38 | + ); | |
39 | + </insert> | |
40 | + | |
41 | + <!-- | |
42 | + 작성자 : 정다정 | |
43 | + 작성일 : 2024.07.26 | |
44 | + 내 용 : 반 수정 | |
45 | + --> | |
46 | + <update id="updateClass" parameterType="ClassVO"> | |
47 | + UPDATE class | |
48 | + SET | |
49 | + scls_nm = #{sclsNm} | |
50 | + WHERE | |
51 | + scls_id = #{sclsId} | |
52 | + </update> | |
53 | + | |
54 | + <!-- | |
55 | + 작성자 : 정다정 | |
56 | + 작성일 : 2024.07.26 | |
57 | + 내 용 : 반 삭제 | |
58 | + --> | |
59 | + <delete id="deleteClass" parameterType="String"> | |
60 | + DELETE FROM class | |
61 | + WHERE | |
62 | + scls_id = #{sclsId} | |
63 | + </delete> | |
64 | + | |
65 | + <!-- | |
66 | + 작성자 : 정다정 | |
67 | + 작성일 : 2024.07.26 | |
68 | + 내 용 : 반 아이디(scls_id) 존재 확인 | |
69 | + --> | |
70 | + <select id="existsClassById" parameterType="String" resultType="int"> | |
71 | + SELECT | |
72 | + COUNT(*) | |
73 | + FROM | |
74 | + class | |
75 | + WHERE | |
76 | + scls_id = #{sclsId} | |
77 | + </select> | |
78 | + | |
79 | +</mapper>(No newline at end of file) |
+++ src/main/resources/mybatis/mapper/lms/files-SQL.xml
... | ... | @@ -0,0 +1,45 @@ |
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.file.dao.FileDAO"> | |
4 | + <!-- | |
5 | + 작 성 자 : 박민혁 | |
6 | + 작 성 일 : 2024.07.25 | |
7 | + 내 용 : 경로 생성을 위해 만들어 놓은 xml, | |
8 | + CRUD를 이용하는데 삭제하거나 수정해서 사용해주세요 | |
9 | + --> | |
10 | + <resultMap id="FileMap" type="FileVO"> | |
11 | + <result property="fileId" column="file_id"/> | |
12 | + <result property="fileMngId" column="file_mng_id"/> | |
13 | + <result property="fileNm" column="file_nm"/> | |
14 | + <result property="fileEncptNm" column="file_encpt_nm"/> | |
15 | + <result property="fileApath" column="file_apath"/> | |
16 | + <result property="fileRpath" column="file_rpath"/> | |
17 | + <result property="fileExtn" column="file_extn"/> | |
18 | + <result property="fileSz" column="file_sz"/> | |
19 | + <result property="fileClsf" column="file_clsf"/> | |
20 | + <result property="reg" column="reg"/> | |
21 | + <result property="regDt" column="reg_dt"/> | |
22 | + </resultMap> | |
23 | + | |
24 | + <!-- | |
25 | + 작성자 : 홍아랑 | |
26 | + 작성일 : 2024.07.26 | |
27 | + 내 용 : 파일 정보 조회 | |
28 | + --> | |
29 | + <select id="findByFileId" parameterType="FileVO" resultMap="FileMap"> | |
30 | + SELECT | |
31 | + file_id, | |
32 | + file_mng_id, | |
33 | + file_nm, | |
34 | + file_encpt_nm, | |
35 | + file_apath, | |
36 | + file_rpath, | |
37 | + file_extn, | |
38 | + file_sz, | |
39 | + file_clsf, | |
40 | + reg, | |
41 | + reg_dt | |
42 | + FROM cmmn_file | |
43 | + WHERE file_mng_id = #{file_mng_id} | |
44 | + </select> | |
45 | +</mapper>(No newline at end of file) |
--- src/main/resources/mybatis/mapper/lms/student-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/student-SQL.xml
... | ... | @@ -13,20 +13,49 @@ |
13 | 13 |
<result property="institutionName" column="institutionName"/> |
14 | 14 |
<result property="grade" column="grade"/> |
15 | 15 |
<result property="className" column="className"/> |
16 |
+ <result property="totalProblemsSolved" column="totalProblemsSolved"/> |
|
16 | 17 |
<result property="studentQuestion" column="studentQuestion"/> |
18 |
+ <collection property="history" ofType="com.takensoft.ai_lms.lms.student.vo.HistoryVO"> |
|
19 |
+ <result property="bookName" column="bookName"/> |
|
20 |
+ <result property="bookId" column="bookId"/> |
|
21 |
+ <result property="unitName" column="unitName"/> |
|
22 |
+ <result property="unitId" column="unitId"/> |
|
23 |
+ <result property="completionTime" column="completionTime"/> |
|
24 |
+ </collection> |
|
17 | 25 |
</resultMap> |
18 | 26 |
|
19 |
- <select id="getStudentInfo" resultType="com.takensoft.ai_lms.lms.student.vo.StudentInfoVO"> |
|
27 |
+ <select id="getStudentInfo" resultMap="StudentInfoResultMap"> |
|
20 | 28 |
SELECT |
21 | 29 |
u.user_nm AS studentName, |
22 | 30 |
i.ednst_nm AS institutionName, |
23 | 31 |
ui.grd_no AS grade, |
24 | 32 |
ui.scls_nm AS className, |
25 |
- uc.stn_qna AS studentQuestion |
|
33 |
+ (SELECT COUNT(*) FROM problem_log pl WHERE pl.std_id = u.user_id) AS totalProblemsSolved, |
|
34 |
+ uc.stn_qna AS studentQuestion, |
|
35 |
+ hu.book_id AS bookId, |
|
36 |
+ hu.book_nm AS bookName, |
|
37 |
+ hu.unit_id AS unitId, |
|
38 |
+ hu.unit_nm AS unitName, |
|
39 |
+ hu.cmptn_tm AS completionTime |
|
26 | 40 |
FROM users u |
27 | 41 |
JOIN user_institution ui ON u.user_id = ui.user_id |
28 | 42 |
JOIN institution i ON ui.ednst_id = i.ednst_id |
29 | 43 |
JOIN user_class uc ON u.user_id = uc.user_id |
44 |
+ LEFT JOIN ( |
|
45 |
+ SELECT |
|
46 |
+ uu.user_id, |
|
47 |
+ b.book_id, |
|
48 |
+ b.book_nm, |
|
49 |
+ un.unit_id, |
|
50 |
+ un.unit_nm, |
|
51 |
+ uu.cmptn_tm |
|
52 |
+ FROM user_unit uu |
|
53 |
+ JOIN unit un ON uu.unit_id = un.unit_id |
|
54 |
+ JOIN book b ON un.book_id = b.book_id |
|
55 |
+ WHERE uu.user_id = #{userId} |
|
56 |
+ ORDER BY uu.cmptn_tm DESC |
|
57 |
+ LIMIT 3 |
|
58 |
+ ) hu ON u.user_id = hu.user_id |
|
30 | 59 |
WHERE u.user_id = #{userId} |
31 | 60 |
</select> |
32 | 61 |
|
+++ src/main/resources/mybatis/mapper/lms/text-SQL.xml
... | ... | @@ -0,0 +1,127 @@ |
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.text.dao.TextDAO"> | |
4 | + | |
5 | + <resultMap id="textMap" type="TextVO"> | |
6 | + <result property="textId" column="text_id"/> | |
7 | + <result property="textCnt" column="text_cnt"/> | |
8 | + <result property="regDt" column="reg_dt"/> | |
9 | + <result property="fileMngId" column="file_mng_id"/> | |
10 | + <result property="textTypeId" column="text_type_id"/> | |
11 | + </resultMap> | |
12 | + | |
13 | + | |
14 | + <!-- | |
15 | + 작성자 : 이은진 | |
16 | + 작성일 : 2024.07.26 | |
17 | + 내 용 : 지문 등록 | |
18 | + --> | |
19 | + <insert id="insertText" parameterType="TextVO"> | |
20 | + INSERT INTO text (text_id | |
21 | + ,text_cnt | |
22 | + ,reg_dt | |
23 | + ,file_mng_id | |
24 | + ,text_type_id | |
25 | + ) VALUES (#{textId} | |
26 | + ,#{textCnt} | |
27 | + ,now() | |
28 | + ,#{fileMngId} | |
29 | + ,#{textTypeId} | |
30 | + ); | |
31 | + </insert> | |
32 | + | |
33 | + <!-- | |
34 | + 작성자 : 이은진 | |
35 | + 작성일 : 2024.07.26 | |
36 | + 내 용 : 지문 수 조회 | |
37 | + --> | |
38 | + <select id="textCount" resultType="Integer"> | |
39 | + SELECT COUNT(*) | |
40 | + FROM text | |
41 | + </select> | |
42 | + | |
43 | + <!-- | |
44 | + 작성자 : 이은진 | |
45 | + 작성일 : 2024.07.26 | |
46 | + 내 용 : 지문 리스트 조회 | |
47 | + --> | |
48 | + <select id="selectTextList" resultMap="textMap"> | |
49 | + SELECT text_id | |
50 | + ,text_cnt | |
51 | + ,reg_dt | |
52 | + ,file_mng_id | |
53 | + ,text_type_id | |
54 | + FROM text | |
55 | + ORDER BY text_id DESC | |
56 | + LIMIT #{pageSize} | |
57 | + OFFSET #{startIndex} | |
58 | + </select> | |
59 | + | |
60 | + <!-- | |
61 | + 작성자 : 이은진 | |
62 | + 작성일 : 2024.07.26 | |
63 | + 내 용 : 지문 출력 | |
64 | + --> | |
65 | + <select id="selectOneText" parameterType="HashMap" resultType="HashMap"> | |
66 | + SELECT text_id | |
67 | + , text_cnt | |
68 | + , reg_dt | |
69 | + , file_mng_id | |
70 | + , text_type_id | |
71 | + | |
72 | + FROM text | |
73 | + WHERE text_id = #{textId} | |
74 | + ORDER BY text_id DESC | |
75 | + </select> | |
76 | + | |
77 | + <!-- | |
78 | + 작성자 : 이은진 | |
79 | + 작성일 : 2024.07.26 | |
80 | + 내 용 : 지문 수정 | |
81 | + --> | |
82 | + <update id="textUpdate" parameterType="TextVO"> | |
83 | + UPDATE text | |
84 | + SET text_cnt = #{textCnt} | |
85 | + , file_mng_id = #{fileMngId} | |
86 | + , text_type_id = #{textTypeId} | |
87 | + WHERE text_id = #{textId} | |
88 | + </update> | |
89 | + | |
90 | + <!-- | |
91 | + 작성자 : 이은진 | |
92 | + 작성일 : 2024.07.26 | |
93 | + 내 용 : 지문 삭제 | |
94 | + --> | |
95 | + <delete id="textDelete" parameterType="String"> | |
96 | + DELETE FROM text | |
97 | + WHERE text_id = #{textId} | |
98 | + </delete> | |
99 | + | |
100 | + | |
101 | + <!-- | |
102 | + 작성자 : 이은진 | |
103 | + 작성일 : 2024.07.26 | |
104 | + 내 용 : 지문 검색 | |
105 | + --> | |
106 | + <select id="searchText" parameterType="TextVO" resultMap="textMap"> | |
107 | + SELECT * | |
108 | + FROM text | |
109 | + WHERE 1 = 1 | |
110 | + <if test="option != null and keyword != null"> | |
111 | + <choose> | |
112 | + <when test="option == 'textId'"> | |
113 | + AND text_id LIKE CONCAT('%', #{keyword}, '%') | |
114 | + </when> | |
115 | + <when test="option == 'textCnt'"> | |
116 | + AND text_cnt LIKE CONCAT('%', #{keyword}, '%') | |
117 | + </when> | |
118 | + <when test="option == 'regDt'"> | |
119 | + AND TO_CHAR(reg_dt, 'YYYY-MM-DD HH24:MI:SS') LIKE CONCAT('%', #{keyword}, '%') | |
120 | + </when> | |
121 | + </choose> | |
122 | + </if> | |
123 | + ORDER BY text_id DESC | |
124 | + LIMIT #{pageSize} OFFSET #{startIndex} | |
125 | + </select> | |
126 | + | |
127 | +</mapper> |
--- src/main/resources/mybatis/mapper/test/test-SQL.xml
+++ src/main/resources/mybatis/mapper/test/test-SQL.xml
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 |
<!-- |
5 | 5 |
작 성 자 : 방선주 |
6 | 6 |
작 성 일 : 2024.07.05 |
7 |
- 내 용 : 테스트 xml |
|
7 |
+ 내 용 : 테스트 xml2 |
|
8 | 8 |
--> |
9 | 9 |
<select id="testList" resultType="HashMap"> |
10 | 10 |
SELECT test_data |
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?