박민혁 박민혁 08-05
Merge remote-tracking branch 'origin/master'
@c8b1bf51cb8ded3dcaf5cc3aff14238f21ee1b32
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
@@ -75,6 +75,7 @@
                 .requestMatchers("/photoMng/**").permitAll() // 사진첩 정보 진입 허용
                 .requestMatchers("/wordbook/**").permitAll()
                 .requestMatchers("/problem/**").permitAll() // 문제 정보 진입 허용
+                .requestMatchers("/problemLog/**").permitAll() // 문제 풀이 로그 정보 진입 허용
                 .requestMatchers("/evaluation/**").permitAll() // 단원 평가 정보 진입 허용
                 .requestMatchers("/evalProblem/**").permitAll() // 단원 평가 문제 진입 허용
                 .requestMatchers("/unitLearning/**").permitAll() // 로드맵 정보 진입 허용
@@ -85,6 +86,7 @@
                 .requestMatchers("/survey/**").permitAll() // 설문 조사 진입 허용
                 .requestMatchers("/api/**").permitAll() // Google Cloud api 진입 허용
                 .requestMatchers("/userclass/**").permitAll() // 반별 학생 맵핑 진입 허용
+                .requestMatchers("/userunit/**").permitAll() // 사용자 학습 진행 정보 진입 허용
                 .anyRequest().authenticated()); // 나머지 경로는 인증 필요
 
         // jwt 필터 처리 적용
src/main/java/com/takensoft/ai_lms/lms/eval_problem/dao/EvalProblemDAO.java
--- src/main/java/com/takensoft/ai_lms/lms/eval_problem/dao/EvalProblemDAO.java
+++ src/main/java/com/takensoft/ai_lms/lms/eval_problem/dao/EvalProblemDAO.java
@@ -29,4 +29,12 @@
      * 특정 단원의 문제 수 조회
      */
     int unitProblemNum(EvalProblemVO evalProblemVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.08.01
+     *
+     * 단원 평가에 등록된 문제 삭제
+     */
+    int deleteEvalProblem(EvalProblemVO evalProblemVO) throws Exception;
 }
src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/EvalProblemService.java
--- src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/EvalProblemService.java
+++ src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/EvalProblemService.java
@@ -25,4 +25,12 @@
      * 특정 단원의 문제 수 조회
      */
     int unitProblemNum(EvalProblemVO evalProblemVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.08.01
+     *
+     * 단원 평가에 등록된 문제 삭제
+     */
+    int deleteEvalProblem(EvalProblemVO evalProblemVO) throws Exception;
 }
src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/Impl/EvalProblemImpl.java
--- src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/Impl/EvalProblemImpl.java
+++ src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/Impl/EvalProblemImpl.java
@@ -39,4 +39,14 @@
     public int unitProblemNum(EvalProblemVO evalProblemVO) throws Exception {
         return evalProblemDAO.unitProblemNum(evalProblemVO);
     }
+
+    /**
+     * @author 권지수
+     * @since 2024.08.01
+     *
+     * 단원 평가에 등록된 문제 삭제
+     */
+    public int deleteEvalProblem(EvalProblemVO evalProblemVO) throws Exception {
+        return evalProblemDAO.deleteEvalProblem(evalProblemVO);
+    }
 }
src/main/java/com/takensoft/ai_lms/lms/eval_problem/web/EvalProblemController.java
--- src/main/java/com/takensoft/ai_lms/lms/eval_problem/web/EvalProblemController.java
+++ src/main/java/com/takensoft/ai_lms/lms/eval_problem/web/EvalProblemController.java
@@ -52,4 +52,17 @@
 
         return new ResponseEntity<>(result, HttpStatus.OK);
     }
+
+    /**
+     * @author 권지수
+     * @since 2024.08.01
+     *
+     * 단원 평가에 등록된 문제 삭제
+     */
+    @PostMapping(path = "/deleteEvalProblem.json")
+    public ResponseEntity<?> deleteEvalProblem(@RequestBody EvalProblemVO evalProblemVO) throws Exception {
+        int result = evalProblemService.deleteEvalProblem(evalProblemVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
 }
src/main/java/com/takensoft/ai_lms/lms/problem/vo/ProblemVO.java
--- src/main/java/com/takensoft/ai_lms/lms/problem/vo/ProblemVO.java
+++ src/main/java/com/takensoft/ai_lms/lms/problem/vo/ProblemVO.java
@@ -26,4 +26,10 @@
     private String prblmTypeId;
     // 카테고리 아이디
     private String prblmCtgryId;
+    // 사용자 아이디(선생)
+    private String userId;
+    // 책 아이디
+    private String bookId;
+    // 단원 아이디
+    private String unitId;
 }
 
src/main/java/com/takensoft/ai_lms/lms/problem_log/dao/ProblemLogDAO.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/problem_log/dao/ProblemLogDAO.java
@@ -0,0 +1,47 @@
+package com.takensoft.ai_lms.lms.problem_log.dao;
+
+import com.takensoft.ai_lms.lms.problem_log.vo.ProblemLogVO;
+import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
+
+/**
+ * @author 권지수
+ * @since 2024.08.01
+ *
+ * 문제 풀이 로그 DAO 클래스
+ */
+
+@Mapper("problemLogDAO")
+public interface ProblemLogDAO {
+
+    /**
+     * @author 권지수
+     * @since 2024.08.01
+     *
+     * 문제 풀이 로그 정보 입력
+     */
+    int insertProblemLog(ProblemLogVO problemLogVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 수정
+     */
+    int updateProblemLog(ProblemLogVO problemLogVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 삭제
+     */
+    int deleteProblemLog(ProblemLogVO problemLogVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 조회
+     */
+    ProblemLogVO problemLogInfo(ProblemLogVO problemLogVO) throws Exception;
+}
 
src/main/java/com/takensoft/ai_lms/lms/problem_log/service/Impl/ProblemLogServiceImpl.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/problem_log/service/Impl/ProblemLogServiceImpl.java
@@ -0,0 +1,68 @@
+package com.takensoft.ai_lms.lms.problem_log.service.Impl;
+
+import com.takensoft.ai_lms.common.idgen.service.IdgenService;
+import com.takensoft.ai_lms.lms.problem_log.dao.ProblemLogDAO;
+import com.takensoft.ai_lms.lms.problem_log.service.ProblemLogService;
+import com.takensoft.ai_lms.lms.problem_log.vo.ProblemLogVO;
+import lombok.RequiredArgsConstructor;
+import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author 권지수
+ * @since 2024.08.01
+ *
+ * 문제 풀이 로그 ServiceImpl 클래스
+ */
+
+@Service("problemLogService")
+@RequiredArgsConstructor
+public class ProblemLogServiceImpl extends EgovAbstractServiceImpl implements ProblemLogService {
+
+    private final ProblemLogDAO problemLogDAO;
+    private final IdgenService problemLogIdgn;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.26
+     *
+     * 문제 풀이 로그 정보 입력
+     */
+    @Override
+    public int insertProblemLog(ProblemLogVO problemLogVO) throws Exception {
+        String problemLogId = problemLogIdgn.getNextStringId();
+        problemLogVO.setPrblmLogId(problemLogId);
+
+        return problemLogDAO.insertProblemLog(problemLogVO);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 수정
+     */
+    public int updateProblemLog(ProblemLogVO problemLogVO) throws Exception {
+        return problemLogDAO.updateProblemLog(problemLogVO);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 삭제
+     */
+    public int deleteProblemLog(ProblemLogVO problemLogVO) throws Exception {
+        return problemLogDAO.deleteProblemLog(problemLogVO);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 조회
+     */
+    public ProblemLogVO problemLogInfo(ProblemLogVO problemLogVO) throws Exception {
+        return problemLogDAO.problemLogInfo(problemLogVO);
+    }
+}
 
src/main/java/com/takensoft/ai_lms/lms/problem_log/service/ProblemLogService.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/problem_log/service/ProblemLogService.java
@@ -0,0 +1,45 @@
+package com.takensoft.ai_lms.lms.problem_log.service;
+
+import com.takensoft.ai_lms.lms.problem_log.vo.ProblemLogVO;
+
+/**
+ * @author 권지수
+ * @since 2024.08.01
+ *
+ * 문제 풀이 로그 Service 클래스
+ */
+
+public interface ProblemLogService {
+
+    /**
+     * @author 권지수
+     * @since 2024.08.01
+     *
+     * 문제 풀이 로그 정보 입력
+     */
+    int insertProblemLog(ProblemLogVO problemLogVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 수정
+     */
+    int updateProblemLog(ProblemLogVO problemLogVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 삭제
+     */
+    int deleteProblemLog(ProblemLogVO problemLogVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 조회
+     */
+    ProblemLogVO problemLogInfo(ProblemLogVO problemLogVO) throws Exception;
+}
 
src/main/java/com/takensoft/ai_lms/lms/problem_log/vo/ProblemLogVO.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/problem_log/vo/ProblemLogVO.java
@@ -0,0 +1,31 @@
+package com.takensoft.ai_lms.lms.problem_log.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+public class ProblemLogVO {
+    // 문제 풀이 로그 아이디
+    private String prblmLogId;
+    // 학생 답변
+    private String prblmAns;
+    // 풀이 시작 시간
+    private String prblmStrtTm;
+    // 풀이 종료 시간
+    private String prblmEndTm;
+    // 학생 정답 맞춤 여부
+    private String prblmLogAnsYn;
+    // 학생 재풀이 번호
+    private int prblmLogAnsCnt;
+    // 파일 관리 아이디
+    private String fileMngId;
+    // 학생 아이디
+    private String stdId;
+    // 문제 아이디
+    private String prblmId;
+}
 
src/main/java/com/takensoft/ai_lms/lms/problem_log/web/ProblemLogController.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/problem_log/web/ProblemLogController.java
@@ -0,0 +1,81 @@
+package com.takensoft.ai_lms.lms.problem_log.web;
+
+import com.takensoft.ai_lms.lms.problem.vo.ProblemVO;
+import com.takensoft.ai_lms.lms.problem_log.service.ProblemLogService;
+import com.takensoft.ai_lms.lms.problem_log.vo.ProblemLogVO;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author 권지수
+ * @since 2024.08.01
+ *
+ * 문제 풀이 로그 Controller 클래스
+ */
+
+@RestController
+@RequiredArgsConstructor
+@Slf4j
+@RequestMapping(value = "/problemLog")
+public class ProblemLogController {
+
+    private final ProblemLogService problemLogService;
+
+    /**
+     * @author 권지수
+     * @since 2024.08.01
+     *
+     * 문제 풀이 로그 정보 입력
+     */
+    @PostMapping(path = "/insertProblemLog.json")
+    public ResponseEntity<?> insertProblemLog(@RequestBody ProblemLogVO problemLogVO) throws Exception {
+        int result = problemLogService.insertProblemLog(problemLogVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 수정
+     */
+    @PostMapping(path = "/updateProblemLog.json")
+    public ResponseEntity<?> updateProblemLog(@RequestBody ProblemLogVO problemLogVO) throws Exception {
+        int result = problemLogService.updateProblemLog(problemLogVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 삭제
+     */
+    @PostMapping(path = "/deleteProblemLog.json")
+    public ResponseEntity<?> deleteProblemLog(@RequestBody ProblemLogVO problemLogVO) throws Exception {
+        int result = problemLogService.deleteProblemLog(problemLogVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.08.02
+     *
+     * 문제 풀이 로그 정보 조회
+     */
+    @PostMapping(path = "/problemLogInfo.json")
+    public ResponseEntity<?> problemLogInfo(@RequestBody ProblemLogVO problemLogVO) throws Exception {
+        ProblemLogVO result = problemLogService.problemLogInfo(problemLogVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+}
src/main/java/com/takensoft/ai_lms/lms/text/vo/TextVO.java
--- src/main/java/com/takensoft/ai_lms/lms/text/vo/TextVO.java
+++ src/main/java/com/takensoft/ai_lms/lms/text/vo/TextVO.java
@@ -35,5 +35,9 @@
     private String textTypeId;
     // 사용자 아이디(선생님)
     private String userId;
+    // 책 아이디
+    private String bookId;
+    // 단원 아이디
+    private String unitId;
 
 }
src/main/java/com/takensoft/ai_lms/lms/unit/dao/UnitDAO.java
--- src/main/java/com/takensoft/ai_lms/lms/unit/dao/UnitDAO.java
+++ src/main/java/com/takensoft/ai_lms/lms/unit/dao/UnitDAO.java
@@ -3,6 +3,7 @@
 import com.takensoft.ai_lms.lms.unit.vo.UnitVO;
 import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
 
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -52,5 +53,5 @@
      *
      * 단원 상세 정보
      */
-    List<UnitVO> unitDetail(UnitVO unitVO) throws Exception;
+    List<HashMap<String, Object>> unitDetail(UnitVO unitVO) throws Exception;
 }
src/main/java/com/takensoft/ai_lms/lms/unit/service/Impl/UnitServiceImpl.java
--- src/main/java/com/takensoft/ai_lms/lms/unit/service/Impl/UnitServiceImpl.java
+++ src/main/java/com/takensoft/ai_lms/lms/unit/service/Impl/UnitServiceImpl.java
@@ -81,7 +81,7 @@
      * 단원 상세 정보
      */
     @Override
-    public List<UnitVO> unitDetail(UnitVO unitVO) throws Exception {
+    public List<HashMap<String, Object>> unitDetail(UnitVO unitVO) throws Exception {
         return unitDAO.unitDetail(unitVO);
     }
 
src/main/java/com/takensoft/ai_lms/lms/unit/service/UnitService.java
--- src/main/java/com/takensoft/ai_lms/lms/unit/service/UnitService.java
+++ src/main/java/com/takensoft/ai_lms/lms/unit/service/UnitService.java
@@ -51,6 +51,6 @@
      *
      * 단원 상세 정보
      */
-    List<UnitVO> unitDetail (UnitVO unitVO) throws Exception;
+    List<HashMap<String, Object>> unitDetail (UnitVO unitVO) throws Exception;
 
 }
src/main/java/com/takensoft/ai_lms/lms/unit/web/UnitController.java
--- src/main/java/com/takensoft/ai_lms/lms/unit/web/UnitController.java
+++ src/main/java/com/takensoft/ai_lms/lms/unit/web/UnitController.java
@@ -84,7 +84,7 @@
      */
     @PostMapping(path = "/unitDetail.json")
     public ResponseEntity<?> unitDetail(@RequestBody UnitVO unitVO) throws Exception {
-        List<UnitVO> result = unitService.unitDetail(unitVO);
+        List<HashMap<String, Object>> result = unitService.unitDetail(unitVO);
         return new ResponseEntity<>(result, HttpStatus.OK);
     }
 }
src/main/java/com/takensoft/ai_lms/lms/user_class/dao/UserClassDAO.java
--- src/main/java/com/takensoft/ai_lms/lms/user_class/dao/UserClassDAO.java
+++ src/main/java/com/takensoft/ai_lms/lms/user_class/dao/UserClassDAO.java
@@ -6,7 +6,7 @@
 import java.util.List;
 
 /**
- * @author
+ * @author 권민수
  * @since 2024.07.31
  *
  * 반별 학생 맵핑 DAO 인터페이스
src/main/java/com/takensoft/ai_lms/lms/user_class/service/Impl/UserClassServiceImpl.java
--- src/main/java/com/takensoft/ai_lms/lms/user_class/service/Impl/UserClassServiceImpl.java
+++ src/main/java/com/takensoft/ai_lms/lms/user_class/service/Impl/UserClassServiceImpl.java
@@ -10,11 +10,12 @@
 import java.util.List;
 
 /**
- * @author
+ * @author 권민수
  * @since 2024.07.31
  *
  * 반별 학생 맵핑 Service 구현 클래스
  */
+
 @Service
 @RequiredArgsConstructor
 public class UserClassServiceImpl implements UserClassService {
src/main/java/com/takensoft/ai_lms/lms/user_class/service/UserClassService.java
--- src/main/java/com/takensoft/ai_lms/lms/user_class/service/UserClassService.java
+++ src/main/java/com/takensoft/ai_lms/lms/user_class/service/UserClassService.java
@@ -5,7 +5,7 @@
 import java.util.List;
 
 /**
- * @author
+ * @author 권민수
  * @since 2024.07.31
  *
  * 반별 학생 맵핑 Service 인터페이스
src/main/java/com/takensoft/ai_lms/lms/user_class/web/UserClassController.java
--- src/main/java/com/takensoft/ai_lms/lms/user_class/web/UserClassController.java
+++ src/main/java/com/takensoft/ai_lms/lms/user_class/web/UserClassController.java
@@ -10,7 +10,7 @@
 import java.util.Map;
 
 /**
- * @author
+ * @author 권민수
  * @since 2024.07.31
  *
  * 반별 학생 맵핑 컨트롤러
 
src/main/java/com/takensoft/ai_lms/lms/user_unit/dao/UserUnitDAO.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/user_unit/dao/UserUnitDAO.java
@@ -0,0 +1,33 @@
+package com.takensoft.ai_lms.lms.user_unit.dao;
+
+import com.takensoft.ai_lms.lms.user_unit.vo.UserUnitVO;
+import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
+
+import java.util.List;
+
+/**
+ * @author 권민수
+ * @since 2024.08.02
+ *
+ * 사용자 학습 진행 정보 DAO 인터페이스
+ */
+
+@Mapper("userUnitDAO")
+public interface UserUnitDAO {
+
+    // 유저 학습 정보 리스트 조회
+    List<UserUnitVO> getUserUnits();
+
+    // 특정 유저 학습 정보 조회
+    UserUnitVO getUserUnitById(UserUnitVO userUnit);
+
+    // 유저 학습 정보 생성
+    int insertUserUnit(UserUnitVO userUnit);
+
+    // 유저 학습 정보 수정
+    int updateUserUnit(UserUnitVO userUnit);
+
+    // 유저 학습 정보 삭제
+    int deleteUserUnit(UserUnitVO userUnit);
+
+}
 
src/main/java/com/takensoft/ai_lms/lms/user_unit/service/Impl/UserUnitServiceImpl.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/user_unit/service/Impl/UserUnitServiceImpl.java
@@ -0,0 +1,60 @@
+package com.takensoft.ai_lms.lms.user_unit.service.Impl;
+
+import com.takensoft.ai_lms.lms.user_unit.dao.UserUnitDAO;
+import com.takensoft.ai_lms.lms.user_unit.service.UserUnitService;
+import com.takensoft.ai_lms.lms.user_unit.vo.UserUnitVO;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+
+/**
+ * @author 권민수
+ * @since 2024.08.02
+ *
+ * 사용자 학습 진행 정보 서비스 구현 클래스
+ */
+
+@Service
+@RequiredArgsConstructor
+public class UserUnitServiceImpl implements UserUnitService {
+
+    private final UserUnitDAO userUnitDAO;
+
+    @Override
+    public List<UserUnitVO> getUserUnits() {
+        return userUnitDAO.getUserUnits();
+    }
+
+    @Override
+    public UserUnitVO getUserUnitById(UserUnitVO userUnit) {
+        return userUnitDAO.getUserUnitById(userUnit);
+    }
+
+    @Override
+    public void insertUserUnit(UserUnitVO userUnit) {
+        userUnitDAO.insertUserUnit(userUnit);
+    }
+
+    @Override
+    public void updateUserUnit(UserUnitVO userUnit) {
+        // "yyyy-MM-dd HH:mm:ss.SSSSSS" 형식의 문자열을 Timestamp로 변환
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS");
+        LocalDateTime localDateTime = LocalDateTime.parse(userUnit.getCmptnTm(), formatter);
+        Timestamp timestamp = Timestamp.valueOf(localDateTime);
+
+        // DAO에 전달하기 전에 변환된 타임스탬프 설정
+        userUnit.setCmptnTm(timestamp.toString());
+
+        userUnitDAO.updateUserUnit(userUnit);
+    }
+
+    @Override
+    public void deleteUserUnit(UserUnitVO userUnit) {
+        userUnitDAO.deleteUserUnit(userUnit);
+    }
+
+}
 
src/main/java/com/takensoft/ai_lms/lms/user_unit/service/UserUnitService.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/user_unit/service/UserUnitService.java
@@ -0,0 +1,31 @@
+package com.takensoft.ai_lms.lms.user_unit.service;
+
+import com.takensoft.ai_lms.lms.user_unit.vo.UserUnitVO;
+
+import java.util.List;
+
+/**
+ * @author 권민수
+ * @since 2024.08.02
+ *
+ * 사용자 학습 진행 정보 서비스 인터페이스
+ */
+
+public interface UserUnitService {
+
+    // 유저 학습 정보 리스트 조회
+    List<UserUnitVO> getUserUnits();
+
+    // 특정 유저 학습 정보 조회
+    UserUnitVO getUserUnitById(UserUnitVO userUnit);
+
+    // 유저 학습 정보 생성
+    void insertUserUnit(UserUnitVO userUnit);
+
+    // 유저 학습 정보 수정
+    void updateUserUnit(UserUnitVO userUnit);
+
+    // 유저 학습 정보 삭제
+    void deleteUserUnit(UserUnitVO userUnit);
+
+}
 
src/main/java/com/takensoft/ai_lms/lms/user_unit/vo/UserUnitVO.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/user_unit/vo/UserUnitVO.java
@@ -0,0 +1,24 @@
+package com.takensoft.ai_lms.lms.user_unit.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author 권민수
+ * @since 2024.08.02
+ *
+ * 사용자 학습 진행 정보 VO 클래스
+ */
+
+@Getter
+@Setter
+public class UserUnitVO {
+
+    private String unitId;
+    private String stdId;
+    private String userId;
+    private String sclsId;
+    private String cmptnYn;
+    private String cmptnTm;
+
+}
 
src/main/java/com/takensoft/ai_lms/lms/user_unit/web/UserUnitController.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/user_unit/web/UserUnitController.java
@@ -0,0 +1,67 @@
+package com.takensoft.ai_lms.lms.user_unit.web;
+
+import com.takensoft.ai_lms.lms.user_unit.service.UserUnitService;
+import com.takensoft.ai_lms.lms.user_unit.vo.UserUnitVO;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author 권민수
+ * @since 2024.08.02
+ *
+ * 사용자 학습 진행 정보 컨트롤러
+ */
+
+@RestController
+@RequiredArgsConstructor
+@Slf4j
+@RequestMapping("/userunit")
+public class UserUnitController {
+
+    private final UserUnitService userUnitService;
+
+    // 유저 유닛 리스트 조회
+    @PostMapping("/findAll.json")
+    public List<UserUnitVO> getUserUnits() {
+        return userUnitService.getUserUnits();
+    }
+
+    // 특정 유저 유닛 조회
+    @PostMapping("/find.json")
+    public UserUnitVO getUserUnitById(@RequestBody UserUnitVO userUnit) {
+        return userUnitService.getUserUnitById(userUnit);
+    }
+
+    // 유저 유닛 생성
+    @PostMapping("/insert.json")
+    public void insertUserUnit(@RequestBody Map<String, String> req) {
+        UserUnitVO userUnit = new UserUnitVO();
+        userUnit.setUnitId(req.get("unitId"));
+        userUnit.setStdId(req.get("stdId"));
+        userUnit.setUserId(req.get("userId"));
+        userUnit.setSclsId(req.get("sclsId"));
+        userUnit.setCmptnYn(req.get("cmptnYn"));
+        userUnit.setCmptnTm(req.get("cmptnTm"));
+        userUnitService.insertUserUnit(userUnit);
+    }
+
+    // 유저 유닛 수정
+    @PostMapping("/update.json")
+    public void updateUserUnit(@RequestBody UserUnitVO userUnit) {
+        userUnitService.updateUserUnit(userUnit);
+    }
+
+    // 유저 유닛 삭제
+    @PostMapping("/delete.json")
+    public void deleteUserUnit(@RequestBody UserUnitVO userUnit) {
+        userUnitService.deleteUserUnit(userUnit);
+    }
+
+}
src/main/resources/mybatis/mapper/lms/book-SQL.xml
--- src/main/resources/mybatis/mapper/lms/book-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/book-SQL.xml
@@ -17,6 +17,7 @@
             book_id,
             book_nm
          FROM book
+     ORDER BY book_id
     </select>
 
     <!--
src/main/resources/mybatis/mapper/lms/eval_problem-SQL.xml
--- src/main/resources/mybatis/mapper/lms/eval_problem-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/eval_problem-SQL.xml
@@ -29,4 +29,15 @@
         WHERE eval_id = #{evalId}
     </select>
 
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.08.01
+        내   용 : 단원 평가에 등록된 문제 삭제
+    -->
+    <delete id="deleteEvalProblem" parameterType="EvalProblemVO">
+        DELETE FROM eval_problem
+        WHERE prblm_id = #{prblmId}
+            AND eval_id = #{evalId}
+    </delete>
+
 </mapper>
(파일 끝에 줄바꿈 문자 없음)
src/main/resources/mybatis/mapper/lms/problem-SQL.xml
--- src/main/resources/mybatis/mapper/lms/problem-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/problem-SQL.xml
@@ -2,17 +2,6 @@
 <!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.problem.dao.ProblemDAO">
 
-    <!--resultMap id="problemMap" type="ProblemVO">
-        <result property="prblmId" column="prblm_id"/>
-        <result property="prblmExpln" column="prblm_expln"/>
-        <result property="prblmScr" column="prblm_scr"/>
-        <result property="prblmHint" column="prblm_hint"/>
-        <result property="prblmCmmt" column="prblm_cmmt"/>
-        <result property="fileMngId" column="file_mng_id"/>
-        <result property="prblmTypeId" column="prblm_type_id"/>
-        <result property="prblmCtgryId" column="prblm_ctgry_id"/>
-    </resultMap-->
-
     <!--
         작 성 자 : 권지수
         작 성 일 : 2024.07.25
@@ -27,7 +16,10 @@
             prblm_cmmt,
             file_mng_id,
             prblm_type_id,
-            prblm_ctgry_id
+            prblm_ctgry_id,
+            user_id,
+            book_id,
+            unit_id
         FROM problem
         WHERE prblm_id = #{prblmId}
     </select>
@@ -62,7 +54,10 @@
             prblm_cmmt,
             file_mng_id,
             prblm_type_id,
-            prblm_ctgry_id
+            prblm_ctgry_id,
+            user_id,
+            book_id,
+            unit_id
         ) VALUES (
             #{prblmId},
             #{prblmExpln},
@@ -71,7 +66,10 @@
             #{prblmCmmt},
             #{fileMngId},
             #{prblmTypeId},
-            #{prblmCtgryId}
+            #{prblmCtgryId},
+            #{userId},
+            #{bookId},
+            #{unitId}
         )
     </insert>
 
@@ -110,7 +108,10 @@
             prblm_cmmt = #{prblmCmmt},
             file_mng_id = #{fileMngId},
             prblm_type_id = #{prblmTypeId},
-            prblm_ctgry_id = #{prblmCtgryId}
+            prblm_ctgry_id = #{prblmCtgryId},
+            user_id = #{userId},
+            book_id = #{bookId},
+            unit_id = #{unitId}
         WHERE prblm_id = #{prblmId}
     </update>
 
@@ -152,7 +153,10 @@
             prblm_cmmt,
             file_mng_id,
             prblm_type_id,
-            prblm_ctgry_id
+            prblm_ctgry_id,
+            user_id,
+            book_id,
+            unit_id
         FROM problem
         WHERE 1 = 1
         <if test="option != null and keyword != null">
@@ -191,7 +195,10 @@
             p.prblm_cmmt AS prblmCmmt,
             p.file_mng_id AS fileMngId,
             p.prblm_type_id AS prblmTypeId,
-            p.prblm_ctgry_id AS prblmCtgryId
+            p.prblm_ctgry_id AS prblmCtgryId,
+            p.user_id AS userId,
+            p.book_id AS bookId,
+            p.unit_id AS unitId
         FROM
             eval_problem ep
         JOIN
 
src/main/resources/mybatis/mapper/lms/problem_log-SQL.xml (added)
+++ src/main/resources/mybatis/mapper/lms/problem_log-SQL.xml
@@ -0,0 +1,84 @@
+<?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.problem_log.dao.ProblemLogDAO">
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.08.01
+        내   용 : 문제 풀이 로그 정보 insert
+    -->
+    <insert id="insertProblemLog" parameterType="ProblemLogVO">
+        INSERT INTO problem_log (
+            prblm_log_id,
+            prblm_ans,
+            prblm_strt_tm,
+            prblm_end_tm,
+            prblm_log_ans_yn,
+            prblm_log_ans_cnt,
+            file_mng_id,
+            std_id,
+            prblm_id
+        ) VALUES (
+            #{prblmLogId},
+            #{prblmAns},
+            #{prblmStrtTm},
+            #{prblmEndTm},
+            #{prblmLogAnsYn} ,
+            #{prblmLogAnsCnt} ,
+            #{fileMngId},
+            #{stdId},
+            #{prblmId}
+        )
+    </insert>
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.08.02
+        내   용 : 문제 풀이 로그 정보 update
+    -->
+    <update id="updateProblemLog" parameterType="ProblemLogVO">
+        UPDATE problem_log
+        SET
+            prblm_ans = #{prblmAns},
+            prblm_strt_tm = #{prblmStrtTm},
+            prblm_end_tm = #{prblmEndTm},
+            prblm_log_ans_yn = #{prblmLogAnsYn},
+            prblm_log_ans_cnt = #{prblmLogAnsCnt},
+            file_mng_id = #{fileMngId},
+            std_id = #{stdId},
+            prblm_id = #{prblmId}
+        WHERE prblm_log_id = #{prblmLogId}
+    </update>
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.08.02
+        내   용 : 문제 풀이 로그 정보 delete
+    -->
+    <delete id="deleteProblemLog" parameterType="ProblemLogVO">
+        DELETE FROM problem_log
+        WHERE prblm_log_id = #{prblmLogId}
+    </delete>
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.08.02
+        내   용 : 문제 풀이 로그 정보 read
+    -->
+    <select id="problemLogInfo" parameterType="ProblemLogVO" resultType="ProblemLogVO">
+        SELECT
+            prblm_log_id,
+            prblm_ans,
+            prblm_strt_tm,
+            prblm_end_tm,
+            prblm_log_ans_yn,
+            prblm_log_ans_cnt,
+            file_mng_id,
+            std_id,
+            prblm_id
+        FROM problem_log
+        WHERE prblm_log_id = #{prblmLogId}
+    </select>
+
+
+</mapper>(파일 끝에 줄바꿈 문자 없음)
src/main/resources/mybatis/mapper/lms/text-SQL.xml
--- src/main/resources/mybatis/mapper/lms/text-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/text-SQL.xml
@@ -11,6 +11,8 @@
         <result property="fileMngId" column="file_mng_id"/>
         <result property="textTypeId" column="text_type_id"/>
         <result property="userId" column="user_id"/>
+        <result property="bookId" column="book_id"/>
+        <result property="unitId" column="unit_id"/>
     </resultMap>
 
 
@@ -28,6 +30,8 @@
                          ,file_mng_id
                          ,text_type_id
                          ,user_id
+                         ,book_id
+                         ,unit_id
         ) VALUES (#{textId}
                  ,#{textTtl}
                  ,#{textCnt}
@@ -36,6 +40,8 @@
                  ,#{fileMngId}
                  ,#{textTypeId}
                  ,#{userId}
+                 ,#{bookId}
+                 ,#{unitId}
                  );
     </insert>
 
@@ -63,6 +69,8 @@
               ,file_mng_id
               ,text_type_id
               ,user_id
+              ,book_id
+              ,unit_id
         FROM text
         ORDER BY text_id DESC
         LIMIT #{pageSize}
@@ -83,6 +91,8 @@
              , file_mng_id
              , text_type_id
               ,user_id
+              ,book_id
+              ,unit_id
         FROM text
         WHERE text_id = #{textId}
         ORDER BY text_id DESC
src/main/resources/mybatis/mapper/lms/unit-SQL.xml
--- src/main/resources/mybatis/mapper/lms/unit-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/unit-SQL.xml
@@ -64,15 +64,26 @@
 
     <!--
     작 성 자 : 김건택
-    작 성 일 : 2024.07.25
+    작 성 일 : 2024.08.02
     내   용 : 단원 상세 정보
 -->
-    <select id="unitDetail" parameterType="UnitVO" resultType="com.takensoft.ai_lms.lms.unit.vo.UnitVO">
-        SELECT unit_id
-            , book_id
-            , unit_nm
-        FROM unit
-        WHERE unit_id = #{unitId}
+<!--    <select id="unitDetail" parameterType="UnitVO" resultType="com.takensoft.ai_lms.lms.unit.vo.UnitVO">-->
+<!--        SELECT unit_id-->
+<!--            , book_id-->
+<!--            , unit_nm-->
+<!--        FROM unit-->
+<!--        WHERE unit_id = #{unitId}-->
+<!--    </select>-->
+
+    <select id="unitDetail" parameterType="UnitVO" resultType="HashMap">
+        SELECT t.text_id
+            , u.unit_id
+            , u.book_id
+            , w.wd_book_id
+        FROM unit u
+        JOIN text t ON u.unit_id = t.unit_id
+        JOIN wordbook w ON u.book_id = w.book_id
+        WHERE u.book_id = #{bookId} AND u.unit_id = #{unitId};
     </select>
 
 </mapper>
(파일 끝에 줄바꿈 문자 없음)
src/main/resources/mybatis/mapper/lms/unit_learning-SQL.xml
--- src/main/resources/mybatis/mapper/lms/unit_learning-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/unit_learning-SQL.xml
@@ -28,6 +28,7 @@
          JOIN unit u
            ON ul.unit_id = u.unit_id
         WHERE ul.unit_id = #{unit_id} AND u.book_id = #{book_id}
+     ORDER BY seq
     </select>
 
     <!--
 
src/main/resources/mybatis/mapper/lms/user_unit-SQL.xml (added)
+++ src/main/resources/mybatis/mapper/lms/user_unit-SQL.xml
@@ -0,0 +1,67 @@
+<?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.user_unit.dao.UserUnitDAO">
+
+    <!--
+        작 성 자 : 권민수
+        작 성 일 : 2024.08.02
+        내   용 : 사용자 학습 진행 정보 테이블 sql 매핑 xml 문서
+    -->
+
+    <resultMap id="UserUnitResultMap" type="UserUnitVO">
+        <id property="unitId" column="unit_id"/>
+        <id property="stdId" column="std_id"/>
+        <id property="userId" column="user_id"/>
+        <id property="sclsId" column="scls_id"/>
+        <result property="cmptnYn" column="cmptn_yn"/>
+        <result property="cmptnTm" column="cmptn_tm"/>
+    </resultMap>
+
+    <select id="getUserUnits" resultMap="UserUnitResultMap">
+        SELECT * FROM ai_lms.user_unit
+    </select>
+
+    <select id="getUserUnitById" parameterType="UserUnitVO" resultMap="UserUnitResultMap">
+        SELECT * FROM ai_lms.user_unit
+        WHERE unit_id = #{unitId}
+          AND std_id = #{stdId}
+          AND user_id = #{userId}
+          AND scls_id = #{sclsId}
+    </select>
+
+    <insert id="insertUserUnit" parameterType="UserUnitVO">
+        INSERT INTO
+            ai_lms.user_unit (unit_id,
+                              std_id,
+                              user_id,
+                              scls_id,
+                              cmptn_yn,
+                              cmptn_tm)
+        VALUES (#{unitId},
+                #{stdId},
+                #{userId},
+                #{sclsId},
+                #{cmptnYn},
+                TO_TIMESTAMP(#{cmptnTm}, 'YYYY-MM-DD HH24:MI:SS.US'))
+    </insert>
+
+    <update id="updateUserUnit" parameterType="UserUnitVO">
+        UPDATE ai_lms.user_unit
+        SET cmptn_yn = #{cmptnYn},
+            cmptn_tm = TO_TIMESTAMP(#{cmptnTm}, 'YYYY-MM-DD HH24:MI:SS.US')
+        WHERE unit_id = #{unitId}
+          AND std_id = #{stdId}
+          AND user_id = #{userId}
+          AND scls_id = #{sclsId}
+    </update>
+
+    <delete id="deleteUserUnit" parameterType="UserUnitVO">
+        DELETE FROM ai_lms.user_unit
+        WHERE unit_id = #{unitId}
+          AND std_id = #{stdId}
+          AND user_id = #{userId}
+          AND scls_id = #{sclsId}
+    </delete>
+
+
+</mapper>(파일 끝에 줄바꿈 문자 없음)
Add a comment
List