
--- src/main/java/kr/co/takensoft/ai/system/common/idgen/context/ContextIdgen.java
+++ src/main/java/kr/co/takensoft/ai/system/common/idgen/context/ContextIdgen.java
... | ... | @@ -17,4 +17,92 @@ |
17 | 17 |
idgenServiceImpl.setTblNm("USID"); |
18 | 18 |
return idgenServiceImpl; |
19 | 19 |
} |
20 |
+ |
|
21 |
+ // 프로젝트 정보 |
|
22 |
+ @Bean(name = "projectIdgn") |
|
23 |
+ public IdgenService project() { |
|
24 |
+ IdgenService idgenServiceImpl = new IdgenService(); |
|
25 |
+ idgenServiceImpl.setCipers(15); |
|
26 |
+ idgenServiceImpl.setFillChar('0'); |
|
27 |
+ idgenServiceImpl.setPrefix("PRJT_"); |
|
28 |
+ idgenServiceImpl.setTblNm("PRJT"); |
|
29 |
+ return idgenServiceImpl; |
|
30 |
+ } |
|
31 |
+ |
|
32 |
+ // 피드백 정보 |
|
33 |
+ @Bean(name = "feedbackIdgn") |
|
34 |
+ public IdgenService feedback() { |
|
35 |
+ IdgenService idgenServiceImpl = new IdgenService(); |
|
36 |
+ idgenServiceImpl.setCipers(15); |
|
37 |
+ idgenServiceImpl.setFillChar('0'); |
|
38 |
+ idgenServiceImpl.setPrefix("FEBK_"); |
|
39 |
+ idgenServiceImpl.setTblNm("FEBK"); |
|
40 |
+ return idgenServiceImpl; |
|
41 |
+ } |
|
42 |
+ |
|
43 |
+ // 피드백 채팅 정보 |
|
44 |
+ @Bean(name = "feedbackChatIdgn") |
|
45 |
+ public IdgenService feedbackChat() { |
|
46 |
+ IdgenService idgenServiceImpl = new IdgenService(); |
|
47 |
+ idgenServiceImpl.setCipers(15); |
|
48 |
+ idgenServiceImpl.setFillChar('0'); |
|
49 |
+ idgenServiceImpl.setPrefix("FBCH_"); |
|
50 |
+ idgenServiceImpl.setTblNm("FBCH"); |
|
51 |
+ return idgenServiceImpl; |
|
52 |
+ } |
|
53 |
+ |
|
54 |
+ // 프로젝트 주석 정보 |
|
55 |
+ @Bean(name = "projectCommentIdgn") |
|
56 |
+ public IdgenService projectComment() { |
|
57 |
+ IdgenService idgenServiceImpl = new IdgenService(); |
|
58 |
+ idgenServiceImpl.setCipers(15); |
|
59 |
+ idgenServiceImpl.setFillChar('0'); |
|
60 |
+ idgenServiceImpl.setPrefix("PJCM_"); |
|
61 |
+ idgenServiceImpl.setTblNm("PJCM"); |
|
62 |
+ return idgenServiceImpl; |
|
63 |
+ } |
|
64 |
+ |
|
65 |
+ // 프로젝트 주석 정보 |
|
66 |
+ @Bean(name = "projectGroupIdgn") |
|
67 |
+ public IdgenService projectGroup() { |
|
68 |
+ IdgenService idgenServiceImpl = new IdgenService(); |
|
69 |
+ idgenServiceImpl.setCipers(15); |
|
70 |
+ idgenServiceImpl.setFillChar('0'); |
|
71 |
+ idgenServiceImpl.setPrefix("PJGP_"); |
|
72 |
+ idgenServiceImpl.setTblNm("PJGP"); |
|
73 |
+ return idgenServiceImpl; |
|
74 |
+ } |
|
75 |
+ |
|
76 |
+ // 프로젝트 이미지 정보 |
|
77 |
+ @Bean(name = "projectImageIdgn") |
|
78 |
+ public IdgenService projectImage() { |
|
79 |
+ IdgenService idgenServiceImpl = new IdgenService(); |
|
80 |
+ idgenServiceImpl.setCipers(15); |
|
81 |
+ idgenServiceImpl.setFillChar('0'); |
|
82 |
+ idgenServiceImpl.setPrefix("PJIG_"); |
|
83 |
+ idgenServiceImpl.setTblNm("PJIG"); |
|
84 |
+ return idgenServiceImpl; |
|
85 |
+ } |
|
86 |
+ |
|
87 |
+ // 프로젝트 로그 정보 |
|
88 |
+ @Bean(name = "projectLogIdgn") |
|
89 |
+ public IdgenService projectLog() { |
|
90 |
+ IdgenService idgenServiceImpl = new IdgenService(); |
|
91 |
+ idgenServiceImpl.setCipers(15); |
|
92 |
+ idgenServiceImpl.setFillChar('0'); |
|
93 |
+ idgenServiceImpl.setPrefix("PJLG_"); |
|
94 |
+ idgenServiceImpl.setTblNm("PJLG"); |
|
95 |
+ return idgenServiceImpl; |
|
96 |
+ } |
|
97 |
+ |
|
98 |
+ // 프로젝트 참여자 정보 |
|
99 |
+ @Bean(name = "projectMemberIdgn") |
|
100 |
+ public IdgenService projectMember() { |
|
101 |
+ IdgenService idgenServiceImpl = new IdgenService(); |
|
102 |
+ idgenServiceImpl.setCipers(15); |
|
103 |
+ idgenServiceImpl.setFillChar('0'); |
|
104 |
+ idgenServiceImpl.setPrefix("PJUS_"); |
|
105 |
+ idgenServiceImpl.setTblNm("PJUS"); |
|
106 |
+ return idgenServiceImpl; |
|
107 |
+ } |
|
20 | 108 |
}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/kr/co/takensoft/ai/system/project/dao/ProjectDAO.java
... | ... | @@ -0,0 +1,119 @@ |
1 | +package kr.co.takensoft.ai.system.project.dao; | |
2 | +import kr.co.takensoft.ai.system.project.dto.ProjectDTO; | |
3 | +import kr.co.takensoft.ai.system.project.dto.ProjectSearchReqDTO; | |
4 | +import kr.co.takensoft.ai.system.project.vo.ProjectVO; | |
5 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
6 | + | |
7 | +import java.util.List; | |
8 | +import java.util.Optional; | |
9 | + | |
10 | +/** | |
11 | + * @author 박현정 | |
12 | + * @since 2025.07.09 | |
13 | + * @modification | |
14 | + * since | author | description | |
15 | + * 2025.07.09 | 박현정 | 최초 등록 | |
16 | + * | |
17 | + * 프로젝트 관련 DAO | |
18 | + */ | |
19 | +@Mapper("projectDAO") | |
20 | +public interface ProjectDAO { | |
21 | + | |
22 | + /** | |
23 | + * @param projectVO - 프로젝트 정보 | |
24 | + * @return int - 프로젝트 등록 결과 | |
25 | + * | |
26 | + * 프로젝트 등록 | |
27 | + */ | |
28 | + int saveProject(ProjectVO projectVO); | |
29 | + | |
30 | + /** | |
31 | + * @param memberId - 사용자 아이디 | |
32 | + * @return List<ProjectVO> - 사용자가 참여하는 프로젝트 목록 | |
33 | + * | |
34 | + * 프로젝트 목록 조회 | |
35 | + */ | |
36 | + List<ProjectDTO> findProjectsByMemberId(String memberId); | |
37 | + | |
38 | + /** | |
39 | + * @param projectId - 프로젝트 아이디 | |
40 | + * @return ProjectVO - 프로젝트 정보 | |
41 | + * | |
42 | + * 프로젝트 정보 조회 | |
43 | + */ | |
44 | + Optional<ProjectVO> findById(String projectId); | |
45 | + | |
46 | + /** | |
47 | + * @param memberId - 사용자 아이디 | |
48 | + * @return int - 사용자가 생성한 프로젝트 개수 | |
49 | + * | |
50 | + * 사용자가 생성한 프로젝트 개수 조회 | |
51 | + */ | |
52 | + int countCreatedByMemberId(String memberId); | |
53 | + | |
54 | + /** | |
55 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
56 | + * @return int - 프로젝트 정보 수정 결과 | |
57 | + * | |
58 | + * 대표 프로젝트 해제 | |
59 | + */ | |
60 | + int unsetProjectMain(String projectGroupId); | |
61 | + | |
62 | + /** | |
63 | + * @param projectId - 프로젝트 아이디 | |
64 | + * @return boolean - 프로젝트 존재 여부 확인 결과 | |
65 | + * | |
66 | + * 프로젝트 존재 여부 확인 | |
67 | + */ | |
68 | + boolean existsById(String projectId); | |
69 | + | |
70 | + /** | |
71 | + * @param projectId - 프로젝트 아이디 | |
72 | + * @return String - 프로젝트 그룹 아이디 | |
73 | + * | |
74 | + * 프로젝트 그룹 아이디 조회 | |
75 | + */ | |
76 | + Optional<String> findProjectGroupIdByProjectId(String projectId); | |
77 | + | |
78 | + /** | |
79 | + * @param projectId - 프로젝트 아이디 | |
80 | + * @param projectName - 변경할 프로젝트 이름 | |
81 | + * @return int - 프로젝트 이름 변경 결과 | |
82 | + * | |
83 | + * 프로젝트 이름 변경 | |
84 | + */ | |
85 | + int updateProjectName(String projectId, String projectName); | |
86 | + | |
87 | + /** | |
88 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
89 | + * @return int - 프로젝트 삭제 결과 (use_at = 'N') | |
90 | + * | |
91 | + * 그룹 내 프로젝트 모두 삭제 (use_at = 'N') | |
92 | + */ | |
93 | + int deactivateProjectsByGroupId(String projectGroupId); | |
94 | + | |
95 | + /** | |
96 | + * @param projectId - 프로젝트 아이디 | |
97 | + * @return int - 프로젝트 정보 수정 결과 | |
98 | + * | |
99 | + * 대표 프로젝트 설정 | |
100 | + */ | |
101 | + int setProjectMain(String projectId); | |
102 | + | |
103 | + /** | |
104 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
105 | + * @param projectId - 프로젝트 아이디(created의 기준점이 되는 프로젝트) | |
106 | + * @return int - 프로젝트 삭제 결과 (use_at = 'N') | |
107 | + * | |
108 | + * 그룹 내에서 기준 프로젝트 이후에 생성된 프로젝트 모두 삭제 (use_at = 'N') | |
109 | + */ | |
110 | + int deactivateProjectsCreatedAfter(String projectGroupId, String projectId); | |
111 | + | |
112 | + /** | |
113 | + * @param searchReqDTO - 프로젝트 목록 검색 조건 | |
114 | + * @return List<ProjectVO> - 프로젝트 목록 정보 | |
115 | + * | |
116 | + * 프로젝트 목록 조회 | |
117 | + */ | |
118 | + List<ProjectVO> findAllProjects(ProjectSearchReqDTO searchReqDTO); | |
119 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/project/dto/InsertProjectDTO.java
... | ... | @@ -0,0 +1,26 @@ |
1 | +package kr.co.takensoft.ai.system.project.dto; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | +import lombok.Setter; | |
6 | + | |
7 | +/** | |
8 | + * @author 박현정 | |
9 | + * @since 2025.07.14 | |
10 | + * @modification | |
11 | + * since | author | description | |
12 | + * 2025.07.14 | 박현정 | 최초 등록 | |
13 | + * | |
14 | + * 프로젝트 정보 등록 관련 DTO | |
15 | + */ | |
16 | +@Setter | |
17 | +@Getter | |
18 | +@NoArgsConstructor | |
19 | +public class InsertProjectDTO { | |
20 | + | |
21 | + private String imageFileName; // 프로젝트 이미지 파일 이름 | |
22 | + private String imageFileUrl; // 프로젝트 이미지 파일 경로 | |
23 | + private String summary; // 프로젝트 주석 요약 | |
24 | + private String comment; // 프로젝트 주석 내용 | |
25 | + | |
26 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/project/dto/ProjectDTO.java
... | ... | @@ -0,0 +1,60 @@ |
1 | +package kr.co.takensoft.ai.system.project.dto; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.project.vo.ProjectVO; | |
4 | +import lombok.AllArgsConstructor; | |
5 | +import lombok.Getter; | |
6 | +import lombok.NoArgsConstructor; | |
7 | +import lombok.Setter; | |
8 | + | |
9 | +/** | |
10 | + * @author 박현정 | |
11 | + * @since 2025.07.11 | |
12 | + * @modification | |
13 | + * since | author | description | |
14 | + * 2025.07.11 | 박현정 | 최초 등록 | |
15 | + * | |
16 | + * 프로젝트 조회 관련 DTO | |
17 | + */ | |
18 | +@Setter | |
19 | +@Getter | |
20 | +@NoArgsConstructor | |
21 | +@AllArgsConstructor | |
22 | +public class ProjectDTO { | |
23 | + | |
24 | + private String projectId; // 프로젝트 아이디 | |
25 | + private String projectGroupId; // 프로젝트 그룹 아이디 | |
26 | + private String projectName; // 프로젝트 이름 | |
27 | + private String isMain; // 대표 프로젝트 여부 ( N: 대표 아님, Y: 대표) | |
28 | +// private List<ProjectMemberDTO> projectMembers; // 프로젝트 참여자 정보 목록 | |
29 | +// private ProjectCommentDTO projectComment; // 프로젝트 주석 정보 | |
30 | +// private ProjectImageDTO projectImage; // 이미지 정보 | |
31 | + private String createdAt; // 생성일자 | |
32 | + private String updatedAt; // 수정일자 | |
33 | + | |
34 | + public static ProjectDTO from | |
35 | + (ProjectVO projectVO) { | |
36 | + return new ProjectDTO( | |
37 | + projectVO.getProjectId(), | |
38 | + projectVO.getProjectGroupId(), | |
39 | + projectVO.getProjectName(), | |
40 | + projectVO.getIsMain(), | |
41 | + projectVO.getCreatedAt(), | |
42 | + projectVO.getUpdatedAt() | |
43 | + ); | |
44 | + } | |
45 | + | |
46 | +// public static ProjectDTO from | |
47 | +// (ProjectVO projectVO, List<ProjectMemberVO> projectMemberVOS, ProjectCommentVO commentVO, ProjectImageVO imageVO) { | |
48 | +// return new ProjectDTO( | |
49 | +// projectVO.getProjectId(), | |
50 | +// projectVO.getProjectGroupId(), | |
51 | +// projectVO.getProjectName(), | |
52 | +// projectVO.getIsMain(), | |
53 | +// projectMemberVOS.stream().map(ProjectMemberDTO::from).collect(Collectors.toList()), | |
54 | +// ProjectCommentDTO.from(commentVO), | |
55 | +// ProjectImageDTO.from(imageVO), | |
56 | +// projectVO.getCreatedAt(), | |
57 | +// projectVO.getUpdatedAt() | |
58 | +// ); | |
59 | +// } | |
60 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/project/dto/ProjectSearchReqDTO.java
... | ... | @@ -0,0 +1,26 @@ |
1 | +package kr.co.takensoft.ai.system.project.dto; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | +import lombok.Setter; | |
6 | + | |
7 | +/** | |
8 | + * @author 박현정 | |
9 | + * @since 2025.07.15 | |
10 | + * @modification | |
11 | + * since | author | description | |
12 | + * 2025.07.15 | 박현정 | 최초 등록 | |
13 | + * | |
14 | + * 프로젝트 검색 요청 관련 DTO | |
15 | + */ | |
16 | +@Setter | |
17 | +@Getter | |
18 | +@NoArgsConstructor | |
19 | +public class ProjectSearchReqDTO { | |
20 | + | |
21 | + private String memberId; // 사용자 아이디 | |
22 | + private String projectGroupId; // 프로젝트 그룹 아이디 | |
23 | + private String projectName; // 프로젝트 이름 | |
24 | + private String isMain; // 대표 프로젝트 여부('N' : 대표 아님, 'Y' : 대표) | |
25 | + | |
26 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/project/dto/UpdateProjectDTO.java
... | ... | @@ -0,0 +1,25 @@ |
1 | +package kr.co.takensoft.ai.system.project.dto; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | +import lombok.Setter; | |
6 | + | |
7 | +/** | |
8 | + * @author 박현정 | |
9 | + * @since 2025.07.14 | |
10 | + * @modification | |
11 | + * since | author | description | |
12 | + * 2025.07.14 | 박현정 | 최초 등록 | |
13 | + * | |
14 | + * 프로젝트 정보 수정 관련 DTO | |
15 | + */ | |
16 | +@Setter | |
17 | +@Getter | |
18 | +@NoArgsConstructor | |
19 | +public class UpdateProjectDTO { | |
20 | + | |
21 | + private String imageFileName; // 프로젝트 이미지 파일 이름 | |
22 | + private String imageFileUrl; // 프로젝트 이미지 파일 경로 | |
23 | + private String summary; // 프로젝트 주석 요약 | |
24 | + private String comment; // 프로젝트 주석 내용 | |
25 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/project/dto/UpdateProjectNameDTO.java
... | ... | @@ -0,0 +1,21 @@ |
1 | +package kr.co.takensoft.ai.system.project.dto; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | +import lombok.Setter; | |
6 | + | |
7 | +/** | |
8 | + * @author 박현정 | |
9 | + * @since 2025.07.14 | |
10 | + * @modification | |
11 | + * since | author | description | |
12 | + * 2025.07.14 | 박현정 | 최초 등록 | |
13 | + * | |
14 | + * 프로젝트 이름 변경 관련 DTO | |
15 | + */ | |
16 | +@Setter | |
17 | +@Getter | |
18 | +@NoArgsConstructor | |
19 | +public class UpdateProjectNameDTO { | |
20 | + private String projectName; | |
21 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/project/service/ProjectService.java
... | ... | @@ -0,0 +1,133 @@ |
1 | +package kr.co.takensoft.ai.system.project.service; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.project.dto.*; | |
4 | +import kr.co.takensoft.ai.system.project.vo.ProjectVO; | |
5 | +import org.springframework.transaction.annotation.Transactional; | |
6 | + | |
7 | +import java.util.HashMap; | |
8 | +import java.util.List; | |
9 | +import java.util.Map; | |
10 | + | |
11 | +/** | |
12 | + * @author 박현정 | |
13 | + * @since 2025.07.09 | |
14 | + * @modification | |
15 | + * since | author | description | |
16 | + * 2025.07.09 | 박현정 | 최초 등록 | |
17 | + * | |
18 | + * 프로젝트 관련 인터페이스 | |
19 | + */ | |
20 | +public interface ProjectService { | |
21 | + | |
22 | + /** | |
23 | + * @param memberId - 사용자 아이디 | |
24 | + * @param projectDTO - 생성할 프로젝트 정보 | |
25 | + * @return 등록 성공 여부 | |
26 | + * | |
27 | + * 프로젝트 등록 | |
28 | + */ | |
29 | + @Transactional | |
30 | + public int saveProject(String memberId, InsertProjectDTO projectDTO); | |
31 | + | |
32 | + /** | |
33 | + * @param memberId - 사용자 아이디 | |
34 | + * @return 프로젝트 이름 | |
35 | + * | |
36 | + * 프로젝트 이름 자동 생성 | |
37 | + */ | |
38 | + public String generateProjectNameForMember(String memberId); | |
39 | + | |
40 | + /** | |
41 | + * @param index - 숫자 | |
42 | + * @return 알파벳 | |
43 | + * | |
44 | + * 숫자를 알파벳으로 변경(0 -> 'A', 1 -> 'B', ... 25 -> 'Z', 26 -> 'AA', ...) | |
45 | + */ | |
46 | + public String numberToAlphabet(int index); | |
47 | + | |
48 | + /** | |
49 | + * @param memberId - 사용자 아이디 | |
50 | + * @return 프로젝트 리스트 | |
51 | + * | |
52 | + * 사용자가 참여한 프로젝트 목록 조회 | |
53 | + */ | |
54 | + public List<ProjectDTO> findProjectsByMemberId(String memberId); | |
55 | + | |
56 | + /** | |
57 | + * @param memberId - 사용자 아이디 | |
58 | + * @return 사용자가 생성한 프로젝트 개수 | |
59 | + * | |
60 | + * 사용자가 생성한 프로젝트 개수 조회 | |
61 | + */ | |
62 | + public int countCreatedByMember(String memberId); | |
63 | + | |
64 | + /** | |
65 | + * @param memberId - 사용자 아이디 | |
66 | + * @param projectId - 수정 프로젝트 아이디 | |
67 | + * @param projectDTO - 수정 프로젝트 정보를 담은 DTO 객체 | |
68 | + * @return 수정 성공 여부 | |
69 | + * | |
70 | + * 프로젝트 정보 수정 | |
71 | + */ | |
72 | + @Transactional | |
73 | + public int updateProject(String memberId, String projectId, UpdateProjectDTO projectDTO); | |
74 | + | |
75 | + /** | |
76 | + * @param memberId - 사용자 아이디 | |
77 | + * @param projectId - 복제할 프로젝트 아이디 | |
78 | + * @return 복제 성공 여부 | |
79 | + * | |
80 | + * 프로젝트 복제 | |
81 | + */ | |
82 | + @Transactional | |
83 | + public int duplicateProject(String memberId, String projectId); | |
84 | + | |
85 | + /** | |
86 | + * @param memberId - 사용자 아이디 | |
87 | + * @param projectId - 프로젝트 아이디 | |
88 | + * @param projectDTO - 이름 변경 정보를 담은 DTO 객체 | |
89 | + * @return 이름 변경 성공 여부 | |
90 | + * | |
91 | + * 프로젝트 이름 변경 | |
92 | + */ | |
93 | + @Transactional | |
94 | + public int renameProject(String memberId, String projectId, UpdateProjectNameDTO projectDTO); | |
95 | + | |
96 | + /** | |
97 | + * @param memberId - 사용자 아이디 | |
98 | + * @param projectId - 프로젝트 아이디 | |
99 | + * @return 프로젝트 삭제 성공 여부 | |
100 | + * | |
101 | + * 프로젝트 삭제 (use_at = 'N') | |
102 | + */ | |
103 | + @Transactional | |
104 | + public int deleteProject(String memberId, String projectId); | |
105 | + | |
106 | + /** | |
107 | + * @param memberId - 사용자 아이디 | |
108 | + * @param projectId - 복원할 프로젝트 아이디 | |
109 | + * @return 복원 성공 여부 | |
110 | + * | |
111 | + * 이전 프로젝트 복원 | |
112 | + */ | |
113 | + @Transactional | |
114 | + public int restoreProject(String memberId, String projectId); | |
115 | + | |
116 | + /** | |
117 | + * @param memberId - 사용자 아이디 | |
118 | + * @param projectId - 복원할 프로젝트 아이디 | |
119 | + * @return HashMap<String, Object> - 프로젝트 상세 정보를 담은 객체 | |
120 | + * | |
121 | + * 프로젝트 상세 조회 | |
122 | + */ | |
123 | + public HashMap<String, Object> findProject(String memberId, String projectId); | |
124 | + | |
125 | + /** | |
126 | + * @param memberId - 사용자 아이디 | |
127 | + * @param searchReqDTO - 프로젝트 목록 검색 조건 | |
128 | + * @return HashMap<String, Object> - 프로젝트 목록 정보를 담은 객체 | |
129 | + * | |
130 | + * 프로젝트 목록 조회 | |
131 | + */ | |
132 | + public HashMap<String, Object> findAllProjects(String memberId, ProjectSearchReqDTO searchReqDTO); | |
133 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/project/service/impl/ProjectServiceImpl.java
... | ... | @@ -0,0 +1,325 @@ |
1 | +package kr.co.takensoft.ai.system.project.service.impl; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.common.idgen.service.IdgenService; | |
4 | +import kr.co.takensoft.ai.system.project.dao.ProjectDAO; | |
5 | +import kr.co.takensoft.ai.system.project.dto.*; | |
6 | +import kr.co.takensoft.ai.system.project.service.ProjectService; | |
7 | +import kr.co.takensoft.ai.system.project.vo.ProjectVO; | |
8 | +import kr.co.takensoft.ai.system.projectComment.dto.ProjectCommentDTO; | |
9 | +import kr.co.takensoft.ai.system.projectComment.service.ProjectCommentService; | |
10 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
11 | +import kr.co.takensoft.ai.system.projectGroup.service.ProjectGroupService; | |
12 | +import kr.co.takensoft.ai.system.projectImage.dto.ProjectImageDTO; | |
13 | +import kr.co.takensoft.ai.system.projectImage.service.ProjectImageService; | |
14 | +import kr.co.takensoft.ai.system.projectImage.vo.ProjectImageVO; | |
15 | +import kr.co.takensoft.ai.system.projectMember.dto.ProjectMemberDTO; | |
16 | +import kr.co.takensoft.ai.system.projectMember.service.ProjectMemberService; | |
17 | +import kr.co.takensoft.ai.system.projectMember.vo.ProjectMemberVO; | |
18 | +import lombok.RequiredArgsConstructor; | |
19 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
20 | +import org.springframework.stereotype.Service; | |
21 | +import org.springframework.transaction.annotation.Transactional; | |
22 | + | |
23 | +import java.util.HashMap; | |
24 | +import java.util.List; | |
25 | +import java.util.stream.Collectors; | |
26 | + | |
27 | +/** | |
28 | + * @author : 박현정 | |
29 | + * @since : 2025.07.09 | |
30 | + * @modification | |
31 | + * since | author | description | |
32 | + * 2025.07.09 | 박현정 | 최초 등록 | |
33 | + * | |
34 | + * 프로젝트 관련 서비스 | |
35 | + */ | |
36 | +@Service("projectService") | |
37 | +@RequiredArgsConstructor | |
38 | +public class ProjectServiceImpl extends EgovAbstractServiceImpl implements ProjectService { | |
39 | + | |
40 | + private final ProjectDAO projectDAO; | |
41 | + private final IdgenService projectIdgn; | |
42 | + private final ProjectGroupService projectGroupService; | |
43 | + private final ProjectMemberService projectMemberService; | |
44 | + private final ProjectImageService projectImageService; | |
45 | + private final ProjectCommentService projectCommentService; | |
46 | + //private final ProjectLogService projectLogService; | |
47 | + | |
48 | + /** | |
49 | + * @param memberId - 사용자 아이디 | |
50 | + * @param projectDTO - 생성할 프로젝트 정보 | |
51 | + * @return 등록 성공 여부 | |
52 | + * | |
53 | + * 프로젝트 등록 | |
54 | + */ | |
55 | + @Override | |
56 | + public int saveProject(String memberId, InsertProjectDTO projectDTO) { | |
57 | + | |
58 | + try { | |
59 | + String projectId = projectIdgn.getNextStringId(); // 프로젝트 구분 아이디 생성 | |
60 | + String projectGroupId = projectGroupService.saveProjectGroup(); // 프로젝트 그룹 객체 아이디 가져오기 | |
61 | + String isOwner = "Y"; // 프로젝트 대표자 여부 'Y' | |
62 | + projectMemberService.saveProjectMember(projectGroupId, memberId, isOwner); // 프로젝트 참여자 객체 생성 | |
63 | + projectImageService.saveProjectImage(projectId, projectDTO.getImageFileName(), projectDTO.getImageFileUrl()); // 프로젝트 이미지 객체 생성 | |
64 | + projectCommentService.saveProjectComment(memberId, projectId, projectDTO.getSummary(), projectDTO.getComment()); // 프로젝트 주석 객체 생성 | |
65 | + String projectName = generateProjectNameForMember(memberId); // 프로젝트 이름 생성 | |
66 | + ProjectVO projectVO = new ProjectVO(projectId, projectGroupId, projectName); // 프로젝트 정보 등록 | |
67 | + return projectDAO.saveProject(projectVO); | |
68 | + } catch (Exception e) { | |
69 | + e.printStackTrace(); | |
70 | + return -1; | |
71 | + } | |
72 | + } | |
73 | + | |
74 | + /** | |
75 | + * @param memberId - 사용자 아이디 | |
76 | + * @return 프로젝트 이름 | |
77 | + * | |
78 | + * 프로젝트 이름 자동 생성 | |
79 | + */ | |
80 | + @Override | |
81 | + public String generateProjectNameForMember(String memberId) { | |
82 | + | |
83 | + int memberProjectCount = countCreatedByMember(memberId); // 사용자가 생성한 프로젝트 개수 | |
84 | + return "프로젝트 " + numberToAlphabet(memberProjectCount); | |
85 | + } | |
86 | + | |
87 | + /** | |
88 | + * @param index - 숫자 | |
89 | + * @return 알파벳 | |
90 | + * | |
91 | + * 숫자를 알파벳으로 변경(0 -> 'A', 1 -> 'B', ... 25 -> 'Z', 26 -> 'AA', ...) | |
92 | + */ | |
93 | + @Override | |
94 | + public String numberToAlphabet(int index) { | |
95 | + | |
96 | + StringBuilder sb = new StringBuilder(); | |
97 | + index ++; | |
98 | + | |
99 | + while(index > 0) { | |
100 | + index --; | |
101 | + char ch = (char) ('A'+(index % 26)); | |
102 | + sb.insert(0, ch); | |
103 | + index /= 26; | |
104 | + } | |
105 | + | |
106 | + return sb.toString(); | |
107 | + } | |
108 | + | |
109 | + /** | |
110 | + * @param memberId - 사용자 아이디 | |
111 | + * @return 프로젝트 리스트 | |
112 | + * | |
113 | + * 사용자가 참여한 프로젝트 목록 조회 | |
114 | + */ | |
115 | + @Override | |
116 | + public List<ProjectDTO> findProjectsByMemberId(String memberId) { | |
117 | + return projectDAO.findProjectsByMemberId(memberId); | |
118 | + } | |
119 | + | |
120 | + /** | |
121 | + * @param memberId - 사용자 아이디 | |
122 | + * @return 사용자가 생성한 프로젝트 개수 | |
123 | + * | |
124 | + * 사용자가 생성한 프로젝트 개수 조회 | |
125 | + */ | |
126 | + @Override | |
127 | + public int countCreatedByMember(String memberId) { | |
128 | + return projectDAO.countCreatedByMemberId(memberId); | |
129 | + } | |
130 | + | |
131 | + /** | |
132 | + * @param memberId - 사용자 아이디 | |
133 | + * @param projectId - 수정 프로젝트 아이디 | |
134 | + * @param projectDTO - 수정 프로젝트 정보를 담은 DTO 객체 | |
135 | + * @return 수정 성공 여부 | |
136 | + * | |
137 | + * 프로젝트 정보 수정 | |
138 | + */ | |
139 | + @Override | |
140 | + @Transactional | |
141 | + public int updateProject(String memberId, String projectId, UpdateProjectDTO projectDTO) { | |
142 | + try { | |
143 | + ProjectVO projectVO = projectDAO.findById(projectId) | |
144 | + .orElseThrow(() -> new IllegalArgumentException("프로젝트가 존재하지 않습니다.")); // 기존 프로젝트 가져오기 | |
145 | + if(!projectVO.getIsMain().equals("Y")) { // 기존 프로젝트 대표 여부 확인하기 | |
146 | + throw new IllegalStateException("대표 프로젝트가 아닙니다."); | |
147 | + } | |
148 | + String projectGroupId = projectVO.getProjectGroupId(); // 기존 프로젝트 그룹 아이디 가져오기 | |
149 | + projectMemberService.validateProjectMember(projectGroupId, memberId); // 프로젝트 참여자 존재 여부 검증 | |
150 | + projectDAO.unsetProjectMain(projectVO.getProjectGroupId()); // 기존 프로젝트를 대표 프로젝트 해제 | |
151 | + | |
152 | + String updateProjectId = projectIdgn.getNextStringId(); // 프로젝트 구분 아이디 생성 | |
153 | + projectImageService.saveProjectImage(updateProjectId, projectDTO.getImageFileName(), projectDTO.getImageFileUrl()); // 프로젝트 이미지 객체 생성 | |
154 | + projectCommentService.saveProjectComment(memberId, updateProjectId, projectDTO.getSummary(), projectDTO.getComment()); // 프로젝트 주석 객체 생성 | |
155 | + String projectName = projectVO.getProjectName(); // 기존 프로젝트 이름 가져오기 | |
156 | + ProjectVO updateProjectVO = new ProjectVO(updateProjectId, projectGroupId, projectName); // 프로젝트 정보 등록(새로운 버전) | |
157 | + return projectDAO.saveProject(updateProjectVO); | |
158 | + } catch (Exception e) { | |
159 | + e.printStackTrace(); | |
160 | + return -1; | |
161 | + } | |
162 | + } | |
163 | + | |
164 | + /** | |
165 | + * @param memberId - 사용자 아이디 | |
166 | + * @param currentProjectId - 복제할 프로젝트 아이디 | |
167 | + * @return 복제 성공 여부 | |
168 | + * | |
169 | + * 프로젝트 복제 | |
170 | + */ | |
171 | + @Override | |
172 | + @Transactional | |
173 | + public int duplicateProject(String memberId, String currentProjectId) { | |
174 | + try { | |
175 | + ProjectVO currentProjectVO = projectDAO.findById(currentProjectId) | |
176 | + .orElseThrow(() -> new IllegalArgumentException("프로젝트가 존재하지 않습니다.")); // 기존 프로젝트 가져오기 | |
177 | + String currentProjectGroupId = currentProjectVO.getProjectGroupId(); // 기존 프로젝트 그룹 아이디 가져오기 | |
178 | + projectMemberService.validateProjectMember(currentProjectGroupId, memberId); // 기존 프로젝트 참여자 존재 여부 검증 | |
179 | + | |
180 | + String projectId = projectIdgn.getNextStringId(); // 복제 프로젝트 구분 아이디 생성 | |
181 | + String projectGroupId = projectGroupService.saveProjectGroup(); // 복제 프로젝트 그룹 객체 아이디 가져오기 | |
182 | + String isOwner = "Y"; // 프로젝트 대표자 여부 'Y' | |
183 | + projectMemberService.saveProjectMember(projectGroupId, memberId, isOwner); // 복제 프로젝트 참여자 객체 생성 | |
184 | + ProjectImageVO imageVO = projectImageService.findImage(currentProjectVO.getImageId()); // 기존 프로젝트 이미지 가져오기 | |
185 | + ProjectCommentVO commentVO = projectCommentService.findComment(currentProjectVO.getCommentId()); // 기존 프로젝트 주석 가져오기 | |
186 | + projectImageService.saveProjectImage(projectId, imageVO.getFileName(), imageVO.getFileUrl()); // 복제 프로젝트 이미지 객체 생성(기존 프로젝트 이미지 복사) | |
187 | + projectCommentService.saveProjectComment(memberId, projectId, commentVO.getSummary(), commentVO.getComment()); // 복제 프로젝트 주석 객체 생성(기존 프로젝트 주석 복사) | |
188 | + String projectName = ""; | |
189 | + if(currentProjectVO.getIsMain().equals("Y")){ // 대표 프로젝트를 복제하는 경우 이름 생성 | |
190 | + projectName = "[복사본] " + currentProjectVO.getProjectName(); | |
191 | + } else if(currentProjectVO.getIsMain().equals("N")) { // 프로젝트 이전 버전의 사본을 생성하는 경우 이름 생성 | |
192 | + projectName = "[사본] " + currentProjectVO.getProjectName(); | |
193 | + } | |
194 | + | |
195 | + ProjectVO projectVO = new ProjectVO(projectId, projectGroupId, projectName); // 복제 프로젝트 정보 등록 | |
196 | + return projectDAO.saveProject(projectVO); | |
197 | + } catch (Exception e) { | |
198 | + e.printStackTrace(); | |
199 | + return -1; | |
200 | + } | |
201 | + } | |
202 | + | |
203 | + /** | |
204 | + * @param memberId - 사용자 아이디 | |
205 | + * @param projectId - 프로젝트 아이디 | |
206 | + * @param projectDTO - 이름 변경 정보를 담은 DTO 객체 | |
207 | + * @return 이름 변경 성공 여부 | |
208 | + * | |
209 | + * 프로젝트 이름 변경 | |
210 | + */ | |
211 | + @Override | |
212 | + @Transactional | |
213 | + public int renameProject(String memberId, String projectId, UpdateProjectNameDTO projectDTO) { | |
214 | + try { | |
215 | + ProjectVO projectVO = projectDAO.findById(projectId) | |
216 | + .orElseThrow(() -> new IllegalArgumentException("프로젝트가 존재하지 않습니다.")); // 프로젝트 가져오기 | |
217 | + String projectGroupId = projectVO.getProjectGroupId(); // 프로젝트 그룹 아이디 가져오기 | |
218 | + projectMemberService.validateProjectMember(projectGroupId, memberId); // 프로젝트 참여자 존재 여부 검증 | |
219 | + return projectDAO.updateProjectName(projectId, projectDTO.getProjectName()); // 프로젝트 이름 변경 | |
220 | + } catch (Exception e) { | |
221 | + e.printStackTrace(); | |
222 | + return -1; | |
223 | + } | |
224 | + } | |
225 | + | |
226 | + /** | |
227 | + * @param memberId - 사용자 아이디 | |
228 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
229 | + * @return 프로젝트 삭제 성공 여부 | |
230 | + * | |
231 | + * 프로젝트 삭제 (use_at = 'N') | |
232 | + */ | |
233 | + @Override | |
234 | + @Transactional | |
235 | + public int deleteProject(String memberId, String projectGroupId) { | |
236 | + try { | |
237 | + projectGroupService.validateExistence(projectGroupId); // 프로젝트 그룹 존재 여부 검증 | |
238 | + projectMemberService.validateProjectMember(projectGroupId, memberId); // 프로젝트 참여자 존재 여부 검증 | |
239 | + projectGroupService.deleteProjectGroup(projectGroupId); // 프로젝트 그룹 삭제(use_at = 'N') | |
240 | + return projectDAO.deactivateProjectsByGroupId(projectGroupId); // 프로젝트 삭제(use_at = 'N') | |
241 | + } catch (Exception e) { | |
242 | + e.printStackTrace(); | |
243 | + return -1; | |
244 | + } | |
245 | + } | |
246 | + | |
247 | + /** | |
248 | + * @param memberId - 사용자 아이디 | |
249 | + * @param projectId - 복원할 프로젝트 아이디 | |
250 | + * @return 복원 성공 여부 | |
251 | + * | |
252 | + * 이전 프로젝트 복원 | |
253 | + */ | |
254 | + @Override | |
255 | + @Transactional | |
256 | + public int restoreProject(String memberId, String projectId) { | |
257 | + try { | |
258 | + ProjectVO projectVO = projectDAO.findById(projectId) | |
259 | + .orElseThrow(() -> new IllegalArgumentException("프로젝트가 존재하지 않습니다.")); // 프로젝트 가져오기 | |
260 | + String projectGroupId = projectVO.getProjectGroupId(); // 프로젝트 그룹 아이디 가져오기 | |
261 | + projectMemberService.validateProjectMember(projectGroupId, memberId); // 프로젝트 참여자 존재 여부 검증 | |
262 | + projectDAO.unsetProjectMain(projectGroupId); // 현재 프로젝트 대표 프로젝트 해제 | |
263 | + projectDAO.setProjectMain(projectId); // 복원할 프로젝트를 대표 프로젝트로 설정 | |
264 | + return projectDAO.deactivateProjectsCreatedAfter(projectGroupId, projectId); // 복원할 프로젝트 이후에 생성된 프로젝트 삭제 | |
265 | + } catch (Exception e) { | |
266 | + e.printStackTrace(); | |
267 | + return -1; | |
268 | + } | |
269 | + } | |
270 | + | |
271 | + /** | |
272 | + * @param memberId - 사용자 아이디 | |
273 | + * @param projectId - 복원할 프로젝트 아이디 | |
274 | + * @return HashMap<String, Object> - 프로젝트 상세 정보를 담은 객체 | |
275 | + * | |
276 | + * 프로젝트 상세 조회 | |
277 | + */ | |
278 | + @Override | |
279 | + public HashMap<String, Object> findProject(String memberId, String projectId) { | |
280 | + try { | |
281 | + HashMap<String, Object> result = new HashMap<>(); | |
282 | + ProjectVO projectVO = projectDAO.findById(projectId) | |
283 | + .orElseThrow(() -> new IllegalArgumentException("프로젝트가 존재하지 않습니다.")); // 프로젝트 가져오기 | |
284 | + String projectGroupId = projectVO.getProjectGroupId(); // 프로젝트 그룹 아이디 가져오기 | |
285 | + projectMemberService.validateProjectMember(projectGroupId, memberId); // 프로젝트 참여자 존재 여부 검증 | |
286 | + List<ProjectMemberVO> projectMemberVOS = projectMemberService.findProjectMembers(projectGroupId); // 프로젝트 참여자 목록 가져오기 | |
287 | + ProjectImageVO imageVO = projectImageService.findImage(projectVO.getImageId()); // 프로젝트 이미지 가져오기 | |
288 | + ProjectCommentVO commentVO = projectCommentService.findComment(projectVO.getCommentId()); // 프로젝트 주석 가져오기 | |
289 | + List<ProjectMemberDTO> projectMemberDTOS = projectMemberVOS.stream() | |
290 | + .map(ProjectMemberDTO::from).collect(Collectors.toList()); // 프로젝트 참여자 목록 dto 객체에 담기 | |
291 | + result.put("project", ProjectDTO.from(projectVO)); | |
292 | + result.put("projectMember", projectMemberDTOS); | |
293 | + result.put("projectComment", ProjectCommentDTO.from(commentVO)); | |
294 | + result.put("projectImage", ProjectImageDTO.from(imageVO)); | |
295 | + return result; // 프로젝트 상세 조회 결과 응답 | |
296 | + } catch (Exception e) { | |
297 | + e.printStackTrace(); | |
298 | + throw e; | |
299 | + } | |
300 | + } | |
301 | + | |
302 | + /** | |
303 | + * @param memberId - 사용자 아이디 | |
304 | + * @param searchReqDTO - 프로젝트 목록 검색 조건 | |
305 | + * @return HashMap<String, Object> - 프로젝트 목록 정보를 담은 객체 | |
306 | + * | |
307 | + * 프로젝트 목록 조회 | |
308 | + */ | |
309 | + @Override | |
310 | + public HashMap<String, Object> findAllProjects(String memberId, ProjectSearchReqDTO searchReqDTO) { | |
311 | + | |
312 | + try { | |
313 | + HashMap<String, Object> result = new HashMap<>(); | |
314 | + searchReqDTO.setMemberId(memberId); // 검색 조건에 사용자 아이디 추가 | |
315 | + List<ProjectDTO> projectDTOS = projectDAO.findAllProjects(searchReqDTO) | |
316 | + .stream().map(ProjectDTO::from).collect(Collectors.toList()); // 프로젝트 목록 조회 | |
317 | + result.put("projects", projectDTOS); // 프로젝트 목록을 결과에 담기 | |
318 | + return result; | |
319 | + } | |
320 | + catch (Exception e) { | |
321 | + e.printStackTrace(); | |
322 | + throw e; | |
323 | + } | |
324 | + } | |
325 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/project/vo/ProjectVO.java
... | ... | @@ -0,0 +1,43 @@ |
1 | +package kr.co.takensoft.ai.system.project.vo; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.project.dto.UpdateProjectDTO; | |
4 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
5 | +import kr.co.takensoft.ai.system.projectImage.vo.ProjectImageVO; | |
6 | +import kr.co.takensoft.ai.system.projectMember.vo.ProjectMemberVO; | |
7 | +import lombok.Getter; | |
8 | +import lombok.NoArgsConstructor; | |
9 | + | |
10 | +import java.util.List; | |
11 | + | |
12 | +/** | |
13 | + * @author 박현정 | |
14 | + * @since 2025.07.09 | |
15 | + * @modification | |
16 | + * since | author | description | |
17 | + * 2025.07.09 | 박현정 | 최초 등록 | |
18 | + * | |
19 | + * | |
20 | + * 프로젝트 관련 VO | |
21 | + */ | |
22 | +@Getter | |
23 | +@NoArgsConstructor | |
24 | +public class ProjectVO { | |
25 | + private String projectId; // 프로젝트 아이디 | |
26 | + private String projectGroupId; // 프로젝트 그룹 아이디 | |
27 | + private String projectName; // 프로젝트 이름 | |
28 | + private String isMain; // 대표 프로젝트 여부 ( N: 대표 아님, Y: 대표) | |
29 | + private String useAt; // 프로젝트 사용 여부 (N : 사용 안함, Y : 사용) | |
30 | + private String imageId; // 프로젝트 이미지 아이디 | |
31 | + private String commentId; // 프로젝트 주석 아이디 | |
32 | + private String createdAt; // 생성일자 | |
33 | + private String updatedAt; // 수정일자 | |
34 | + | |
35 | + // 프로젝트 생성용 생성자 | |
36 | + public ProjectVO(String projectId, String projectGroupId, String projectName) { | |
37 | + this.projectId = projectId; | |
38 | + this.projectGroupId = projectGroupId; | |
39 | + this.projectName = projectName; | |
40 | + this.isMain = "Y"; | |
41 | + this.useAt = "Y"; | |
42 | + } | |
43 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/project/web/ProjectController.java
... | ... | @@ -0,0 +1,157 @@ |
1 | +package kr.co.takensoft.ai.system.project.web; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.auth.vo.MemberVO; | |
4 | +import kr.co.takensoft.ai.system.project.dto.InsertProjectDTO; | |
5 | +import kr.co.takensoft.ai.system.project.dto.ProjectSearchReqDTO; | |
6 | +import kr.co.takensoft.ai.system.project.dto.UpdateProjectDTO; | |
7 | +import kr.co.takensoft.ai.system.project.dto.UpdateProjectNameDTO; | |
8 | +import kr.co.takensoft.ai.system.project.service.ProjectService; | |
9 | +import lombok.RequiredArgsConstructor; | |
10 | +import org.springframework.http.HttpStatus; | |
11 | +import org.springframework.http.ResponseEntity; | |
12 | +import org.springframework.web.bind.annotation.*; | |
13 | + | |
14 | +import java.util.HashMap; | |
15 | + | |
16 | +/* | |
17 | + * @author : 박현정 | |
18 | + * @since : 2025.07.09 | |
19 | + * @modification | |
20 | + * since | author | description | |
21 | + * 2025.07.09 | 박현정 | 최초 등록 | |
22 | + * | |
23 | + * 사용자 정보 관련 서비스 | |
24 | + */ | |
25 | +@RestController | |
26 | +@RequiredArgsConstructor | |
27 | +@RequestMapping(value = "/api/project") | |
28 | +public class ProjectController { | |
29 | + | |
30 | + private final ProjectService projectService; | |
31 | + private final String MEMBER_ID = "test"; | |
32 | + | |
33 | + /** | |
34 | + * @param insertProjectDTO - 생성할 프로젝트 정보 | |
35 | + * @return ResponseEntity - 프로젝트 등록 결과를 포함하는 응답 | |
36 | + * | |
37 | + * 프로젝트 등록 | |
38 | + */ | |
39 | + @PostMapping("/saveProject.json") | |
40 | + public ResponseEntity<?> saveProject(@RequestBody InsertProjectDTO insertProjectDTO) { | |
41 | + HashMap<String, Object> result = new HashMap<>(); | |
42 | + String memberId = MEMBER_ID; | |
43 | + result.put("result", projectService.saveProject(memberId, insertProjectDTO)); | |
44 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
45 | + } | |
46 | + | |
47 | + /** | |
48 | + * @return ResponseEntity - 사용자가 참여한 프로젝트 목록을 포함하는 응답 | |
49 | + * | |
50 | + * 사용자가 참여한 프로젝트 목록 조회 | |
51 | + */ | |
52 | + @PostMapping("/findAllByMemberId.json") | |
53 | + public ResponseEntity<?> findAllByMemberId() { | |
54 | + HashMap<String, Object> result = new HashMap<>(); | |
55 | + String memberId = MEMBER_ID; | |
56 | + result.put("result", projectService.findProjectsByMemberId(memberId)); | |
57 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * @param projectId - 수정 프로젝트 아이디 | |
62 | + * @param updateProjectDTO - 수정 프로젝트 정보 | |
63 | + * @return ResponseEntity - 프로젝트 정보 수정 처리 결과를 포함하는 응답 | |
64 | + * | |
65 | + * 프로젝트 정보 수정 | |
66 | + */ | |
67 | + @PostMapping("/{projectId}/updateProject.json") | |
68 | + public ResponseEntity<?> updateCategory(@PathVariable String projectId, @RequestBody UpdateProjectDTO updateProjectDTO) { | |
69 | + HashMap<String, Object> result = new HashMap<>(); | |
70 | + String memberId = MEMBER_ID; | |
71 | + result.put("result", projectService.updateProject(memberId, projectId, updateProjectDTO)); | |
72 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
73 | + } | |
74 | + | |
75 | + /** | |
76 | + * @param projectId - 복제할 프로젝트 아이디 | |
77 | + * @return ResponseEntity - 프로젝트 복제 결과를 포함하는 응답 | |
78 | + * | |
79 | + * 프로젝트 복제 | |
80 | + */ | |
81 | + @PostMapping("/{projectId}/duplicateProject.json") | |
82 | + public ResponseEntity<?> duplicateProject(@PathVariable String projectId) { | |
83 | + HashMap<String, Object> result = new HashMap<>(); | |
84 | + String memberId = MEMBER_ID; | |
85 | + result.put("result", projectService.duplicateProject(memberId, projectId)); | |
86 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
87 | + } | |
88 | + | |
89 | + /** | |
90 | + * @param projectId - 이름 변경할 프로젝트 아이디 | |
91 | + * @return ResponseEntity - 프로젝트 이름 수정 결과를 포함하는 응답 | |
92 | + * | |
93 | + * 프로젝트 이름 변경 | |
94 | + */ | |
95 | + @PostMapping("/{projectId}/renameProject.json") | |
96 | + public ResponseEntity<?> renameProject(@PathVariable String projectId, @RequestBody UpdateProjectNameDTO updateProjectNameDTO) { | |
97 | + HashMap<String, Object> result = new HashMap<>(); | |
98 | + String memberId = MEMBER_ID; | |
99 | + result.put("result", projectService.renameProject(memberId, projectId, updateProjectNameDTO)); | |
100 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
101 | + } | |
102 | + | |
103 | + /** | |
104 | + * @param projectGroupId - 삭제할 프로젝트 그룹 아이디 | |
105 | + * @return ResponseEntity - 프로젝트 삭제 결과를 포함하는 응답 | |
106 | + * | |
107 | + * 프로젝트 삭제 (use_at = 'N') | |
108 | + */ | |
109 | + @PostMapping("/{projectGroupId}/deleteProject.json") | |
110 | + public ResponseEntity<?> deleteProject(@PathVariable String projectGroupId) { | |
111 | + HashMap<String, Object> result = new HashMap<>(); | |
112 | + String memberId = MEMBER_ID; | |
113 | + result.put("result", projectService.deleteProject(memberId, projectGroupId)); | |
114 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
115 | + } | |
116 | + | |
117 | + /** | |
118 | + * @param projectId - 복원할 프로젝트 아이디 | |
119 | + * @return ResponseEntity - 프로젝트 복원 결과를 포함하는 응답 | |
120 | + * | |
121 | + * 프로젝트 이전 버전 복원 | |
122 | + */ | |
123 | + @PostMapping("/{projectId}/restoreProject.json") | |
124 | + public ResponseEntity<?> restoreProject(@PathVariable String projectId) { | |
125 | + HashMap<String, Object> result = new HashMap<>(); | |
126 | + String memberId = MEMBER_ID; | |
127 | + result.put("result", projectService.restoreProject(memberId, projectId)); | |
128 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
129 | + } | |
130 | + | |
131 | + /** | |
132 | + * @param projectId - 프로젝트 아이디 | |
133 | + * @return ResponseEntity - 프로젝트 상세 조회 정보를 포함하는 응답 | |
134 | + * | |
135 | + * 프로젝트 상세 조회 | |
136 | + */ | |
137 | + @PostMapping("/{projectId}/findProject.json") | |
138 | + public ResponseEntity<?> findProject(@PathVariable String projectId) { | |
139 | + HashMap<String, Object> result = new HashMap<>(); | |
140 | + String memberId = MEMBER_ID; | |
141 | + result.put("result", projectService.findProject(memberId, projectId)); | |
142 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
143 | + } | |
144 | + | |
145 | + /** | |
146 | + * @return ResponseEntity - 프로젝트 목록 정보를 포함하는 응답 | |
147 | + * | |
148 | + * 프로젝트 목록 조회 | |
149 | + */ | |
150 | + @PostMapping("/findAllProjects.json") | |
151 | + public ResponseEntity<?> findAllProjects(@RequestBody ProjectSearchReqDTO projectSearchReqDTO) { | |
152 | + HashMap<String, Object> result = new HashMap<>(); | |
153 | + String memberId = MEMBER_ID; | |
154 | + result.put("result", projectService.findAllProjects(memberId, projectSearchReqDTO)); | |
155 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
156 | + } | |
157 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectComment/dao/ProjectCommentDAO.java
... | ... | @@ -0,0 +1,35 @@ |
1 | +package kr.co.takensoft.ai.system.projectComment.dao; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.feedback.vo.FeedbackVO; | |
4 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
5 | +import kr.co.takensoft.ai.system.projectImage.vo.ProjectImageVO; | |
6 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
7 | + | |
8 | +/** | |
9 | + * @author 박현정 | |
10 | + * @since 2025.07.10 | |
11 | + * @modification | |
12 | + * since | author | description | |
13 | + * 2025.07.10 | 박현정 | 최초 등록 | |
14 | + * | |
15 | + * 프로젝트 주석 관련 DAO | |
16 | + */ | |
17 | +@Mapper("projectCommentDAO") | |
18 | +public interface ProjectCommentDAO { | |
19 | + | |
20 | + /** | |
21 | + * @param projectCommentVO - 프로젝트 주석 정보 | |
22 | + * @return int - 프로젝트 주석 등록 결과 | |
23 | + * | |
24 | + * 프로젝트 주석 등록 | |
25 | + */ | |
26 | + int saveProjectComment(ProjectCommentVO projectCommentVO); | |
27 | + | |
28 | + /** | |
29 | + * @param commentId - 프로젝트 주석 아이디 | |
30 | + * @return ProjectCommentVO - 프로젝트 주석 정보 | |
31 | + * | |
32 | + * 프로젝트 주석 정보 조회 | |
33 | + */ | |
34 | + ProjectCommentVO findById(String commentId); | |
35 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectComment/dto/ProjectCommentDTO.java
... | ... | @@ -0,0 +1,43 @@ |
1 | +package kr.co.takensoft.ai.system.projectComment.dto; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
4 | +import lombok.AllArgsConstructor; | |
5 | +import lombok.Getter; | |
6 | +import lombok.NoArgsConstructor; | |
7 | +import lombok.Setter; | |
8 | + | |
9 | +/** | |
10 | + * @author 박현정 | |
11 | + * @since 2025.07.15 | |
12 | + * @modification | |
13 | + * since | author | description | |
14 | + * 2025.07.15 | 박현정 | 최초 등록 | |
15 | + * | |
16 | + * 프로젝트 주석 조회 관련 DTO | |
17 | + */ | |
18 | +@Setter | |
19 | +@Getter | |
20 | +@NoArgsConstructor | |
21 | +@AllArgsConstructor | |
22 | +public class ProjectCommentDTO { | |
23 | + | |
24 | + private String projectCommentId; // 프로젝트 주석 아이디 | |
25 | + private String memberId; // 주석 작성자 아이디 | |
26 | + private String memberName; // 주석 작성자 이름 | |
27 | + private String summary; // 주석 요약 | |
28 | + private String comment; // 주석 내용 | |
29 | + private String createdAt; // 생성일자 | |
30 | + private String updatedAt; // 수정일자 | |
31 | + | |
32 | + public static ProjectCommentDTO from(ProjectCommentVO commentVO) { | |
33 | + return new ProjectCommentDTO( | |
34 | + commentVO.getProjectCommentId(), | |
35 | + commentVO.getMemberId(), | |
36 | + commentVO.getMemberName(), | |
37 | + commentVO.getSummary(), | |
38 | + commentVO.getComment(), | |
39 | + commentVO.getCreatedAt(), | |
40 | + commentVO.getUpdatedAt() | |
41 | + ); | |
42 | + } | |
43 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectComment/service/ProjectCommentService.java
... | ... | @@ -0,0 +1,38 @@ |
1 | +package kr.co.takensoft.ai.system.projectComment.service; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.project.dto.InsertProjectDTO; | |
4 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
5 | +import kr.co.takensoft.ai.system.projectImage.vo.ProjectImageVO; | |
6 | +import org.springframework.transaction.annotation.Transactional; | |
7 | + | |
8 | +/** | |
9 | + * @author 박현정 | |
10 | + * @since 2025.07.14 | |
11 | + * @modification | |
12 | + * since | author | description | |
13 | + * 2025.07.14 | 박현정 | 최초 등록 | |
14 | + * | |
15 | + * 프로젝트 주석 관련 인터페이스 | |
16 | + */ | |
17 | +public interface ProjectCommentService { | |
18 | + | |
19 | + /** | |
20 | + * @param memberId - 사용자 아이디 | |
21 | + * @param projectId - 프로젝트 아이디 | |
22 | + * @param summary - 주석 요약 | |
23 | + * @param comment - 주석 내용 | |
24 | + * @return 등록 성공 여부 | |
25 | + * | |
26 | + * 프로젝트 주석 등록 | |
27 | + */ | |
28 | + @Transactional | |
29 | + public int saveProjectComment(String memberId, String projectId, String summary, String comment); | |
30 | + | |
31 | + /** | |
32 | + * @param commentId - 프로젝트 주석 아이디 | |
33 | + * @return ProjectCommentVO - 프로젝트 주석 정보 | |
34 | + * | |
35 | + * 프로젝트 주석 정보 조회 | |
36 | + */ | |
37 | + public ProjectCommentVO findComment(String commentId); | |
38 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectComment/service/impl/ProjectCommentServiceImpl.java
... | ... | @@ -0,0 +1,54 @@ |
1 | +package kr.co.takensoft.ai.system.projectComment.service.impl; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.common.idgen.service.IdgenService; | |
4 | +import kr.co.takensoft.ai.system.projectComment.dao.ProjectCommentDAO; | |
5 | +import kr.co.takensoft.ai.system.projectComment.service.ProjectCommentService; | |
6 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
7 | +import lombok.RequiredArgsConstructor; | |
8 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
9 | +import org.springframework.stereotype.Service; | |
10 | + | |
11 | +/** | |
12 | + * @author : 박현정 | |
13 | + * @since : 2025.07.14 | |
14 | + * @modification | |
15 | + * since | author | description | |
16 | + * 2025.07.14 | 박현정 | 최초 등록 | |
17 | + * | |
18 | + * 프로젝트 주석 관련 서비스 | |
19 | + */ | |
20 | +@Service("projectCommentService") | |
21 | +@RequiredArgsConstructor | |
22 | +public class ProjectCommentServiceImpl extends EgovAbstractServiceImpl implements ProjectCommentService { | |
23 | + | |
24 | + private final ProjectCommentDAO projectCommentDAO; | |
25 | + private final IdgenService projectCommentIdgn; | |
26 | + | |
27 | + /** | |
28 | + * @param memberId - 사용자 아이디 | |
29 | + * @param projectId - 프로젝트 아이디 | |
30 | + * @param summary - 주석 요약 | |
31 | + * @param comment - 주석 내용 | |
32 | + * @return 등록 성공 여부 | |
33 | + * | |
34 | + * 프로젝트 주석 등록 | |
35 | + */ | |
36 | + @Override | |
37 | + public int saveProjectComment(String memberId, String projectId, String summary, String comment) { | |
38 | + | |
39 | + String projectCommentId = projectCommentIdgn.getNextStringId(); // 프로젝트 주석 구분 아이디 생성 | |
40 | + ProjectCommentVO projectCommentVO = new ProjectCommentVO(projectCommentId, projectId, memberId, summary, comment); // 주석 정보 등록 | |
41 | + return projectCommentDAO.saveProjectComment(projectCommentVO); | |
42 | + } | |
43 | + | |
44 | + /** | |
45 | + * @param commentId - 프로젝트 주석 아이디 | |
46 | + * @return ProjectCommentVO - 프로젝트 주석 정보 | |
47 | + * | |
48 | + * 프로젝트 주석 정보 조회 | |
49 | + */ | |
50 | + @Override | |
51 | + public ProjectCommentVO findComment(String commentId) { | |
52 | + return projectCommentDAO.findById(commentId); | |
53 | + } | |
54 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectComment/vo/ProjectCommentVO.java
... | ... | @@ -0,0 +1,38 @@ |
1 | +package kr.co.takensoft.ai.system.projectComment.vo; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | + | |
6 | +/** | |
7 | + * @author 박현정 | |
8 | + * @since 2025.07.10 | |
9 | + * @modification | |
10 | + * since | author | description | |
11 | + * 2025.07.10 | 박현정 | 최초 등록 | |
12 | + * | |
13 | + * | |
14 | + * 프로젝트 주석 관련 VO | |
15 | + */ | |
16 | +@Getter | |
17 | +@NoArgsConstructor | |
18 | +public class ProjectCommentVO { | |
19 | + | |
20 | + private String projectCommentId; // 프로젝트 주석 아이디 | |
21 | + private String projectId; // 프로젝트 아이디 | |
22 | + private String memberId; // 주석 작성자 아이디 | |
23 | + private String memberName; // 주석 작성자 이름 | |
24 | + private String summary; // 주석 요약 | |
25 | + private String comment; // 주석 내용 | |
26 | + private String useAt; // 사용 여부 (N : 사용 안함, Y : 사용) | |
27 | + private String createdAt; // 생성일자 | |
28 | + private String updatedAt; // 수정일자 | |
29 | + | |
30 | + public ProjectCommentVO(String projectCommentId, String projectId, String memberId, String summary, String comment) { | |
31 | + this.projectCommentId = projectCommentId; | |
32 | + this.projectId = projectId; | |
33 | + this.memberId = memberId; | |
34 | + this.summary = summary; | |
35 | + this.comment = comment; | |
36 | + this.useAt = "Y"; | |
37 | + } | |
38 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectGroup/dao/ProjectGroupDAO.java
... | ... | @@ -0,0 +1,41 @@ |
1 | +package kr.co.takensoft.ai.system.projectGroup.dao; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.projectGroup.vo.ProjectGroupVO; | |
4 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
5 | + | |
6 | +/** | |
7 | + * @author 박현정 | |
8 | + * @since 2025.07.10 | |
9 | + * @modification | |
10 | + * since | author | description | |
11 | + * 2025.07.10 | 박현정 | 최초 등록 | |
12 | + * | |
13 | + * 프로젝트 그룹 관련 DAO | |
14 | + */ | |
15 | +@Mapper("projectGroupDAO") | |
16 | +public interface ProjectGroupDAO { | |
17 | + | |
18 | + /** | |
19 | + * @param projectGroupVO - 프로젝트 그룹 정보 | |
20 | + * @return int - 프로젝트 그룹 등록 결과 | |
21 | + * | |
22 | + * 프로젝트 그룹 등록 | |
23 | + */ | |
24 | + int saveProjectGroup(ProjectGroupVO projectGroupVO); | |
25 | + | |
26 | + /** | |
27 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
28 | + * @return | |
29 | + * | |
30 | + * 프로젝트 그룹 삭제 (use_at = 'N') | |
31 | + */ | |
32 | + void deactivateGroupProjectById(String projectGroupId); | |
33 | + | |
34 | + /** | |
35 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
36 | + * @return boolean - 프로젝트 그룹 존재 여부 | |
37 | + * | |
38 | + * 프로젝트 그룹 존재 여부 확인 | |
39 | + */ | |
40 | + boolean existsById(String projectGroupId); | |
41 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectGroup/service/ProjectGroupService.java
... | ... | @@ -0,0 +1,41 @@ |
1 | +package kr.co.takensoft.ai.system.projectGroup.service; | |
2 | + | |
3 | +import org.springframework.transaction.annotation.Transactional; | |
4 | + | |
5 | +/** | |
6 | + * @author 박현정 | |
7 | + * @since 2025.07.10 | |
8 | + * @modification | |
9 | + * since | author | description | |
10 | + * 2025.07.10 | 박현정 | 최초 등록 | |
11 | + * | |
12 | + * 프로젝트 그룹 관련 인터페이스 | |
13 | + */ | |
14 | +public interface ProjectGroupService { | |
15 | + | |
16 | + /** | |
17 | + * @param | |
18 | + * @return 프로젝트 그룹 id | |
19 | + * | |
20 | + * 프로젝트 그룹 등록 | |
21 | + */ | |
22 | + @Transactional | |
23 | + public String saveProjectGroup(); | |
24 | + | |
25 | + /** | |
26 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
27 | + * @return | |
28 | + * | |
29 | + * 프로젝트 그룹 삭제 (use_at = 'N') | |
30 | + */ | |
31 | + @Transactional | |
32 | + void deleteProjectGroup(String projectGroupId); | |
33 | + | |
34 | + /** | |
35 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
36 | + * @return | |
37 | + * | |
38 | + * 프로젝트 그룹 존재 여부 검사 | |
39 | + */ | |
40 | + void validateExistence(String projectGroupId); | |
41 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectGroup/service/impl/ProjectGroupServiceImpl.java
... | ... | @@ -0,0 +1,78 @@ |
1 | +package kr.co.takensoft.ai.system.projectGroup.service.impl; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.common.idgen.service.IdgenService; | |
4 | +import kr.co.takensoft.ai.system.project.vo.ProjectVO; | |
5 | +import kr.co.takensoft.ai.system.projectGroup.dao.ProjectGroupDAO; | |
6 | +import kr.co.takensoft.ai.system.projectGroup.service.ProjectGroupService; | |
7 | +import kr.co.takensoft.ai.system.projectGroup.vo.ProjectGroupVO; | |
8 | +import lombok.RequiredArgsConstructor; | |
9 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
10 | +import org.springframework.stereotype.Service; | |
11 | +import org.springframework.transaction.annotation.Transactional; | |
12 | + | |
13 | +/* | |
14 | + * @author : 박현정 | |
15 | + * @since : 2025.07.10 | |
16 | + * @modification | |
17 | + * since | author | description | |
18 | + * 2025.07.10 | 박현정 | 최초 등록 | |
19 | + * | |
20 | + * 프로젝트 그룹 관련 서비스 | |
21 | + */ | |
22 | +@Service("projectGroupService") | |
23 | +@RequiredArgsConstructor | |
24 | +public class ProjectGroupServiceImpl extends EgovAbstractServiceImpl implements ProjectGroupService { | |
25 | + | |
26 | + private final ProjectGroupDAO projectGroupDAO; | |
27 | + private final IdgenService projectGroupIdgn; | |
28 | + | |
29 | + /** | |
30 | + * @param | |
31 | + * @return 프로젝트 그룹 id | |
32 | + * | |
33 | + * 프로젝트 그룹 등록 | |
34 | + */ | |
35 | + @Override | |
36 | + @Transactional | |
37 | + public String saveProjectGroup() { | |
38 | + | |
39 | + try{ | |
40 | + String projectGroupId = projectGroupIdgn.getNextStringId(); // 프로젝트 그룹 구분 아이디 생성 | |
41 | + ProjectGroupVO projectGroupVO = new ProjectGroupVO(projectGroupId); | |
42 | + int result = projectGroupDAO.saveProjectGroup(projectGroupVO); | |
43 | + return result > 0 ? projectGroupId : null; | |
44 | + } catch (Exception e) { | |
45 | + e.printStackTrace(); | |
46 | + return null; | |
47 | + } | |
48 | + } | |
49 | + | |
50 | + /** | |
51 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
52 | + * @return | |
53 | + * | |
54 | + * 프로젝트 그룹 삭제 (use_at = 'N') | |
55 | + */ | |
56 | + @Override | |
57 | + @Transactional | |
58 | + public void deleteProjectGroup(String projectGroupId) { | |
59 | + try{ | |
60 | + projectGroupDAO.deactivateGroupProjectById(projectGroupId); | |
61 | + } catch (Exception e) { | |
62 | + e.printStackTrace(); | |
63 | + } | |
64 | + } | |
65 | + | |
66 | + /** | |
67 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
68 | + * @return | |
69 | + * | |
70 | + * 프로젝트 그룹 존재 여부 검사 | |
71 | + */ | |
72 | + @Override | |
73 | + public void validateExistence(String projectGroupId) { | |
74 | + if(!projectGroupDAO.existsById(projectGroupId)) { | |
75 | + throw new IllegalArgumentException("프로젝트 그룹이 존재하지 않습니다."); | |
76 | + } | |
77 | + } | |
78 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectGroup/vo/ProjectGroupVO.java
... | ... | @@ -0,0 +1,30 @@ |
1 | +package kr.co.takensoft.ai.system.projectGroup.vo; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | + | |
6 | +/** | |
7 | + * @author 박현정 | |
8 | + * @since 2025.07.10 | |
9 | + * @modification | |
10 | + * since | author | description | |
11 | + * 2025.07.10 | 박현정 | 최초 등록 | |
12 | + * | |
13 | + * | |
14 | + * 프로젝트 그룹 관련 VO | |
15 | + */ | |
16 | +@Getter | |
17 | +@NoArgsConstructor | |
18 | +public class ProjectGroupVO { | |
19 | + | |
20 | + private String projectGroupId; // 프로젝트 그룹 아이디 | |
21 | + private String useAt; // 사용 여부 (N : 사용 안함, Y : 사용) | |
22 | + private String createdAt; // 생성일자 | |
23 | + private String updatedAt; // 수정일자 | |
24 | + | |
25 | + // 프로젝트 그룹 생성용 생성자 | |
26 | + public ProjectGroupVO(String projectGroupId) { | |
27 | + this.projectGroupId = projectGroupId; | |
28 | + this.useAt = "Y"; | |
29 | + } | |
30 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectImage/dao/ProjectImageDAO.java
... | ... | @@ -0,0 +1,37 @@ |
1 | +package kr.co.takensoft.ai.system.projectImage.dao; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.project.vo.ProjectVO; | |
4 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
5 | +import kr.co.takensoft.ai.system.projectImage.vo.ProjectImageVO; | |
6 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
7 | + | |
8 | +import java.util.Optional; | |
9 | + | |
10 | +/** | |
11 | + * @author 박현정 | |
12 | + * @since 2025.07.10 | |
13 | + * @modification | |
14 | + * since | author | description | |
15 | + * 2025.07.10 | 박현정 | 최초 등록 | |
16 | + * | |
17 | + * 프로젝트 이미지 파일 관련 DAO | |
18 | + */ | |
19 | +@Mapper("projectImageDAO") | |
20 | +public interface ProjectImageDAO { | |
21 | + | |
22 | + /** | |
23 | + * @param projectImageVO - 프로젝트 이미지 파일 정보 | |
24 | + * @return int - 프로젝트 이미지 파일 등록 결과 | |
25 | + * | |
26 | + * 프로젝트 이미지 파일 등록 | |
27 | + */ | |
28 | + int saveProjectImage(ProjectImageVO projectImageVO); | |
29 | + | |
30 | + /** | |
31 | + * @param imageId - 프로젝트 이미지 아이디 | |
32 | + * @return ProjectImageVO - 프로젝트 이미지 정보 | |
33 | + * | |
34 | + * 프로젝트 이미지 정보 조회 | |
35 | + */ | |
36 | + ProjectImageVO findById(String imageId); | |
37 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectImage/dto/ProjectImageDTO.java
... | ... | @@ -0,0 +1,39 @@ |
1 | +package kr.co.takensoft.ai.system.projectImage.dto; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.projectImage.vo.ProjectImageVO; | |
4 | +import lombok.AllArgsConstructor; | |
5 | +import lombok.Getter; | |
6 | +import lombok.NoArgsConstructor; | |
7 | +import lombok.Setter; | |
8 | + | |
9 | +/** | |
10 | + * @author 박현정 | |
11 | + * @since 2025.07.15 | |
12 | + * @modification | |
13 | + * since | author | description | |
14 | + * 2025.07.15 | 박현정 | 최초 등록 | |
15 | + * | |
16 | + * 프로젝트 이미지 조회 관련 DTO | |
17 | + */ | |
18 | +@Setter | |
19 | +@Getter | |
20 | +@NoArgsConstructor | |
21 | +@AllArgsConstructor | |
22 | +public class ProjectImageDTO { | |
23 | + | |
24 | + private String projectImageId; // 프로젝트 이미지 아이디 | |
25 | + private String fileName; // 이미지 파일 이름 | |
26 | + private String fileUrl; // 이미지 파일 경로 | |
27 | + private String createdAt; // 생성일자 | |
28 | + private String updatedAt; // 수정일자 | |
29 | + | |
30 | + public static ProjectImageDTO from(ProjectImageVO imageVO) { | |
31 | + return new ProjectImageDTO( | |
32 | + imageVO.getProjectImageId(), | |
33 | + imageVO.getFileName(), | |
34 | + imageVO.getFileUrl(), | |
35 | + imageVO.getCreatedAt(), | |
36 | + imageVO.getUpdatedAt() | |
37 | + ); | |
38 | + } | |
39 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectImage/service/ProjectImageService.java
... | ... | @@ -0,0 +1,35 @@ |
1 | +package kr.co.takensoft.ai.system.projectImage.service; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.projectImage.vo.ProjectImageVO; | |
4 | +import org.springframework.transaction.annotation.Transactional; | |
5 | + | |
6 | +/** | |
7 | + * @author 박현정 | |
8 | + * @since 2025.07.14 | |
9 | + * @modification | |
10 | + * since | author | description | |
11 | + * 2025.07.14 | 박현정 | 최초 등록 | |
12 | + * | |
13 | + * 프로젝트 이미지 관련 인터페이스 | |
14 | + */ | |
15 | +public interface ProjectImageService { | |
16 | + | |
17 | + /** | |
18 | + * @param projectId - 프로젝트 아이디 | |
19 | + * @param fileName - 이미지 파일 이름 | |
20 | + * @param fileUrl - 이미지 파일 경로 | |
21 | + * @return 등록 성공 여부 | |
22 | + * | |
23 | + * 프로젝트 이미지 등록 | |
24 | + */ | |
25 | + @Transactional | |
26 | + public int saveProjectImage(String projectId, String fileName, String fileUrl); | |
27 | + | |
28 | + /** | |
29 | + * @param imageId - 프로젝트 이미지 아이디 | |
30 | + * @return ProjectImageVO - 프로젝트 이미지 정보 | |
31 | + * | |
32 | + * 프로젝트 이미지 정보 조회 | |
33 | + */ | |
34 | + public ProjectImageVO findImage(String imageId); | |
35 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectImage/service/impl/ProjectImageServiceImpl.java
... | ... | @@ -0,0 +1,55 @@ |
1 | +package kr.co.takensoft.ai.system.projectImage.service.impl; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.common.idgen.service.IdgenService; | |
4 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
5 | +import kr.co.takensoft.ai.system.projectImage.dao.ProjectImageDAO; | |
6 | +import kr.co.takensoft.ai.system.projectImage.service.ProjectImageService; | |
7 | +import kr.co.takensoft.ai.system.projectImage.vo.ProjectImageVO; | |
8 | +import lombok.RequiredArgsConstructor; | |
9 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
10 | +import org.springframework.stereotype.Service; | |
11 | +import org.springframework.transaction.annotation.Transactional; | |
12 | + | |
13 | +/** | |
14 | + * @author : 박현정 | |
15 | + * @since : 2025.07.14 | |
16 | + * @modification | |
17 | + * since | author | description | |
18 | + * 2025.07.14 | 박현정 | 최초 등록 | |
19 | + * | |
20 | + * 프로젝트 이미지 관련 서비스 | |
21 | + */ | |
22 | +@Service("projectImageService") | |
23 | +@RequiredArgsConstructor | |
24 | +public class ProjectImageServiceImpl extends EgovAbstractServiceImpl implements ProjectImageService { | |
25 | + | |
26 | + private final ProjectImageDAO projectImageDAO; | |
27 | + private final IdgenService projectImageIdgn; | |
28 | + | |
29 | + /** | |
30 | + * @param projectId - 프로젝트 아이디 | |
31 | + * @param fileName - 이미지 파일 이름 | |
32 | + * @param fileUrl - 이미지 파일 경로 | |
33 | + * @return 등록 성공 여부 | |
34 | + * | |
35 | + * 프로젝트 이미지 등록 | |
36 | + */ | |
37 | + @Override | |
38 | + public int saveProjectImage(String projectId, String fileName, String fileUrl) { | |
39 | + | |
40 | + String projectImageId = projectImageIdgn.getNextStringId(); // 프로젝트 주석 구분 아이디 생성 | |
41 | + ProjectImageVO projectImageVO = new ProjectImageVO(projectImageId, projectId, fileName, fileUrl); // 주석 정보 등록 | |
42 | + return projectImageDAO.saveProjectImage(projectImageVO); | |
43 | + } | |
44 | + | |
45 | + /** | |
46 | + * @param imageId - 프로젝트 이미지 아이디 | |
47 | + * @return ProjectImageVO - 프로젝트 이미지 정보 | |
48 | + * | |
49 | + * 프로젝트 이미지 정보 조회 | |
50 | + */ | |
51 | + @Override | |
52 | + public ProjectImageVO findImage(String imageId) { | |
53 | + return projectImageDAO.findById(imageId); | |
54 | + } | |
55 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectImage/vo/ProjectImageVO.java
... | ... | @@ -0,0 +1,36 @@ |
1 | +package kr.co.takensoft.ai.system.projectImage.vo; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | + | |
6 | +/** | |
7 | + * @author 박현정 | |
8 | + * @since 2025.07.10 | |
9 | + * @modification | |
10 | + * since | author | description | |
11 | + * 2025.07.10 | 박현정 | 최초 등록 | |
12 | + * | |
13 | + * | |
14 | + * 프로젝트 이미지 관련 VO | |
15 | + */ | |
16 | +@Getter | |
17 | +@NoArgsConstructor | |
18 | +public class ProjectImageVO { | |
19 | + | |
20 | + private String projectImageId; // 프로젝트 이미지 아이디 | |
21 | + private String projectId; // 프로젝트 아이디 | |
22 | + private String fileName; // 이미지 파일 이름 | |
23 | + private String fileUrl; // 이미지 파일 경로 | |
24 | + private String useAt; // 사용 여부 (N : 사용 안함, Y : 사용) | |
25 | + private String createdAt; // 생성일자 | |
26 | + private String updatedAt; // 수정일자 | |
27 | + | |
28 | + // 프로젝트 이미지 생성용 생성자 | |
29 | + public ProjectImageVO(String projectImageId, String projectId, String fileName, String fileUrl) { | |
30 | + this.projectImageId = projectImageId; | |
31 | + this.projectId = projectId; | |
32 | + this.fileName = fileName; | |
33 | + this.fileUrl = fileUrl; | |
34 | + this.useAt = "Y"; | |
35 | + } | |
36 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectMember/dao/ProjectMemberDAO.java
... | ... | @@ -0,0 +1,45 @@ |
1 | +package kr.co.takensoft.ai.system.projectMember.dao; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
4 | +import kr.co.takensoft.ai.system.projectMember.vo.ProjectMemberVO; | |
5 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +/** | |
10 | + * @author 박현정 | |
11 | + * @since 2025.07.10 | |
12 | + * @modification | |
13 | + * since | author | description | |
14 | + * 2025.07.10 | 박현정 | 최초 등록 | |
15 | + * | |
16 | + * 프로젝트 참여자 관련 DAO | |
17 | + */ | |
18 | +@Mapper("projectMemberDAO") | |
19 | +public interface ProjectMemberDAO { | |
20 | + | |
21 | + /** | |
22 | + * @param projectMemberVO - 프로젝트 참여자 정보 | |
23 | + * @return int - 프로젝트 참여자 등록 결과 | |
24 | + * | |
25 | + * 프로젝트 참여자 등록 | |
26 | + */ | |
27 | + int saveProjectMember(ProjectMemberVO projectMemberVO); | |
28 | + | |
29 | + /** | |
30 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
31 | + * @param memberId - 사용자 아이디 | |
32 | + * @return boolean - 프로젝트 참여자 존재 여부 검증 | |
33 | + * | |
34 | + * 프로젝트 참여자 존재 여부 검증 | |
35 | + */ | |
36 | + boolean existsByProjectGroupIdAndMemberId(String projectGroupId, String memberId); | |
37 | + | |
38 | + /** | |
39 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
40 | + * @return List<ProjectMemberVO> - 프로젝트 참여자 목록 | |
41 | + * | |
42 | + * 프로젝트 참여자 목록 조회 | |
43 | + */ | |
44 | + List<ProjectMemberVO> findAllByGroupId(String projectGroupId); | |
45 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectMember/dto/ProjectMemberDTO.java
... | ... | @@ -0,0 +1,41 @@ |
1 | +package kr.co.takensoft.ai.system.projectMember.dto; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.projectMember.vo.ProjectMemberVO; | |
4 | +import lombok.AllArgsConstructor; | |
5 | +import lombok.Getter; | |
6 | +import lombok.NoArgsConstructor; | |
7 | +import lombok.Setter; | |
8 | + | |
9 | +/** | |
10 | + * @author 박현정 | |
11 | + * @since 2025.07.15 | |
12 | + * @modification | |
13 | + * since | author | description | |
14 | + * 2025.07.15 | 박현정 | 최초 등록 | |
15 | + * | |
16 | + * 프로젝트 참여자 조회 관련 DTO | |
17 | + */ | |
18 | +@Setter | |
19 | +@Getter | |
20 | +@NoArgsConstructor | |
21 | +@AllArgsConstructor | |
22 | +public class ProjectMemberDTO { | |
23 | + | |
24 | + private String projectMemberId; // 프로젝트 참여자 아이디 | |
25 | + private String memberId; // 참여자 아이디 | |
26 | + private String memberName; // 참여자 이름 | |
27 | + private String isOwner; // 프로젝트 대표자 여부 ( N: 대표자 아님, Y: 대표자) | |
28 | + private String createdAt; // 생성일자 | |
29 | + private String updatedAt; // 수정일자 | |
30 | + | |
31 | + public static ProjectMemberDTO from(ProjectMemberVO projectMemberVO) { | |
32 | + return new ProjectMemberDTO( | |
33 | + projectMemberVO.getProjectMemberId(), | |
34 | + projectMemberVO.getMemberId(), | |
35 | + projectMemberVO.getMemberName(), | |
36 | + projectMemberVO.getIsOwner(), | |
37 | + projectMemberVO.getCreatedAt(), | |
38 | + projectMemberVO.getUpdatedAt() | |
39 | + ); | |
40 | + } | |
41 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectMember/service/ProjectMemberService.java
... | ... | @@ -0,0 +1,43 @@ |
1 | +package kr.co.takensoft.ai.system.projectMember.service; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.projectMember.vo.ProjectMemberVO; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author 박현정 | |
9 | + * @since 2025.07.10 | |
10 | + * @modification | |
11 | + * since | author | description | |
12 | + * 2025.07.10 | 박현정 | 최초 등록 | |
13 | + * | |
14 | + * 프로젝트 참여자 인터페이스 | |
15 | + */ | |
16 | +public interface ProjectMemberService { | |
17 | + | |
18 | + /** | |
19 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
20 | + * @param memberId - 사용자 아이디 | |
21 | + * @param isOwner - 프로젝트 대표자 여부 | |
22 | + * @return 등록 성공 여부 | |
23 | + * | |
24 | + * 프로젝트 참여자 등록 | |
25 | + */ | |
26 | + public int saveProjectMember(String projectGroupId, String memberId, String isOwner); | |
27 | + | |
28 | + /** | |
29 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
30 | + * @param memberId - 사용자 아이디 | |
31 | + * | |
32 | + * 프로젝트 참여자 여부 검증 | |
33 | + */ | |
34 | + void validateProjectMember(String projectGroupId, String memberId); | |
35 | + | |
36 | + /** | |
37 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
38 | + * @return List<ProjectMemberVO> - 프로젝트 참여자 목록 | |
39 | + * | |
40 | + * 프로젝트 참여자 목록 조회 | |
41 | + */ | |
42 | + List<ProjectMemberVO> findProjectMembers(String projectGroupId); | |
43 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectMember/service/impl/ProjectMemberServiceImpl.java
... | ... | @@ -0,0 +1,77 @@ |
1 | +package kr.co.takensoft.ai.system.projectMember.service.impl; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.common.idgen.service.IdgenService; | |
4 | +import kr.co.takensoft.ai.system.projectMember.dao.ProjectMemberDAO; | |
5 | +import kr.co.takensoft.ai.system.projectMember.service.ProjectMemberService; | |
6 | +import kr.co.takensoft.ai.system.projectMember.vo.ProjectMemberVO; | |
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 | +/** | |
14 | + * @author : 박현정 | |
15 | + * @since : 2025.07.10 | |
16 | + * @modification | |
17 | + * since | author | description | |
18 | + * 2025.07.10 | 박현정 | 최초 등록 | |
19 | + * | |
20 | + * 프로젝트 참여자 관련 서비스 | |
21 | + */ | |
22 | +@Service("projectMemberService") | |
23 | +@RequiredArgsConstructor | |
24 | +public class ProjectMemberServiceImpl extends EgovAbstractServiceImpl implements ProjectMemberService { | |
25 | + | |
26 | + private final ProjectMemberDAO projectMemberDAO; | |
27 | + private final IdgenService projectMemberIdgn; | |
28 | + | |
29 | + /** | |
30 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
31 | + * @param memberId - 사용자 아이디 | |
32 | + * @param isOwner - 프로젝트 대표자 여부 | |
33 | + * @return 등록 성공 여부 | |
34 | + * | |
35 | + * 프로젝트 참여자 등록 | |
36 | + */ | |
37 | + @Override | |
38 | + public int saveProjectMember(String projectGroupId, String memberId, String isOwner) { | |
39 | + | |
40 | + try { | |
41 | + String projectMemberId = projectMemberIdgn.getNextStringId(); // 프로젝트 참여자 구분 아이디 생성 | |
42 | + ProjectMemberVO projectMemberVO = new ProjectMemberVO(projectMemberId, projectGroupId, memberId, isOwner); | |
43 | + return projectMemberDAO.saveProjectMember(projectMemberVO); | |
44 | + } catch (Exception e) { | |
45 | + e.printStackTrace(); | |
46 | + return -1; | |
47 | + } | |
48 | + } | |
49 | + | |
50 | + /** | |
51 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
52 | + * @param memberId - 사용자 아이디 | |
53 | + * | |
54 | + * 프로젝트 참여자 여부 검증 | |
55 | + */ | |
56 | + @Override | |
57 | + public void validateProjectMember(String projectGroupId, String memberId) { | |
58 | + if(!projectMemberDAO.existsByProjectGroupIdAndMemberId(projectGroupId, memberId)){ | |
59 | + try { | |
60 | + throw new IllegalAccessException("이 프로젝트에 참여한 멤버가 아닙니다."); | |
61 | + } catch (IllegalAccessException e) { | |
62 | + e.printStackTrace(); | |
63 | + } | |
64 | + } | |
65 | + } | |
66 | + | |
67 | + /** | |
68 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
69 | + * @return List<ProjectMemberVO> - 프로젝트 참여자 목록 | |
70 | + * | |
71 | + * 프로젝트 참여자 목록 조회 | |
72 | + */ | |
73 | + @Override | |
74 | + public List<ProjectMemberVO> findProjectMembers(String projectGroupId) { | |
75 | + return projectMemberDAO.findAllByGroupId(projectGroupId); | |
76 | + } | |
77 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectMember/vo/ProjectMemberVO.java
... | ... | @@ -0,0 +1,37 @@ |
1 | +package kr.co.takensoft.ai.system.projectMember.vo; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | + | |
6 | +/** | |
7 | + * @author 박현정 | |
8 | + * @since 2025.07.10 | |
9 | + * @modification | |
10 | + * since | author | description | |
11 | + * 2025.07.10 | 박현정 | 최초 등록 | |
12 | + * | |
13 | + * | |
14 | + * 프로젝트 참여자 관련 VO | |
15 | + */ | |
16 | +@Getter | |
17 | +@NoArgsConstructor | |
18 | +public class ProjectMemberVO { | |
19 | + | |
20 | + private String projectMemberId; // 프로젝트 참여자 아이디 | |
21 | + private String projectGroupId; // 프로젝트 그룹 아이디 | |
22 | + private String memberId; // 참여자 아이디 | |
23 | + private String memberName; // 참여자 이름 | |
24 | + private String isOwner; // 프로젝트 대표자 여부 ( N: 대표자 아님, Y: 대표자) | |
25 | + private String useAt; // 사용 여부 (N : 사용 안함, Y : 사용) | |
26 | + private String createdAt; // 생성일자 | |
27 | + private String updatedAt; // 수정일자 | |
28 | + | |
29 | + // 프로젝트 참여자 생성용 생성자 | |
30 | + public ProjectMemberVO(String projectMemberId, String projectGroupId, String memberId, String isOwner) { | |
31 | + this.projectMemberId = projectMemberId; | |
32 | + this.projectGroupId = projectGroupId; | |
33 | + this.memberId = memberId; | |
34 | + this.isOwner = isOwner; | |
35 | + this.useAt = "Y"; | |
36 | + } | |
37 | +} |
+++ src/main/resources/mybatis/mapper/project/project-SQL.xml
... | ... | @@ -0,0 +1,253 @@ |
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="kr.co.takensoft.ai.system.project.dao.ProjectDAO"> | |
4 | + | |
5 | + <!-- | |
6 | + 작 성 자 : 박현정 | |
7 | + 작 성 일 : 2025.07.11 | |
8 | + 내 용 : 프로젝트 resultMap | |
9 | + --> | |
10 | + <resultMap id="ProjectMap" type="ProjectVO"> | |
11 | + <result property="projectId" column="project_id" /> | |
12 | + <result property="projectGroupId" column="project_group_id" /> | |
13 | + <result property="projectName" column="project_name" /> | |
14 | + <result property="isMain" column="is_main" /> | |
15 | + <result property="useAt" column="use_at" /> | |
16 | + <result property="imageId" column="project_image_id"/> | |
17 | + <result property="commentId" column="project_comment_id"/> | |
18 | + <result property="createdAt" column="created_at" /> | |
19 | + <result property="updatedAt" column="updated_at" /> | |
20 | + </resultMap> | |
21 | + | |
22 | + <!-- | |
23 | + 작 성 자 : 박현정 | |
24 | + 작 성 일 : 2025.07.11 | |
25 | + 내 용 : 활성(사용중) 데이터만 조회하도록 필터링 | |
26 | + --> | |
27 | + <sql id="activeOnly"> | |
28 | + use_at = 'Y' | |
29 | + </sql> | |
30 | + | |
31 | + <!-- | |
32 | + 작 성 자 : 박현정 | |
33 | + 작 성 일 : 2025.07.09 | |
34 | + 내 용 : 프로젝트 등록 | |
35 | + --> | |
36 | + <insert id="saveProject" parameterType="projectVO"> | |
37 | + INSERT INTO project | |
38 | + (project_id, | |
39 | + project_group_id, | |
40 | + project_name, | |
41 | + is_main, | |
42 | + use_at, | |
43 | + created_at, | |
44 | + updated_at | |
45 | + ) | |
46 | + VALUES ( | |
47 | + #{projectId}, | |
48 | + #{projectGroupId}, | |
49 | + #{projectName}, | |
50 | + #{isMain}, | |
51 | + #{useAt}, | |
52 | + CURRENT_TIMESTAMP, | |
53 | + CURRENT_TIMESTAMP | |
54 | + ) | |
55 | + </insert> | |
56 | + | |
57 | + <!-- | |
58 | + 작 성 자 : 박현정 | |
59 | + 작 성 일 : 2025.07.11 | |
60 | + 내 용 : 사용자가 참여하는 모든 프로젝트 조회 | |
61 | + --> | |
62 | + <select id="findProjectsByMemberId" resultMap="ProjectMap" parameterType="String"> | |
63 | + SELECT | |
64 | + p.project_id, | |
65 | + p.project_group_id, | |
66 | + p.project_name, | |
67 | + p.is_main, | |
68 | + p.use_at, | |
69 | + pm.is_owner, | |
70 | + TO_CHAR(p.created_at, 'YYYY-MM-DD HH24:MI') AS created_at, | |
71 | + TO_CHAR(p.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at | |
72 | + FROM project_member pm | |
73 | + JOIN project p ON pm.project_group_id = p.project_group_id | |
74 | + WHERE pm.member_id = #{memberId} | |
75 | + AND pm.use_at = 'Y' | |
76 | + AND p.use_at = 'Y' | |
77 | + AND p.is_main = 'Y' | |
78 | + </select> | |
79 | + | |
80 | + <!-- | |
81 | + 작 성 자 : 박현정 | |
82 | + 작 성 일 : 2025.07.14 | |
83 | + 내 용 : 프로젝트 조회 | |
84 | + --> | |
85 | + <select id="findById" resultMap="ProjectMap" parameterType="String"> | |
86 | + SELECT | |
87 | + p.project_id, | |
88 | + p.project_group_id, | |
89 | + p.project_name, | |
90 | + p.is_main, | |
91 | + p.use_at, | |
92 | + i.project_image_id, | |
93 | + c.project_comment_id, | |
94 | + TO_CHAR(p.created_at, 'YYYY-MM-DD HH24:MI') AS created_at, | |
95 | + TO_CHAR(p.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at | |
96 | + FROM project p | |
97 | + LEFT JOIN project_comment c ON p.project_id = c.project_id | |
98 | + LEFT JOIN project_image i ON p.project_id = i.project_id | |
99 | + WHERE p.project_id = #{projectId} | |
100 | + AND p.use_at = 'Y' | |
101 | + AND c.use_at = 'Y' | |
102 | + AND i.use_at = 'Y' | |
103 | + </select> | |
104 | + | |
105 | + <!-- | |
106 | + 작 성 자 : 박현정 | |
107 | + 작 성 일 : 2025.07.10 | |
108 | + 내 용 : 사용자가 생성한 프로젝트 개수 조회 | |
109 | + --> | |
110 | + <select id="countCreatedByMemberId"> | |
111 | + SELECT COUNT(*) | |
112 | + FROM project_member pm | |
113 | + JOIN project p ON pm.project_group_id = p.project_group_id | |
114 | + WHERE member_id = #{memberId} | |
115 | + AND pm.is_owner = 'Y' | |
116 | + AND p.is_main = 'Y' | |
117 | + </select> | |
118 | + | |
119 | + <!-- | |
120 | + 작 성 자 : 박현정 | |
121 | + 작 성 일 : 2025.07.14 | |
122 | + 내 용 : 대표 프로젝트 해제 | |
123 | + --> | |
124 | + <update id="unsetProjectMain" parameterType="String"> | |
125 | + UPDATE project | |
126 | + <set> | |
127 | + is_main = 'N', | |
128 | + updated_at = CURRENT_TIMESTAMP | |
129 | + </set> | |
130 | + WHERE project_group_id = #{projectGroupId} | |
131 | + AND is_main = 'Y' | |
132 | + AND use_at = 'Y' | |
133 | + </update> | |
134 | + | |
135 | + <!-- | |
136 | + 작 성 자 : 박현정 | |
137 | + 작 성 일 : 2025.07.14 | |
138 | + 내 용 : 프로젝트 존재 여부 확인 | |
139 | + --> | |
140 | + <select id="existsById" resultType="boolean" parameterType="String"> | |
141 | + SELECT EXISTS ( | |
142 | + SELECT 1 | |
143 | + FROM project | |
144 | + WHERE project_id = #{projectId} | |
145 | + AND use_at = 'Y' | |
146 | + ) | |
147 | + </select> | |
148 | + | |
149 | + <!-- | |
150 | + 작 성 자 : 박현정 | |
151 | + 작 성 일 : 2025.07.14 | |
152 | + 내 용 : 프로젝트 그룹 아이디 조회 | |
153 | + --> | |
154 | + <select id="findProjectGroupIdByProjectId" resultType="String" parameterType="String"> | |
155 | + SELECT project_group_id | |
156 | + FROM project | |
157 | + WHERE project_id = #{projectId} | |
158 | + AND use_at = 'Y' | |
159 | + </select> | |
160 | + | |
161 | + <!-- | |
162 | + 작 성 자 : 박현정 | |
163 | + 작 성 일 : 2025.07.14 | |
164 | + 내 용 : 프로젝트 이름 변경 | |
165 | + --> | |
166 | + <update id="updateProjectName" parameterType="String"> | |
167 | + UPDATE project | |
168 | + <set> | |
169 | + project_name = #{projectName}, | |
170 | + updated_at = CURRENT_TIMESTAMP | |
171 | + </set> | |
172 | + WHERE project_id = #{projectId} | |
173 | + AND use_at = 'Y' | |
174 | + </update> | |
175 | + | |
176 | + <!-- | |
177 | + 작 성 자 : 박현정 | |
178 | + 작 성 일 : 2025.07.14 | |
179 | + 내 용 : 그룹 내 프로젝트 모두 삭제 (use_at = 'N') | |
180 | + --> | |
181 | + <update id="deactivateProjectsByGroupId" parameterType="String"> | |
182 | + UPDATE project | |
183 | + <set> | |
184 | + use_at = 'N', | |
185 | + updated_at = CURRENT_TIMESTAMP | |
186 | + </set> | |
187 | + WHERE project_group_id = #{projectGroupId} | |
188 | + AND use_at = 'Y' | |
189 | + </update> | |
190 | + | |
191 | + <!-- | |
192 | + 작 성 자 : 박현정 | |
193 | + 작 성 일 : 2025.07.14 | |
194 | + 내 용 : 대표 프로젝트 설정 | |
195 | + --> | |
196 | + <update id="setProjectMain" parameterType="String"> | |
197 | + UPDATE project | |
198 | + <set> | |
199 | + is_main = 'Y', | |
200 | + updated_at = CURRENT_TIMESTAMP | |
201 | + </set> | |
202 | + WHERE project_id = #{projectId} | |
203 | + AND is_main = 'N' | |
204 | + AND use_at = 'Y' | |
205 | + </update> | |
206 | + | |
207 | + <!-- | |
208 | + 작 성 자 : 박현정 | |
209 | + 작 성 일 : 2025.07.14 | |
210 | + 내 용 : 그룹 내에서 특정 프로젝트 이후에 생성된 프로젝트 모두 삭제 (use_at = 'N') | |
211 | + --> | |
212 | + <update id="deactivateProjectsCreatedAfter" parameterType="String"> | |
213 | + UPDATE project | |
214 | + <set> | |
215 | + use_at = 'N', | |
216 | + updated_at = CURRENT_TIMESTAMP | |
217 | + </set> | |
218 | + WHERE project_group_id = #{projectGroupId} | |
219 | + AND created_at > ( | |
220 | + SELECT created_at | |
221 | + FROM project | |
222 | + WHERE project_id = #{projectId} | |
223 | + ) | |
224 | + </update> | |
225 | + | |
226 | + <select id="findAllProjects" parameterType="ProjectSearchReqDTO" resultMap="ProjectMap"> | |
227 | + SELECT | |
228 | + p.project_id, | |
229 | + p.project_group_id, | |
230 | + p.project_name, | |
231 | + p.is_main, | |
232 | + p.created_at, | |
233 | + p.updated_at | |
234 | + FROM project p | |
235 | + JOIN project_member pm ON p.project_group_id = pm.project_group_id | |
236 | + <where> | |
237 | + <if test="memberId != null"> | |
238 | + pm.member_id = #{memberId} | |
239 | + </if> | |
240 | + <if test="projectGroupId != null"> | |
241 | + AND p.project_group_id = #{projectGroupId} | |
242 | + </if> | |
243 | + <if test="isMain != null"> | |
244 | + AND p.is_main = #{isMain} | |
245 | + </if> | |
246 | + <if test="projectName != null and isMain != ''"> | |
247 | + AND p.project_name ILIKE CONCAT('%', #{projectName}, '%') | |
248 | + </if> | |
249 | + </where> | |
250 | + </select> | |
251 | + | |
252 | + | |
253 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/mybatis/mapper/projectComment/projectComment-SQL.xml
... | ... | @@ -0,0 +1,80 @@ |
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="kr.co.takensoft.ai.system.projectComment.dao.ProjectCommentDAO"> | |
4 | + | |
5 | + <!-- | |
6 | + 작 성 자 : 박현정 | |
7 | + 작 성 일 : 2025.07.15 | |
8 | + 내 용 : 프로젝트 주석 resultMap | |
9 | +--> | |
10 | + <resultMap id="ProjectCommentMap" type="ProjectCommentVO"> | |
11 | + <result property="projectCommentId" column="project_comment_id"/> | |
12 | + <result property="projectId" column="project_id"/> | |
13 | + <result property="memberId" column="member_id"/> | |
14 | + <result property="memberName" column="member_name"/> | |
15 | + <result property="summary" column="summary"/> | |
16 | + <result property="comment" column="comment"/> | |
17 | + <result property="useAt" column="use_at"/> | |
18 | + <result property="createdAt" column="created_at"/> | |
19 | + <result property="updatedAt" column="updated_at"/> | |
20 | + </resultMap> | |
21 | + | |
22 | + <!-- | |
23 | + 작 성 자 : 박현정 | |
24 | + 작 성 일 : 2025.07.10 | |
25 | + 내 용 : 프로젝트 주석 등록 | |
26 | + --> | |
27 | + <insert id="saveProjectComment" parameterType="projectCommentVO"> | |
28 | + INSERT INTO project_comment | |
29 | + (project_comment_id, | |
30 | + project_id, | |
31 | + member_id, | |
32 | + summary, | |
33 | + "comment", | |
34 | + use_at, | |
35 | + created_at, | |
36 | + updated_at) | |
37 | + VALUES ( | |
38 | + #{projectCommentId}, | |
39 | + #{projectId}, | |
40 | + #{memberId}, | |
41 | + #{summary}, | |
42 | + #{comment}, | |
43 | + #{useAt}, | |
44 | + CURRENT_TIMESTAMP, | |
45 | + CURRENT_TIMESTAMP | |
46 | + ) | |
47 | + </insert> | |
48 | + | |
49 | + <!-- | |
50 | + 작 성 자 : 박현정 | |
51 | + 작 성 일 : 2025.07.11 | |
52 | + 내 용 : 활성(사용중) 데이터만 조회하도록 필터링 | |
53 | + --> | |
54 | + <sql id="activeOnly"> | |
55 | + use_at = 'Y' | |
56 | + </sql> | |
57 | + | |
58 | + <!-- | |
59 | + 작 성 자 : 박현정 | |
60 | + 작 성 일 : 2025.07.15 | |
61 | + 내 용 : 프로젝트 주석 조회 | |
62 | + --> | |
63 | + <select id="findById" parameterType="String" resultMap="ProjectCommentMap"> | |
64 | + SELECT | |
65 | + c.project_comment_id, | |
66 | + c.project_id, | |
67 | + c.member_id, | |
68 | + m.member_name, | |
69 | + c.summary, | |
70 | + c."comment", | |
71 | + c.use_at, | |
72 | + TO_CHAR(c.created_at, 'YYYY-MM-DD HH24:MI') AS created_at, | |
73 | + TO_CHAR(c.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at | |
74 | + FROM project_comment c | |
75 | + LEFT JOIN member m ON c.member_id = m.member_id | |
76 | + WHERE project_comment_id = #{commentId} | |
77 | + AND c.use_at = 'Y' | |
78 | + </select> | |
79 | + | |
80 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/mybatis/mapper/projectGroup/projectGroup-SQL.xml
... | ... | @@ -0,0 +1,63 @@ |
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="kr.co.takensoft.ai.system.projectGroup.dao.ProjectGroupDAO"> | |
4 | + <!-- | |
5 | + 작 성 자 : 박현정 | |
6 | + 작 성 일 : 2025.07.10 | |
7 | + 내 용 : 프로젝트 그룹 등록 | |
8 | + --> | |
9 | + <insert id="saveProjectGroup" parameterType="ProjectGroupVO"> | |
10 | + INSERT INTO project_group | |
11 | + (project_group_id, | |
12 | + use_at, | |
13 | + created_at, | |
14 | + updated_at) | |
15 | + VALUES ( | |
16 | + #{projectGroupId}, | |
17 | + #{useAt}, | |
18 | + CURRENT_TIMESTAMP, | |
19 | + CURRENT_TIMESTAMP | |
20 | + ) | |
21 | + </insert> | |
22 | + | |
23 | + <!-- | |
24 | + 작 성 자 : 박현정 | |
25 | + 작 성 일 : 2025.07.14 | |
26 | + 내 용 : 프로젝트 그룹 삭제 (use_at = 'N') | |
27 | + --> | |
28 | + <update id="deactivateGroupProjectById" parameterType="String"> | |
29 | + UPDATE project_group | |
30 | + <set> | |
31 | + use_at = 'N', | |
32 | + updated_at = CURRENT_TIMESTAMP | |
33 | + </set> | |
34 | + WHERE project_group_id = #{projectGroupId} | |
35 | + AND use_at = 'Y' | |
36 | + </update> | |
37 | + | |
38 | + | |
39 | + <!-- | |
40 | + 작 성 자 : 박현정 | |
41 | + 작 성 일 : 2025.07.11 | |
42 | + 내 용 : 활성(사용중) 데이터만 조회하도록 필터링 | |
43 | + --> | |
44 | + <sql id="activeOnly"> | |
45 | + use_at = 'Y' | |
46 | + </sql> | |
47 | + | |
48 | + <!-- | |
49 | + 작 성 자 : 박현정 | |
50 | + 작 성 일 : 2025.07.14 | |
51 | + 내 용 : 프로젝트 그룹 존재 여부 확인 | |
52 | + --> | |
53 | + <select id="existsById" resultType="boolean" parameterType="String"> | |
54 | + SELECT EXISTS ( | |
55 | + SELECT 1 | |
56 | + FROM project_group | |
57 | + WHERE project_group_id = #{projectGroupId} | |
58 | + AND use_at = 'Y' | |
59 | + ) | |
60 | + </select> | |
61 | + | |
62 | + | |
63 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/mybatis/mapper/projectImage/projectImage-SQL.xml
... | ... | @@ -0,0 +1,73 @@ |
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="kr.co.takensoft.ai.system.projectImage.dao.ProjectImageDAO"> | |
4 | + | |
5 | + <!-- | |
6 | + 작 성 자 : 박현정 | |
7 | + 작 성 일 : 2025.07.15 | |
8 | + 내 용 : 프로젝트 이미지 resultMap | |
9 | + --> | |
10 | + <resultMap id="ProjectImageMap" type="ProjectImageVO"> | |
11 | + <result property="projectImageId" column="project_image_id"/> | |
12 | + <result property="projectId" column="project_id"/> | |
13 | + <result property="fileName" column="file_name"/> | |
14 | + <result property="fileUrl" column="file_url"/> | |
15 | + <result property="useAt" column="use_at"/> | |
16 | + <result property="createdAt" column="created_at"/> | |
17 | + <result property="updatedAt" column="updated_at"/> | |
18 | + </resultMap> | |
19 | + | |
20 | + <!-- | |
21 | + 작 성 자 : 박현정 | |
22 | + 작 성 일 : 2025.07.11 | |
23 | + 내 용 : 활성(사용중) 데이터만 조회하도록 필터링 | |
24 | + --> | |
25 | + <sql id="activeOnly"> | |
26 | + use_at = 'Y' | |
27 | + </sql> | |
28 | + | |
29 | + <!-- | |
30 | + 작 성 자 : 박현정 | |
31 | + 작 성 일 : 2025.07.10 | |
32 | + 내 용 : 프로젝트 이미지 등록 | |
33 | + --> | |
34 | + <insert id="saveProjectImage" parameterType="ProjectImageVO"> | |
35 | + INSERT INTO project_image | |
36 | + (project_image_id, | |
37 | + project_id, | |
38 | + file_name, | |
39 | + file_url, | |
40 | + use_at, | |
41 | + created_at, | |
42 | + updated_at) | |
43 | + VALUES ( | |
44 | + #{projectImageId}, | |
45 | + #{projectId}, | |
46 | + #{fileName}, | |
47 | + #{fileUrl}, | |
48 | + #{useAt}, | |
49 | + CURRENT_TIMESTAMP, | |
50 | + CURRENT_TIMESTAMP | |
51 | + ) | |
52 | + </insert> | |
53 | + | |
54 | + <!-- | |
55 | + 작 성 자 : 박현정 | |
56 | + 작 성 일 : 2025.07.15 | |
57 | + 내 용 : 프로젝트 이미지 조회 | |
58 | + --> | |
59 | + <select id="findById" parameterType="String" resultMap="ProjectImageMap"> | |
60 | + SELECT | |
61 | + project_image_id, | |
62 | + project_id, | |
63 | + file_name, | |
64 | + file_url, | |
65 | + use_at, | |
66 | + TO_CHAR(created_at, 'YYYY-MM-DD HH24:MI') AS created_at, | |
67 | + TO_CHAR(updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at | |
68 | + FROM project_image | |
69 | + WHERE project_image_id = #{imageId} | |
70 | + AND use_at = 'Y' | |
71 | + </select> | |
72 | + | |
73 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/mybatis/mapper/projectMember/projectMember-SQL.xml
... | ... | @@ -0,0 +1,92 @@ |
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="kr.co.takensoft.ai.system.projectMember.dao.ProjectMemberDAO"> | |
4 | + | |
5 | + <!-- | |
6 | + 작 성 자 : 박현정 | |
7 | + 작 성 일 : 2025.07.15 | |
8 | + 내 용 : 프로젝트 참여자 resultMap | |
9 | + --> | |
10 | + <resultMap id="ProjectMemberMap" type="ProjectMemberVO"> | |
11 | + <result property="projectMemberId" column="project_member_id"/> | |
12 | + <result property="projectGroupId" column="project_group_id"/> | |
13 | + <result property="memberId" column="member_id"/> | |
14 | + <result property="memberName" column="member_name"/> | |
15 | + <result property="isOwner" column="is_owner"/> | |
16 | + <result property="useAt" column="use_at"/> | |
17 | + <result property="createdAt" column="created_at"/> | |
18 | + <result property="updatedAt" column="updated_at"/> | |
19 | + </resultMap> | |
20 | + | |
21 | + <!-- | |
22 | + 작 성 자 : 박현정 | |
23 | + 작 성 일 : 2025.07.11 | |
24 | + 내 용 : 활성(사용중) 데이터만 조회하도록 필터링 | |
25 | + --> | |
26 | + <sql id="activeOnly"> | |
27 | + use_at = 'Y' | |
28 | + </sql> | |
29 | + | |
30 | + <!-- | |
31 | + 작 성 자 : 박현정 | |
32 | + 작 성 일 : 2025.07.10 | |
33 | + 내 용 : 프로젝트 참여자 등록 | |
34 | + --> | |
35 | + <insert id="saveProjectMember" parameterType="projectMemberVO"> | |
36 | + INSERT INTO project_member | |
37 | + (project_member_id, | |
38 | + project_group_id, | |
39 | + member_id, | |
40 | + is_owner, | |
41 | + use_at, | |
42 | + created_at, | |
43 | + updated_at | |
44 | + ) | |
45 | + VALUES ( | |
46 | + #{projectMemberId}, | |
47 | + #{projectGroupId}, | |
48 | + #{memberId}, | |
49 | + #{isOwner}, | |
50 | + #{useAt}, | |
51 | + CURRENT_TIMESTAMP, | |
52 | + CURRENT_TIMESTAMP | |
53 | + ) | |
54 | + </insert> | |
55 | + | |
56 | + <!-- | |
57 | + 작 성 자 : 박현정 | |
58 | + 작 성 일 : 2025.07.10 | |
59 | + 내 용 : 프로젝트 참여자 존재 여부 확인 | |
60 | + --> | |
61 | + <select id="existsByProjectGroupIdAndMemberId" resultType="boolean"> | |
62 | + SELECT EXISTS ( | |
63 | + SELECT 1 | |
64 | + FROM project_member | |
65 | + WHERE project_group_id = #{projectGroupId} | |
66 | + AND member_id = #{memberId} | |
67 | + ) | |
68 | + </select> | |
69 | + | |
70 | + <!-- | |
71 | + 작 성 자 : 박현정 | |
72 | + 작 성 일 : 2025.07.15 | |
73 | + 내 용 : 프로젝트 참여자 조회 (프로젝트 그룹 아이디로 검색) | |
74 | + --> | |
75 | + <select id="findAllByGroupId" resultMap="ProjectMemberMap" parameterType="String"> | |
76 | + SELECT | |
77 | + pm.project_member_id, | |
78 | + pm.project_group_id, | |
79 | + pm.member_id, | |
80 | + m.member_name, | |
81 | + pm.is_owner, | |
82 | + pm.use_at, | |
83 | + TO_CHAR(pm.created_at, 'YYYY-MM-DD HH24:MI') AS created_at, | |
84 | + TO_CHAR(pm.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at | |
85 | + FROM project_member pm | |
86 | + JOIN member m ON pm.member_id = m.member_id | |
87 | + WHERE pm.project_group_id = #{projectGroupId} | |
88 | + AND pm.use_at = 'Y' | |
89 | + AND m.use_at = 'Y' | |
90 | + </select> | |
91 | + | |
92 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?