guntaek 07-29
240729 김건택 사진, 사진첩 CRUD 수정
@21394ad005a65bc30c0b921803eeae5d5edcf53b
src/main/java/com/takensoft/ai_lms/lms/photo/service/Impl/PhotoServiceImpl.java
--- src/main/java/com/takensoft/ai_lms/lms/photo/service/Impl/PhotoServiceImpl.java
+++ src/main/java/com/takensoft/ai_lms/lms/photo/service/Impl/PhotoServiceImpl.java
@@ -25,7 +25,7 @@
     }
 
     @Override
-    public int insertphoto(PhotoVO photoVO) throws Exception {
+    public int insertPhoto(PhotoVO photoVO) throws Exception {
         String photoId = photoIdgn.getNextStringId();
         photoVO.setPhotoId(photoId);
         int result = photoDAO.insertPhoto(photoVO);
@@ -33,13 +33,13 @@
     }
 
     @Override
-    public int updatephoto(PhotoVO photoVO) throws Exception {
+    public int updatePhoto(PhotoVO photoVO) throws Exception {
         int result = photoDAO.updatePhoto(photoVO);
         return result;
     }
 
     @Override
-    public int deletephoto(PhotoVO photoVO) throws Exception {
+    public int deletePhoto(PhotoVO photoVO) throws Exception {
         int result = photoDAO.deletePhoto(photoVO);
         return result;
     }
src/main/java/com/takensoft/ai_lms/lms/photo/service/PhotoService.java
--- src/main/java/com/takensoft/ai_lms/lms/photo/service/PhotoService.java
+++ src/main/java/com/takensoft/ai_lms/lms/photo/service/PhotoService.java
@@ -8,11 +8,11 @@
 
     List<PhotoVO> photoList () throws Exception;
 
-    int insertphoto(PhotoVO photoVO) throws Exception;
+    int insertPhoto(PhotoVO photoVO) throws Exception;
 
-    int updatephoto(PhotoVO photoVO) throws Exception;
+    int updatePhoto(PhotoVO photoVO) throws Exception;
 
-    int deletephoto(PhotoVO photoVO) throws Exception;
+    int deletePhoto(PhotoVO photoVO) throws Exception;
 
     List<PhotoVO> photoDetail (PhotoVO photoVO) throws Exception;
 }
src/main/java/com/takensoft/ai_lms/lms/photo/web/PhotoController.java
--- src/main/java/com/takensoft/ai_lms/lms/photo/web/PhotoController.java
+++ src/main/java/com/takensoft/ai_lms/lms/photo/web/PhotoController.java
@@ -30,19 +30,19 @@
 
     @PostMapping(path = "/insertPhoto.json")
     public ResponseEntity<?> insertUnit(@RequestBody PhotoVO photoVO) throws Exception {
-        int result = photoService.insertphoto(photoVO);
+        int result = photoService.insertPhoto(photoVO);
         return new ResponseEntity<>(result, HttpStatus.OK);
     }
 
     @PostMapping(path = "/updatePhoto.json")
     public ResponseEntity<?> updateUnit(@RequestBody PhotoVO photoVO) throws Exception {
-        int result = photoService.updatephoto(photoVO);
+        int result = photoService.updatePhoto(photoVO);
         return new ResponseEntity<>(result, HttpStatus.OK);
     }
 
     @PostMapping(path = "/deletePhoto.json")
     public ResponseEntity<?> deleteUnit(@RequestBody PhotoVO photoVO) throws Exception {
-        int result = photoService.deletephoto(photoVO);
+        int result = photoService.deletePhoto(photoVO);
         return new ResponseEntity<>(result, HttpStatus.OK);
     }
 
src/main/java/com/takensoft/ai_lms/lms/photoMng/dao/PhotoMngDAO.java
--- src/main/java/com/takensoft/ai_lms/lms/photoMng/dao/PhotoMngDAO.java
+++ src/main/java/com/takensoft/ai_lms/lms/photoMng/dao/PhotoMngDAO.java
@@ -1,8 +1,19 @@
 package com.takensoft.ai_lms.lms.photoMng.dao;
 
+import com.takensoft.ai_lms.lms.photoMng.vo.PhotoMngVO;
 import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
+
+import java.util.List;
 
 @Mapper("photoMngDAO")
 public interface PhotoMngDAO {
+    List<PhotoMngVO> photoMngList () throws Exception;
 
+    int insertPhotoMng(PhotoMngVO photoMngVO) throws Exception;
+
+    int updatePhotoMng(PhotoMngVO photoMngVO) throws Exception;
+
+    int deletePhotoMng(PhotoMngVO photoMngVO) throws Exception;
+
+    List<PhotoMngVO> photoMngDetail (PhotoMngVO photoMngVO) throws Exception;
 }
src/main/java/com/takensoft/ai_lms/lms/photoMng/service/Impl/PhotoMngServiceImpl.java
--- src/main/java/com/takensoft/ai_lms/lms/photoMng/service/Impl/PhotoMngServiceImpl.java
+++ src/main/java/com/takensoft/ai_lms/lms/photoMng/service/Impl/PhotoMngServiceImpl.java
@@ -1,4 +1,49 @@
 package com.takensoft.ai_lms.lms.photoMng.service.Impl;
 
-public class PhotoMngServiceImpl {
+import com.takensoft.ai_lms.common.idgen.service.IdgenService;
+import com.takensoft.ai_lms.lms.photoMng.dao.PhotoMngDAO;
+import com.takensoft.ai_lms.lms.photoMng.service.PhotoMngService;
+import com.takensoft.ai_lms.lms.photoMng.vo.PhotoMngVO;
+import lombok.RequiredArgsConstructor;
+import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service("photoMngService")
+@RequiredArgsConstructor
+public class PhotoMngServiceImpl extends EgovAbstractServiceImpl implements PhotoMngService {
+
+    private final PhotoMngDAO photoMngDAO;
+    private final IdgenService photoMngIdgn;
+
+    @Override
+    public List<PhotoMngVO> photoMngList() throws Exception {
+        return photoMngDAO.photoMngList();
+    }
+
+    @Override
+    public int insertPhotoMng(PhotoMngVO photoMngVO) throws Exception {
+        String photoMngId = photoMngIdgn.getNextStringId();
+        photoMngVO.setPhotoMngId(photoMngId);
+        int result = photoMngDAO.insertPhotoMng(photoMngVO);
+        return result;
+    }
+
+    @Override
+    public int updatePhotoMng(PhotoMngVO photoMngVO) throws Exception {
+        int result = photoMngDAO.updatePhotoMng(photoMngVO);
+        return result;
+    }
+
+    @Override
+    public int deletePhotoMng(PhotoMngVO photoMngVO) throws Exception {
+        int result = photoMngDAO.deletePhotoMng(photoMngVO);
+        return result;
+    }
+
+    @Override
+    public List<PhotoMngVO> photoMngDetail(PhotoMngVO photoMngVO) throws Exception {
+        return photoMngDAO.photoMngDetail(photoMngVO);
+    }
 }
src/main/java/com/takensoft/ai_lms/lms/photoMng/service/PhotoMngService.java
--- src/main/java/com/takensoft/ai_lms/lms/photoMng/service/PhotoMngService.java
+++ src/main/java/com/takensoft/ai_lms/lms/photoMng/service/PhotoMngService.java
@@ -1,4 +1,18 @@
 package com.takensoft.ai_lms.lms.photoMng.service;
 
+import com.takensoft.ai_lms.lms.photoMng.vo.PhotoMngVO;
+
+import java.util.List;
+
 public interface PhotoMngService {
+
+    List<PhotoMngVO> photoMngList () throws Exception;
+
+    int insertPhotoMng(PhotoMngVO photoMngVO) throws Exception;
+
+    int updatePhotoMng(PhotoMngVO photoMngVO) throws Exception;
+
+    int deletePhotoMng(PhotoMngVO photoMngVO) throws Exception;
+
+    List<PhotoMngVO> photoMngDetail (PhotoMngVO photoMngVO) throws Exception;
 }
src/main/java/com/takensoft/ai_lms/lms/photoMng/web/PhotoMngController.java
--- src/main/java/com/takensoft/ai_lms/lms/photoMng/web/PhotoMngController.java
+++ src/main/java/com/takensoft/ai_lms/lms/photoMng/web/PhotoMngController.java
@@ -1,4 +1,56 @@
 package com.takensoft.ai_lms.lms.photoMng.web;
 
+import com.takensoft.ai_lms.lms.photo.service.PhotoService;
+import com.takensoft.ai_lms.lms.photo.vo.PhotoVO;
+import com.takensoft.ai_lms.lms.photoMng.service.PhotoMngService;
+import com.takensoft.ai_lms.lms.photoMng.vo.PhotoMngVO;
+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;
+
+import java.util.List;
+
+@RestController
+@RequiredArgsConstructor
+@Slf4j
+@RequestMapping(value="/photoMng")
 public class PhotoMngController {
+
+    private final PhotoMngService photoMngService;
+
+
+    @PostMapping(path = "/photoMngList.json")
+    public ResponseEntity<?> unitList() throws Exception {
+        List<PhotoMngVO> result = photoMngService.photoMngList();
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    @PostMapping(path = "/insertPhotoMng.json")
+    public ResponseEntity<?> insertUnit(@RequestBody PhotoMngVO photoMngVO) throws Exception {
+        int result = photoMngService.insertPhotoMng(photoMngVO);
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    @PostMapping(path = "/updatePhotoMng.json")
+    public ResponseEntity<?> updateUnit(@RequestBody PhotoMngVO photoMngVO) throws Exception {
+        int result = photoMngService.updatePhotoMng(photoMngVO);
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    @PostMapping(path = "/deletePhotoMng.json")
+    public ResponseEntity<?> deleteUnit(@RequestBody PhotoMngVO photoMngVO) throws Exception {
+        int result = photoMngService.deletePhotoMng(photoMngVO);
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    @PostMapping(path = "/photoMngDetail.json")
+    public ResponseEntity<?> unitDetail(@RequestBody PhotoMngVO photoMngVO) throws Exception {
+        List<PhotoMngVO> result = photoMngService.photoMngDetail(photoMngVO);
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
 }
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
@@ -22,12 +22,7 @@
 
     private final UnitService unitService;
 
-    /**
-     * @author 박민혁
-     * @since 2024.07.06
-     *
-     * 테스트용 데이터 조회
-     */
+
     @PostMapping(path = "/unitList.json")
     public ResponseEntity<?> unitList() throws Exception {
         List<UnitVO> result = unitService.unitList();
src/main/resources/mybatis/mapper/lms/photo-SQL.xml
--- src/main/resources/mybatis/mapper/lms/photo-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/photo-SQL.xml
@@ -1,12 +1,7 @@
 <?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.photo.dao.PhotoDAO">
-    <!--
-        작 성 자 : 박민혁
-        작 성 일 : 2024.07.25
-        내   용 : 경로 생성을 위해 만들어 놓은 xml,
-        CRUD를 이용하는데 삭제하거나 수정해서 사용해주세요
-    -->
+
 
     <resultMap id="photoMap" type="photoVO">
         <result property="photoId" column="photo_id"/>
 
src/main/resources/mybatis/mapper/lms/photoMng-SQL.xml (added)
+++ src/main/resources/mybatis/mapper/lms/photoMng-SQL.xml
@@ -0,0 +1,48 @@
+<?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.photoMng.dao.PhotoMngDAO">
+
+
+    <resultMap id="photoMngMap" type="photoMngVO">
+        <result property="photoMngId" column="photo_mng_id"/>
+        <result property="sclsId" column="scls_id"/>
+
+    </resultMap>
+
+    <select id="photoMngList" resultType="com.takensoft.ai_lms.lms.photoMng.vo.PhotoMngVO">
+        SELECT photo_mng_id
+            , scls_id
+        FROM photo_manage
+    </select>
+
+    <insert id="insertPhotoMng" parameterType="PhotoMngVO">
+        INSERT INTO photo_manage (
+            photo_mng_id
+            , scls_id
+        ) VALUES (
+              #{photoMngId}
+            , #{sclsId}
+        )
+    </insert>
+
+    <update id="updatePhotoMng" parameterType="PhotoMngVO">
+        UPDATE photo_manage
+        SET    photo_mng_id = #{photoMngId}
+             , scls_id = #{sclsId}
+        WHERE  photo_mng_id = #{photoMngId}
+    </update>
+
+    <delete id="deletePhotoMng" parameterType="PhotoMngVO">
+        DELETE
+        FROM  photo_manage
+        WHERE photo_mng_id = #{photoMngId}
+    </delete>
+
+    <select id="photoDetail" parameterType="PhotoMngVO" resultType="com.takensoft.ai_lms.lms.photoMng.vo.PhotoMngVO">
+        SELECT photo_mng_id
+            , scls_id
+        WHERE photo_mng_id = #{photoMngId}
+        FROM photo_manage
+    </select>
+
+</mapper>(파일 끝에 줄바꿈 문자 없음)
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
@@ -1,12 +1,6 @@
 <?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.unit.dao.UnitDAO">
-    <!--
-        작 성 자 : 박민혁
-        작 성 일 : 2024.07.25
-        내   용 : 경로 생성을 위해 만들어 놓은 xml,
-        CRUD를 이용하는데 삭제하거나 수정해서 사용해주세요
-    -->
 
     <resultMap id="unitMap" type="UnitVO">
         <result property="unitId" column="unit_id"/>
Add a comment
List