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