
+++ images/5bc961f6-bbd1-4338-b57d-9fd40ec32097_61e11946c8e2d427341c9e981d4ecd22.jpg
Binary file is not shown |
+++ images/6359c2b9-7e3e-4594-ba49-0e94a8696093_SSC_20240806100040.jpg
Binary file is not shown |
+++ images/970f2553-594c-4a70-9e0b-6e75b597871f_SSC_20240806100040.jpg
Binary file is not shown |
+++ images/e3ef9025-5933-4f29-9803-8c4d6a8e1584_SSC_20240806100040.jpg
Binary file is not shown |
+++ src/main/java/kr/co/takensoft/ai/system/chatMsg/dao/ChatMsgDAO.java
... | ... | @@ -0,0 +1,30 @@ |
1 | +package kr.co.takensoft.ai.system.chatMsg.dao; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.chatMsg.vo.ChatMsgVO; | |
4 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
5 | + | |
6 | +import java.util.Arrays; | |
7 | +import java.util.List; | |
8 | + | |
9 | +/** | |
10 | + * @author 박현정 | |
11 | + * @since 2025.07.16 | |
12 | + * @modification | |
13 | + * since | author | description | |
14 | + * 2025.07.16 | 박현정 | 최초 등록 | |
15 | + * | |
16 | + * 채팅방 메시지 관련 DAO | |
17 | + */ | |
18 | +@Mapper("chatMsgDAO") | |
19 | +public interface ChatMsgDAO { | |
20 | + | |
21 | + /** | |
22 | + * @param chatMsgVO - 메시지 정보 | |
23 | + * @return int - 메시지 등록 결과 | |
24 | + * | |
25 | + * 메시지 등록 | |
26 | + */ | |
27 | + public int saveChatMsg(ChatMsgVO chatMsgVO); | |
28 | + | |
29 | + public List<ChatMsgVO> findAllChatMsgsByChatRoomId(String chatRoomId); | |
30 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatMsg/dto/ChatMsgDTO.java
... | ... | @@ -0,0 +1,43 @@ |
1 | +package kr.co.takensoft.ai.system.chatMsg.dto; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.chatMsg.vo.ChatMsgVO; | |
4 | +import kr.co.takensoft.ai.system.common.dto.BaseParam; | |
5 | +import lombok.AllArgsConstructor; | |
6 | +import lombok.Getter; | |
7 | +import lombok.NoArgsConstructor; | |
8 | +import lombok.Setter; | |
9 | + | |
10 | +/** | |
11 | + * @author 박현정 | |
12 | + * @since 2025.07.16 | |
13 | + * @modification | |
14 | + * since | author | description | |
15 | + * 2025.07.16 | 박현정 | 최초 등록 | |
16 | + * | |
17 | + * 채팅 메시지 조회 관련 DTO | |
18 | + */ | |
19 | +@Getter | |
20 | +@Setter | |
21 | +@NoArgsConstructor | |
22 | +@AllArgsConstructor | |
23 | +public class ChatMsgDTO { | |
24 | + | |
25 | + private String chatMsgId; // 채팅 메시지 아이디 | |
26 | + private String senderId; // 메시지 작성자 아이디 | |
27 | + private String senderName; // 메시지 작성자 이름 | |
28 | + private String msgContent; // 메시지 내용 | |
29 | + private String createdAt; // 생성 일자 | |
30 | + private String updatedAt; // 수정 일자 | |
31 | + | |
32 | + public static ChatMsgDTO from(ChatMsgVO chatMsgVO) { | |
33 | + return new ChatMsgDTO( | |
34 | + chatMsgVO.getChatMsgId(), | |
35 | + chatMsgVO.getSenderId(), | |
36 | + chatMsgVO.getSenderName(), | |
37 | + chatMsgVO.getMsgContent(), | |
38 | + chatMsgVO.getCreatedAt(), | |
39 | + chatMsgVO.getUpdatedAt() | |
40 | + ); | |
41 | + } | |
42 | + | |
43 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatMsg/dto/InsertChatMsgDTO.java
... | ... | @@ -0,0 +1,25 @@ |
1 | +package kr.co.takensoft.ai.system.chatMsg.dto; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.common.dto.BaseParam; | |
4 | +import lombok.AllArgsConstructor; | |
5 | +import lombok.Getter; | |
6 | +import lombok.NoArgsConstructor; | |
7 | +import lombok.Setter; | |
8 | + | |
9 | +/** | |
10 | + * @author 박현정 | |
11 | + * @since 2025.07.16 | |
12 | + * @modification | |
13 | + * since | author | description | |
14 | + * 2025.07.16 | 박현정 | 최초 등록 | |
15 | + * | |
16 | + * 채팅 메시지 등록 관련 DTO | |
17 | + */ | |
18 | +@Getter | |
19 | +@Setter | |
20 | +@NoArgsConstructor | |
21 | +@AllArgsConstructor | |
22 | +public class InsertChatMsgDTO extends BaseParam { | |
23 | + | |
24 | + private String msgContent; // 메시지 내용 | |
25 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatMsg/service/ChatMsgService.java
... | ... | @@ -0,0 +1,39 @@ |
1 | +package kr.co.takensoft.ai.system.chatMsg.service; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.chatMsg.dto.ChatMsgDTO; | |
4 | +import kr.co.takensoft.ai.system.chatMsg.dto.InsertChatMsgDTO; | |
5 | +import kr.co.takensoft.ai.system.feedback.vo.FeedbackVO; | |
6 | +import org.springframework.transaction.annotation.Transactional; | |
7 | + | |
8 | +import java.util.List; | |
9 | + | |
10 | +/** | |
11 | + * @author 박현정 | |
12 | + * @since 2025.07.16 | |
13 | + * @modification | |
14 | + * since | author | description | |
15 | + * 2025.07.16 | 박현정 | 최초 등록 | |
16 | + * | |
17 | + * 채팅방 메시지 관련 인터페이스 | |
18 | + */ | |
19 | +public interface ChatMsgService { | |
20 | + | |
21 | + /** | |
22 | + * @param chatRoomId - 채팅방 아이디 | |
23 | + * @param senderId - 보내는 사용자 아이디 | |
24 | + * @param msgContent - 메시지 내용 | |
25 | + * @return 등록 성공 여부 | |
26 | + * | |
27 | + * 채팅방 메시지 등록 | |
28 | + */ | |
29 | + @Transactional | |
30 | + int saveChatMsg(String chatRoomId, String senderId, String msgContent); | |
31 | + | |
32 | + /** | |
33 | + * @param chatRoomId - 채팅방 아이디 | |
34 | + * @return List<ChatMsgDTO> - 채팅방 메시지 목록 | |
35 | + * | |
36 | + * 채팅방 메시지 목록 조회 | |
37 | + */ | |
38 | + List<ChatMsgDTO> findAllChatMsgs(String chatRoomId); | |
39 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatMsg/service/impl/ChatMsgServiceImpl.java
... | ... | @@ -0,0 +1,64 @@ |
1 | +package kr.co.takensoft.ai.system.chatMsg.service.impl; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.chatMsg.dao.ChatMsgDAO; | |
4 | +import kr.co.takensoft.ai.system.chatMsg.dto.ChatMsgDTO; | |
5 | +import kr.co.takensoft.ai.system.chatMsg.dto.InsertChatMsgDTO; | |
6 | +import kr.co.takensoft.ai.system.chatMsg.service.ChatMsgService; | |
7 | +import kr.co.takensoft.ai.system.chatMsg.vo.ChatMsgVO; | |
8 | +import kr.co.takensoft.ai.system.chatRoom.vo.ChatRoomVO; | |
9 | +import kr.co.takensoft.ai.system.common.idgen.service.IdgenService; | |
10 | +import kr.co.takensoft.ai.system.projectMember.service.ProjectMemberService; | |
11 | +import lombok.RequiredArgsConstructor; | |
12 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
13 | +import org.springframework.stereotype.Service; | |
14 | +import org.springframework.transaction.annotation.Transactional; | |
15 | + | |
16 | +import java.util.List; | |
17 | +import java.util.stream.Collectors; | |
18 | + | |
19 | +/** | |
20 | + * @author : 박현정 | |
21 | + * @since : 2025.07.16 | |
22 | + * @modification | |
23 | + * since | author | description | |
24 | + * 2025.07.16 | 박현정 | 최초 등록 | |
25 | + * | |
26 | + * 채팅방 메시지 관련 서비스 | |
27 | + */ | |
28 | +@Service("chatMsgService") | |
29 | +@RequiredArgsConstructor | |
30 | +public class ChatMsgServiceImpl extends EgovAbstractServiceImpl implements ChatMsgService { | |
31 | + | |
32 | + private final IdgenService chatMsgIdgn; | |
33 | + private final ChatMsgDAO chatMsgDAO; | |
34 | + | |
35 | + /** | |
36 | + * @param chatRoomId - 채팅방 아이디 | |
37 | + * @param senderId - 보내는 사용자 아이디 | |
38 | + * @param msgContent - 메시지 내용 | |
39 | + * @return 등록 성공 여부 | |
40 | + * | |
41 | + * 채팅방 메시지 등록 | |
42 | + */ | |
43 | + @Override | |
44 | + @Transactional | |
45 | + public int saveChatMsg(String chatRoomId, String senderId, String msgContent) { | |
46 | + | |
47 | + try { | |
48 | + | |
49 | + String chatMsgId = chatMsgIdgn.getNextStringId(); // 채팅 메시지 구분 아이디 생성 | |
50 | + ChatMsgVO chatMsgVO = new ChatMsgVO(chatMsgId, chatRoomId, senderId, msgContent); // 채팅 메시지 객체 생성 | |
51 | + return chatMsgDAO.saveChatMsg(chatMsgVO); // 채팅 메시지 등록 | |
52 | + } catch (Exception e) { | |
53 | + e.printStackTrace(); | |
54 | + return -1; | |
55 | + } | |
56 | + } | |
57 | + | |
58 | + @Override | |
59 | + public List<ChatMsgDTO> findAllChatMsgs(String chatRoomId) { | |
60 | + List<ChatMsgDTO> chatMsgDTOS = chatMsgDAO.findAllChatMsgsByChatRoomId(chatRoomId) | |
61 | + .stream().map(ChatMsgDTO::from).collect(Collectors.toList()); // 채팅 메시지 목록 가져오기 | |
62 | + return chatMsgDTOS; | |
63 | + } | |
64 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatMsg/vo/ChatMsgVO.java
... | ... | @@ -0,0 +1,37 @@ |
1 | +package kr.co.takensoft.ai.system.chatMsg.vo; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | + | |
6 | +/** | |
7 | + * @author 박현정 | |
8 | + * @since 2025.07.16 | |
9 | + * @modification | |
10 | + * since | author | description | |
11 | + * 2025.07.16 | 박현정 | 최초 등록 | |
12 | + * | |
13 | + * | |
14 | + * 채팅 메시지 관련 VO | |
15 | + */ | |
16 | +@Getter | |
17 | +@NoArgsConstructor | |
18 | +public class ChatMsgVO { | |
19 | + | |
20 | + private String chatMsgId; // 채팅 메시지 아이디 | |
21 | + private String chatRoomId; // 채팅방 아이디 | |
22 | + private String senderId; // 메시지 작성자 아이디 | |
23 | + private String senderName; // 메시지 작성자 이름 | |
24 | + private String msgContent; // 메시지 내용 | |
25 | + private String useAt; // 사용 여부 (N : 사용 안함, Y : 사용) | |
26 | + private String createdAt; // 생성 일자 | |
27 | + private String updatedAt; // 수정 일자 | |
28 | + | |
29 | + // 채팅 메시지 생성용 생성자 | |
30 | + public ChatMsgVO(String chatMsgId, String chatRoomId, String senderId, String msgContent) { | |
31 | + this.chatMsgId = chatMsgId; | |
32 | + this.chatRoomId = chatRoomId; | |
33 | + this.senderId = senderId; | |
34 | + this.msgContent = msgContent; | |
35 | + this.useAt = "Y"; | |
36 | + } | |
37 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatRoom/dao/ChatRoomDAO.java
... | ... | @@ -0,0 +1,35 @@ |
1 | +package kr.co.takensoft.ai.system.chatRoom.dao; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.chatRoom.vo.ChatRoomVO; | |
4 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
5 | + | |
6 | +import java.util.Optional; | |
7 | + | |
8 | +/** | |
9 | + * @author 박현정 | |
10 | + * @since 2025.07.16 | |
11 | + * @modification | |
12 | + * since | author | description | |
13 | + * 2025.07.16 | 박현정 | 최초 등록 | |
14 | + * | |
15 | + * 피드백 채팅방 관련 DAO | |
16 | + */ | |
17 | +@Mapper("chatRoomDAO") | |
18 | +public interface ChatRoomDAO { | |
19 | + | |
20 | + /** | |
21 | + * @param chatRoomVO - 채팅방 정보 | |
22 | + * @return int - 채팅방 등록 결과 | |
23 | + * | |
24 | + * 채팅방 등록 | |
25 | + */ | |
26 | + int saveChatRoom(ChatRoomVO chatRoomVO); | |
27 | + | |
28 | + /** | |
29 | + * @param chatRoomId - 채팅방 아이디 | |
30 | + * @return ChatRoomVO - 채팅방 정보 조회 | |
31 | + * | |
32 | + * 채팅방 정보 조회 | |
33 | + */ | |
34 | + Optional<ChatRoomVO> findById(String chatRoomId); | |
35 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatRoom/service/ChatRoomService.java
... | ... | @@ -0,0 +1,49 @@ |
1 | +package kr.co.takensoft.ai.system.chatRoom.service; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.chatMsg.dto.ChatMsgDTO; | |
4 | +import kr.co.takensoft.ai.system.chatMsg.dto.InsertChatMsgDTO; | |
5 | +import kr.co.takensoft.ai.system.common.dto.BaseParam; | |
6 | +import kr.co.takensoft.ai.system.feedback.vo.FeedbackVO; | |
7 | +import org.springframework.transaction.annotation.Transactional; | |
8 | + | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * @author 박현정 | |
13 | + * @since 2025.07.16 | |
14 | + * @modification | |
15 | + * since | author | description | |
16 | + * 2025.07.16 | 박현정 | 최초 등록 | |
17 | + * | |
18 | + * 피드백 채팅방 관련 인터페이스 | |
19 | + */ | |
20 | +public interface ChatRoomService { | |
21 | + | |
22 | + /** | |
23 | + * @param feedbackVO - 피드백 정보를 담은 VO 객체 | |
24 | + * @return 등록 성공 여부 | |
25 | + * | |
26 | + * 채팅방 등록 | |
27 | + */ | |
28 | + @Transactional | |
29 | + int saveChatRoom(FeedbackVO feedbackVO); | |
30 | + | |
31 | + /** | |
32 | + * @param chatRoomId - 채팅방 아이디 | |
33 | + * @param request - 메시지 관련 내용을 담은 DTO 객체 | |
34 | + * @return 등록 성공 여부 | |
35 | + * | |
36 | + * 채팅방 메시지 등록 | |
37 | + */ | |
38 | + @Transactional | |
39 | + int saveChatMsg(String chatRoomId, InsertChatMsgDTO request); | |
40 | + | |
41 | + /** | |
42 | + * @param chatRoomId - 채팅방 아이디 | |
43 | + * @param request - 사용자 아이디를 담은 DTO 객체 | |
44 | + * @return List<ChatMsgDTO> - 채팅방 메시지 목록을 담은 DTO 객체 리스트 | |
45 | + * | |
46 | + * 채팅방 메시지 목록 조회 | |
47 | + */ | |
48 | + List<ChatMsgDTO> findAllChatMsgs(String chatRoomId, BaseParam request); | |
49 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatRoom/service/impl/ChatRoomServiceImpl.java
... | ... | @@ -0,0 +1,93 @@ |
1 | +package kr.co.takensoft.ai.system.chatRoom.service.impl; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.chatMsg.dto.ChatMsgDTO; | |
4 | +import kr.co.takensoft.ai.system.chatMsg.dto.InsertChatMsgDTO; | |
5 | +import kr.co.takensoft.ai.system.chatMsg.service.ChatMsgService; | |
6 | +import kr.co.takensoft.ai.system.chatMsg.vo.ChatMsgVO; | |
7 | +import kr.co.takensoft.ai.system.chatRoom.dao.ChatRoomDAO; | |
8 | +import kr.co.takensoft.ai.system.chatRoom.service.ChatRoomService; | |
9 | +import kr.co.takensoft.ai.system.chatRoom.vo.ChatRoomVO; | |
10 | +import kr.co.takensoft.ai.system.common.dto.BaseParam; | |
11 | +import kr.co.takensoft.ai.system.common.idgen.service.IdgenService; | |
12 | +import kr.co.takensoft.ai.system.feedback.vo.FeedbackVO; | |
13 | +import kr.co.takensoft.ai.system.projectMember.service.ProjectMemberService; | |
14 | +import lombok.RequiredArgsConstructor; | |
15 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
16 | +import org.springframework.stereotype.Service; | |
17 | +import org.springframework.transaction.annotation.Transactional; | |
18 | + | |
19 | +import java.util.List; | |
20 | + | |
21 | +/** | |
22 | + * @author : 박현정 | |
23 | + * @since : 2025.07.16 | |
24 | + * @modification | |
25 | + * since | author | description | |
26 | + * 2025.07.16 | 박현정 | 최초 등록 | |
27 | + * | |
28 | + * 피드백 채팅방 관련 서비스 | |
29 | + */ | |
30 | +@Service("chatRoomService") | |
31 | +@RequiredArgsConstructor | |
32 | +public class ChatRoomServiceImpl extends EgovAbstractServiceImpl implements ChatRoomService { | |
33 | + | |
34 | + private final IdgenService chatRoomIdgn; | |
35 | + private final ChatRoomDAO chatRoomDAO; | |
36 | + private final ChatMsgService chatMsgService; | |
37 | + private final ProjectMemberService projectMemberService; | |
38 | + | |
39 | + /** | |
40 | + * @param feedbackVO - 피드백 정보를 담은 VO 객체 | |
41 | + * @return 등록 성공 여부 | |
42 | + * | |
43 | + * 채팅방 등록 | |
44 | + */ | |
45 | + @Override | |
46 | + @Transactional | |
47 | + public int saveChatRoom(FeedbackVO feedbackVO) { | |
48 | + try { | |
49 | + String chatRoomId = chatRoomIdgn.getNextStringId(); // 채팅방 구별 아이디 생성 | |
50 | + ChatRoomVO chatRoomVO = new ChatRoomVO(chatRoomId, feedbackVO.getProjectGroupId(), feedbackVO.getFeedbackId()); // 채팅방 정보 등록 | |
51 | + chatMsgService.saveChatMsg(chatRoomId, feedbackVO.getMemberId(), feedbackVO.getFeedbackContent()); // 채팅 메시지 저장 | |
52 | + return chatRoomDAO.saveChatRoom(chatRoomVO); // 채팅방 저장 | |
53 | + } catch (Exception e) { | |
54 | + e.printStackTrace(); | |
55 | + return -1; | |
56 | + } | |
57 | + } | |
58 | + | |
59 | + /** | |
60 | + * @param chatRoomId - 채팅방 아이디 | |
61 | + * @param request - 메시지 관련 내용을 담은 DTO 객체 | |
62 | + * @return 등록 성공 여부 | |
63 | + * | |
64 | + * 채팅방 메시지 등록 | |
65 | + */ | |
66 | + @Override | |
67 | + @Transactional | |
68 | + public int saveChatMsg(String chatRoomId, InsertChatMsgDTO request) { | |
69 | + return chatMsgService.saveChatMsg(chatRoomId, request.getMemberId(), request.getMsgContent()); // 채팅 메시지 등록 | |
70 | + } | |
71 | + | |
72 | + /** | |
73 | + * @param chatRoomId - 채팅방 아이디 | |
74 | + * @param request - 사용자 아이디를 담은 DTO 객체 | |
75 | + * @return List<ChatMsgDTO> - 채팅방 메시지 목록을 담은 DTO 객체 리스트 | |
76 | + * | |
77 | + * 채팅방 메시지 목록 조회 | |
78 | + */ | |
79 | + @Override | |
80 | + public List<ChatMsgDTO> findAllChatMsgs(String chatRoomId, BaseParam request) { | |
81 | + try { | |
82 | + String memberId = request.getMemberId(); // 사용자 아이디 꺼내기 | |
83 | + ChatRoomVO chatRoomVO = chatRoomDAO.findById(chatRoomId) | |
84 | + .orElseThrow(() -> new IllegalArgumentException("채팅방이 존재하지 않습니다.")); | |
85 | + projectMemberService.validateProjectMember(chatRoomVO.getProjectGroupId(), memberId); | |
86 | + List<ChatMsgDTO> chatMsgDTOS = chatMsgService.findAllChatMsgs(chatRoomId); | |
87 | + return chatMsgDTOS; | |
88 | + } catch (Exception e) { | |
89 | + e.printStackTrace(); | |
90 | + throw e; | |
91 | + } | |
92 | + } | |
93 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatRoom/vo/ChatRoomVO.java
... | ... | @@ -0,0 +1,35 @@ |
1 | +package kr.co.takensoft.ai.system.chatRoom.vo; | |
2 | + | |
3 | +import lombok.Getter; | |
4 | +import lombok.NoArgsConstructor; | |
5 | + | |
6 | +/** | |
7 | + * @author 박현정 | |
8 | + * @since 2025.07.16 | |
9 | + * @modification | |
10 | + * since | author | description | |
11 | + * 2025.07.16 | 박현정 | 최초 등록 | |
12 | + * | |
13 | + * | |
14 | + * 피드백 채팅방 관련 VO | |
15 | + */ | |
16 | +@Getter | |
17 | +@NoArgsConstructor | |
18 | +public class ChatRoomVO { | |
19 | + | |
20 | + private String chatRoomId; // 피드백 채팅방 아이디 | |
21 | + private String projectGroupId; // 프로젝트 그룹 아이디 | |
22 | + private String feedbackId; // 피드백 아이디 (피드백 채팅방을 개설한 피드백) | |
23 | + private String useAt; // 사용 여부 (N : 사용 안함, Y : 사용) | |
24 | + private String createdAt; // 생성일자 | |
25 | + private String updatedAt; // 수정일자 | |
26 | + | |
27 | + // 피드백 채팅 생성용 생성자 | |
28 | + public ChatRoomVO(String chatRoomId, String projectGroupId, String feedbackId) { | |
29 | + | |
30 | + this.chatRoomId = chatRoomId; | |
31 | + this.projectGroupId = projectGroupId; | |
32 | + this.feedbackId = feedbackId; | |
33 | + this.useAt = "Y"; | |
34 | + } | |
35 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/chatRoom/web/ChatRoomController.java
... | ... | @@ -0,0 +1,58 @@ |
1 | +package kr.co.takensoft.ai.system.chatRoom.web; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.chatMsg.dto.InsertChatMsgDTO; | |
4 | +import kr.co.takensoft.ai.system.chatMsg.service.ChatMsgService; | |
5 | +import kr.co.takensoft.ai.system.chatRoom.service.ChatRoomService; | |
6 | +import kr.co.takensoft.ai.system.common.dto.BaseParam; | |
7 | +import kr.co.takensoft.ai.system.feedback.dto.InsertFeedbackDTO; | |
8 | +import lombok.RequiredArgsConstructor; | |
9 | +import org.springframework.http.HttpStatus; | |
10 | +import org.springframework.http.ResponseEntity; | |
11 | +import org.springframework.web.bind.annotation.*; | |
12 | + | |
13 | +import java.util.HashMap; | |
14 | + | |
15 | +/** | |
16 | + * @author : 박현정 | |
17 | + * @since : 2025.07.16 | |
18 | + * @modification | |
19 | + * since | author | description | |
20 | + * 2025.07.16 | 박현정 | 최초 등록 | |
21 | + * | |
22 | + * 채팅방 관련 Controller | |
23 | + */ | |
24 | +@RestController | |
25 | +@RequiredArgsConstructor | |
26 | +@RequestMapping(value = "/api/chat") | |
27 | +public class ChatRoomController { | |
28 | + | |
29 | + private final ChatRoomService chatRoomService; | |
30 | + | |
31 | + /** | |
32 | + * @param chatRoomId - 채팅방 아이디 | |
33 | + * @param request - 생성할 채팅 메시지 정보 | |
34 | + * @return ResponseEntity - 메시지 등록 결과를 포함하는 응답 | |
35 | + * | |
36 | + * 채팅 메시지 등록 | |
37 | + */ | |
38 | + @PostMapping("/{chatRoomId}/saveChatMsg.json") | |
39 | + public ResponseEntity<?> saveChatMsg(@PathVariable String chatRoomId, @RequestBody InsertChatMsgDTO request) { | |
40 | + HashMap<String, Object> result = new HashMap<>(); | |
41 | + result.put("result", chatRoomService.saveChatMsg(chatRoomId, request)); | |
42 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
43 | + } | |
44 | + | |
45 | + /** | |
46 | + * @param chatRoomId - 채팅방 아이디 | |
47 | + * @param request - 사용자 아이디를 담은 DTO 객체 | |
48 | + * @return ResponseEntity - 메시지 목록 조회 결과를 포함하는 응답 | |
49 | + * | |
50 | + * 채팅 메시지 목록 조회 | |
51 | + */ | |
52 | + @PostMapping("/{chatRoomId}/findAllChatMsgs.json") | |
53 | + public ResponseEntity<?> findAllChatMsgs(@PathVariable String chatRoomId, @RequestBody BaseParam request) { | |
54 | + HashMap<String, Object> result = new HashMap<>(); | |
55 | + result.put("result", chatRoomService.findAllChatMsgs(chatRoomId, request)); | |
56 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
57 | + } | |
58 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/common/dto/BaseParam.java
... | ... | @@ -0,0 +1,26 @@ |
1 | +package kr.co.takensoft.ai.system.common.dto; | |
2 | + | |
3 | +import jakarta.validation.constraints.NotBlank; | |
4 | +import lombok.AllArgsConstructor; | |
5 | +import lombok.Getter; | |
6 | +import lombok.NoArgsConstructor; | |
7 | +import lombok.Setter; | |
8 | + | |
9 | +/** | |
10 | + * @author 박현정 | |
11 | + * @since 2025.07.17 | |
12 | + * @modification | |
13 | + * since | author | description | |
14 | + * 2025.07.17 | 박현정 | 최초 등록 | |
15 | + * | |
16 | + * memberId 요청 관련 DTO | |
17 | + */ | |
18 | +@Getter | |
19 | +@Setter | |
20 | +@NoArgsConstructor | |
21 | +@AllArgsConstructor | |
22 | +public class BaseParam { | |
23 | + | |
24 | + @NotBlank | |
25 | + private String memberId; // 사용자 아이디 | |
26 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/feedback/dao/FeedbackDAO.java
... | ... | @@ -0,0 +1,54 @@ |
1 | +package kr.co.takensoft.ai.system.feedback.dao; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.feedback.dto.FeedbackDTO; | |
4 | +import kr.co.takensoft.ai.system.feedback.vo.FeedbackVO; | |
5 | +import kr.co.takensoft.ai.system.project.vo.ProjectVO; | |
6 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
7 | + | |
8 | +import java.util.List; | |
9 | +import java.util.Optional; | |
10 | + | |
11 | +/** | |
12 | + * @author 박현정 | |
13 | + * @since 2025.07.10 | |
14 | + * @modification | |
15 | + * since | author | description | |
16 | + * 2025.07.10 | 박현정 | 최초 등록 | |
17 | + * | |
18 | + * 피드백 관련 DAO | |
19 | + */ | |
20 | +@Mapper("feedbackDAO") | |
21 | +public interface FeedbackDAO { | |
22 | + | |
23 | + /** | |
24 | + * @param feedbackId - 피드백 아이디 | |
25 | + * @return FeedbackVO - 피드백 정보 | |
26 | + * | |
27 | + * 피드백 정보 조회 | |
28 | + */ | |
29 | + Optional<FeedbackVO> findById(String feedbackId); | |
30 | + | |
31 | + /** | |
32 | + * @param feedbackVO - 피드백 정보 | |
33 | + * @return int - 피드백 등록 결과 | |
34 | + * | |
35 | + * 피드백 등록 | |
36 | + */ | |
37 | + int saveFeedback(FeedbackVO feedbackVO); | |
38 | + | |
39 | + /** | |
40 | + * @param feedbackId - 피드백 아이디 | |
41 | + * @return int - 피드백 확인 결과 (isChecked = 'Y') | |
42 | + * | |
43 | + * 피드백 확인 (isChecked = 'Y') | |
44 | + */ | |
45 | + int setFeedbackCheck(String feedbackId); | |
46 | + | |
47 | + /** | |
48 | + * @param memberId - 사용자 아이디 | |
49 | + * @return List<FeedbackDTO> - 피드백 목록 조회 결과 | |
50 | + * | |
51 | + * 피드백 목록 조회(사용자가 참여하는 모든 프로젝트를 대상으로 함) | |
52 | + */ | |
53 | + List<FeedbackDTO> findAllByMemberId(String memberId); | |
54 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/feedback/dto/FeedbackDTO.java
... | ... | @@ -0,0 +1,32 @@ |
1 | +package kr.co.takensoft.ai.system.feedback.dto; | |
2 | + | |
3 | +import lombok.AllArgsConstructor; | |
4 | +import lombok.Getter; | |
5 | +import lombok.NoArgsConstructor; | |
6 | +import lombok.Setter; | |
7 | + | |
8 | +/** | |
9 | + * @author 박현정 | |
10 | + * @since 2025.07.16 | |
11 | + * @modification | |
12 | + * since | author | description | |
13 | + * 2025.07.16 | 박현정 | 최초 등록 | |
14 | + * | |
15 | + * 피드백 조회 관련 DTO | |
16 | + */ | |
17 | +@Getter | |
18 | +@Setter | |
19 | +@NoArgsConstructor | |
20 | +@AllArgsConstructor | |
21 | +public class FeedbackDTO { | |
22 | + | |
23 | + private String projectGroupId; // 프로젝트 그룹 아이디 | |
24 | + private String projectName; // 프로젝트 이름 | |
25 | + private String chatRoomId; // 채팅방 아이디 | |
26 | + private String memberId; // 피드백 작성자 아이디 | |
27 | + private String memberName; // 피드백 작성자 이름 | |
28 | + private String feedbackContent; // 피드백 내용 | |
29 | + private String isChecked; // 피드백 확인 여부 | |
30 | + private String createdAt; // 생성 일자 | |
31 | + private String updatedAt; // 수정 일자 | |
32 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/feedback/dto/InsertFeedbackDTO.java
... | ... | @@ -0,0 +1,23 @@ |
1 | +package kr.co.takensoft.ai.system.feedback.dto; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.common.dto.BaseParam; | |
4 | +import lombok.Getter; | |
5 | +import lombok.NoArgsConstructor; | |
6 | +import lombok.Setter; | |
7 | + | |
8 | +/** | |
9 | + * @author 박현정 | |
10 | + * @since 2025.07.16 | |
11 | + * @modification | |
12 | + * since | author | description | |
13 | + * 2025.07.16 | 박현정 | 최초 등록 | |
14 | + * | |
15 | + * 피드백 등록 관련 DTO | |
16 | + */ | |
17 | +@Getter | |
18 | +@Setter | |
19 | +@NoArgsConstructor | |
20 | +public class InsertFeedbackDTO extends BaseParam { | |
21 | + | |
22 | + private String feedbackContent; // 피드백 내용 | |
23 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/feedback/service/FeedbackService.java
... | ... | @@ -0,0 +1,48 @@ |
1 | +package kr.co.takensoft.ai.system.feedback.service; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.common.dto.BaseParam; | |
4 | +import kr.co.takensoft.ai.system.feedback.dto.FeedbackDTO; | |
5 | +import kr.co.takensoft.ai.system.feedback.dto.InsertFeedbackDTO; | |
6 | +import org.springframework.transaction.annotation.Transactional; | |
7 | + | |
8 | +import java.util.List; | |
9 | + | |
10 | +/** | |
11 | + * @author 박현정 | |
12 | + * @since 2025.07.16 | |
13 | + * @modification | |
14 | + * since | author | description | |
15 | + * 2025.07.16 | 박현정 | 최초 등록 | |
16 | + * | |
17 | + * 피드백 관련 인터페이스 | |
18 | + */ | |
19 | +public interface FeedbackService { | |
20 | + | |
21 | + /** | |
22 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
23 | + * @param request - 생성할 피드백 정보 | |
24 | + * @return 등록 성공 여부 | |
25 | + * | |
26 | + * 피드백 등록 | |
27 | + */ | |
28 | + @Transactional | |
29 | + int saveFeedback(String projectGroupId, InsertFeedbackDTO request); | |
30 | + | |
31 | + /** | |
32 | + * @param feedbackId - 피드백 아이디 | |
33 | + * @param request - 사용자 아이디를 담은 DTO 객체 | |
34 | + * @return 피드백 확인 성공 여부 (isChecked = 'Y') | |
35 | + * | |
36 | + * 피드백 확인(프로젝트 대표자만 가능) | |
37 | + */ | |
38 | + @Transactional | |
39 | + int checkFeedback(String feedbackId, BaseParam request); | |
40 | + | |
41 | + /** | |
42 | + * @param request - 사용자 아이디를 담은 DTO 객체 | |
43 | + * @return List<FeedbackDTO> - 피드백 정보를 담은 DTO 객체 리스트 | |
44 | + * | |
45 | + * 피드백 목록 조회(사용자가 참여하는 모든 프로젝트를 대상으로 함) | |
46 | + */ | |
47 | + List<FeedbackDTO> findAllFeedbacks(BaseParam request); | |
48 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/feedback/service/impl/FeedbackServiceImpl.java
... | ... | @@ -0,0 +1,102 @@ |
1 | +package kr.co.takensoft.ai.system.feedback.service.impl; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.chatRoom.service.ChatRoomService; | |
4 | +import kr.co.takensoft.ai.system.common.dto.BaseParam; | |
5 | +import kr.co.takensoft.ai.system.common.idgen.service.IdgenService; | |
6 | +import kr.co.takensoft.ai.system.feedback.dao.FeedbackDAO; | |
7 | +import kr.co.takensoft.ai.system.feedback.dto.FeedbackDTO; | |
8 | +import kr.co.takensoft.ai.system.feedback.dto.InsertFeedbackDTO; | |
9 | +import kr.co.takensoft.ai.system.feedback.service.FeedbackService; | |
10 | +import kr.co.takensoft.ai.system.feedback.vo.FeedbackVO; | |
11 | +import kr.co.takensoft.ai.system.projectMember.service.ProjectMemberService; | |
12 | +import lombok.RequiredArgsConstructor; | |
13 | +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; | |
14 | +import org.springframework.stereotype.Service; | |
15 | +import org.springframework.transaction.annotation.Transactional; | |
16 | + | |
17 | +import java.util.List; | |
18 | + | |
19 | +/** | |
20 | + * @author : 박현정 | |
21 | + * @since : 2025.07.16 | |
22 | + * @modification | |
23 | + * since | author | description | |
24 | + * 2025.07.16 | 박현정 | 최초 등록 | |
25 | + * | |
26 | + * 피드백 관련 서비스 | |
27 | + */ | |
28 | +@Service("feedbackService") | |
29 | +@RequiredArgsConstructor | |
30 | +public class FeedbackServiceImpl extends EgovAbstractServiceImpl implements FeedbackService { | |
31 | + | |
32 | + private final FeedbackDAO feedbackDAO; | |
33 | + private final IdgenService feedbackIdgn; | |
34 | + private final ProjectMemberService projectMemberService; | |
35 | + private final ChatRoomService chatRoomService; | |
36 | + | |
37 | + /** | |
38 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
39 | + * @param request - 생성할 피드백 정보 | |
40 | + * @return 등록 성공 여부 | |
41 | + * | |
42 | + * 피드백 등록 | |
43 | + */ | |
44 | + @Override | |
45 | + @Transactional | |
46 | + public int saveFeedback(String projectGroupId, InsertFeedbackDTO request) { | |
47 | + | |
48 | + try { | |
49 | + String memberId = request.getMemberId(); // 사용자 아이디 가져오기 | |
50 | + projectMemberService.validateProjectMember(projectGroupId, memberId); // 프로젝트 참여자 존재 여부 검증 | |
51 | + | |
52 | + String feedbackId = feedbackIdgn.getNextStringId(); // 피드백 구분 아이디 생성 | |
53 | + FeedbackVO feedbackVO = new FeedbackVO(feedbackId, projectGroupId, memberId, request.getFeedbackContent()); // 피드백 정보 등록 | |
54 | + chatRoomService.saveChatRoom(feedbackVO); // 피드백 채팅방 등록 | |
55 | + return feedbackDAO.saveFeedback(feedbackVO); // 피드백 저장 | |
56 | + } catch (Exception e) { | |
57 | + e.printStackTrace(); | |
58 | + return -1; | |
59 | + } | |
60 | + } | |
61 | + | |
62 | + /** | |
63 | + * @param feedbackId - 피드백 아이디 | |
64 | + * @param request - 사용자 아이디를 담은 DTO 객체 | |
65 | + * @return 피드백 확인 성공 여부 (isChecked = 'Y') | |
66 | + * | |
67 | + * 피드백 확인(프로젝트 대표자만 가능) | |
68 | + */ | |
69 | + @Override | |
70 | + @Transactional | |
71 | + public int checkFeedback(String feedbackId, BaseParam request) { | |
72 | + | |
73 | + try { | |
74 | + String memberId = request.getMemberId(); // 사용자 아이디 가져오기 | |
75 | + FeedbackVO feedbackVO = feedbackDAO.findById(feedbackId) | |
76 | + .orElseThrow(() -> new IllegalArgumentException("피드백이 존재하지 않습니다.")); | |
77 | + projectMemberService.validateProjectOwner(feedbackVO.getProjectGroupId(), memberId); // 프로젝트 대표자인지 검증 | |
78 | + return feedbackDAO.setFeedbackCheck(feedbackVO.getFeedbackId()); // 피드백 확인 | |
79 | + } catch (Exception e) { | |
80 | + e.printStackTrace(); | |
81 | + return -1; | |
82 | + } | |
83 | + } | |
84 | + | |
85 | + /** | |
86 | + * @param baseParam - 사용자 아이디를 담은 DTO 객체 | |
87 | + * @return List<FeedbackDTO> - 피드백 정보를 담은 DTO 객체 리스트 | |
88 | + * | |
89 | + * 피드백 목록 조회(사용자가 참여하는 모든 프로젝트를 대상으로 함) | |
90 | + */ | |
91 | + @Override | |
92 | + public List<FeedbackDTO> findAllFeedbacks(BaseParam baseParam) { | |
93 | + | |
94 | + try { | |
95 | + String memberId = baseParam.getMemberId(); // 사용자 아이디 가져오기 | |
96 | + return feedbackDAO.findAllByMemberId(memberId); // 피드백 목록 조회 | |
97 | + } catch (Exception e) { | |
98 | + e.printStackTrace(); | |
99 | + throw e; | |
100 | + } | |
101 | + } | |
102 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/feedback/vo/FeedbackVO.java
... | ... | @@ -0,0 +1,41 @@ |
1 | +package kr.co.takensoft.ai.system.feedback.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 FeedbackVO { | |
19 | + | |
20 | + private String feedbackId; // 피드백 아이디 | |
21 | + private String projectGroupId; // 프로젝트 그룹 아이디 | |
22 | + private String projectName; // 프로젝트 이름 | |
23 | + private String memberId; // 피드백을 작성한 사용자 아이디 | |
24 | + private String memberName; // 피드백 작성자 이름 | |
25 | + private String chatRoomId; // 채팅방 아이디 | |
26 | + private String feedbackContent; // 피드백 내용 | |
27 | + private String isChecked; // 피드백 확인 여부 ( N: 확인 안함, Y: 확인함) | |
28 | + private String useAt; // 사용 여부 (N : 사용 안함, Y : 사용) | |
29 | + private String createdAt; // 생성일자 | |
30 | + private String updatedAt; // 수정일자 | |
31 | + | |
32 | + // 피드백 생성용 생성자 | |
33 | + public FeedbackVO(String feedbackId, String projectGroupId, String memberId, String feedbackContent) { | |
34 | + this.feedbackId = feedbackId; | |
35 | + this.projectGroupId = projectGroupId; | |
36 | + this.memberId = memberId; | |
37 | + this.feedbackContent = feedbackContent; | |
38 | + this.isChecked = "N"; | |
39 | + this.useAt = "Y"; | |
40 | + } | |
41 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/feedback/web/FeedbackController.java
... | ... | @@ -0,0 +1,71 @@ |
1 | +package kr.co.takensoft.ai.system.feedback.web; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.common.dto.BaseParam; | |
4 | +import kr.co.takensoft.ai.system.feedback.dto.InsertFeedbackDTO; | |
5 | +import kr.co.takensoft.ai.system.feedback.service.FeedbackService; | |
6 | +import kr.co.takensoft.ai.system.project.dto.InsertProjectDTO; | |
7 | +import lombok.RequiredArgsConstructor; | |
8 | +import org.springframework.http.HttpStatus; | |
9 | +import org.springframework.http.ResponseEntity; | |
10 | +import org.springframework.web.bind.annotation.*; | |
11 | + | |
12 | +import java.util.HashMap; | |
13 | + | |
14 | +/** | |
15 | + * @author : 박현정 | |
16 | + * @since : 2025.07.16 | |
17 | + * @modification | |
18 | + * since | author | description | |
19 | + * 2025.07.16 | 박현정 | 최초 등록 | |
20 | + * | |
21 | + * 피드백 관련 Controller | |
22 | + */ | |
23 | +@RestController | |
24 | +@RequiredArgsConstructor | |
25 | +@RequestMapping(value = "/api") | |
26 | +public class FeedbackController { | |
27 | + | |
28 | + private final FeedbackService feedbackService; | |
29 | + | |
30 | + /** | |
31 | + * @param projectGroupId - 프로젝트 그룹 아이디 | |
32 | + * @param request - 생성할 피드백 정보 | |
33 | + * @return ResponseEntity - 피드백 등록 결과를 포함하는 응답 | |
34 | + * | |
35 | + * 피드백 등록 | |
36 | + */ | |
37 | + @PostMapping("/project/{projectGroupId}/feedback/saveFeedback.json") | |
38 | + public ResponseEntity<?> saveFeedback(@PathVariable String projectGroupId, @RequestBody InsertFeedbackDTO request) { | |
39 | + HashMap<String, Object> result = new HashMap<>(); | |
40 | + result.put("result", feedbackService.saveFeedback(projectGroupId, request)); | |
41 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
42 | + } | |
43 | + | |
44 | + /** | |
45 | + * @param feedbackId - 피드백 아이디 | |
46 | + * @param request - 사용자 아이디를 담은 DTO 객체 | |
47 | + * @return ResponseEntity - 피드백 확인 결과를 포함하는 응답 | |
48 | + * | |
49 | + * 피드백 확인 | |
50 | + */ | |
51 | + @PostMapping("/feedback/{feedbackId}/checkFeedback.json") | |
52 | + public ResponseEntity<?> checkFeedback(@PathVariable String feedbackId, @RequestBody BaseParam request) { | |
53 | + HashMap<String, Object> result = new HashMap<>(); | |
54 | + result.put("result", feedbackService.checkFeedback(feedbackId, request)); | |
55 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
56 | + } | |
57 | + | |
58 | + /** | |
59 | + * @param request - 사용자 아이디를 담은 DTO 객체 | |
60 | + * @return ResponseEntity - 피드백 목록 조회 결과를 포함하는 응답 | |
61 | + * | |
62 | + * 피드백 목록 조회 | |
63 | + */ | |
64 | + @PostMapping("/feedback/findAllFeedbacks.json") | |
65 | + public ResponseEntity<?> findAllFeedbacks(@RequestBody BaseParam request) { | |
66 | + HashMap<String, Object> result = new HashMap<>(); | |
67 | + result.put("result", feedbackService.findAllFeedbacks(request)); | |
68 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
69 | + } | |
70 | + | |
71 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectLog/dao/ProjectLogDAO.java
... | ... | @@ -0,0 +1,26 @@ |
1 | +package kr.co.takensoft.ai.system.projectLog.dao; | |
2 | + | |
3 | +import kr.co.takensoft.ai.system.projectComment.vo.ProjectCommentVO; | |
4 | +import kr.co.takensoft.ai.system.projectLog.vo.ProjectLogVO; | |
5 | +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; | |
6 | + | |
7 | +/** | |
8 | + * @author 박현정 | |
9 | + * @since 2025.07.10 | |
10 | + * @modification | |
11 | + * since | author | description | |
12 | + * 2025.07.10 | 박현정 | 최초 등록 | |
13 | + * | |
14 | + * 프로젝트 활동 로그 관련 DAO | |
15 | + */ | |
16 | +@Mapper("projectLogDAO") | |
17 | +public interface ProjectLogDAO { | |
18 | + | |
19 | + /** | |
20 | + * @param projectLogVO - 프로젝트 활동 로그 정보 | |
21 | + * @return int - 프로젝트 활동 로그 등록 결과 | |
22 | + * | |
23 | + * 프로젝트 활동 로그 등록 | |
24 | + */ | |
25 | + int saveProjectLog(ProjectLogVO projectLogVO); | |
26 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectLog/service/ProjectLogService.java
... | ... | @@ -0,0 +1,4 @@ |
1 | +package kr.co.takensoft.ai.system.projectLog.service; | |
2 | + | |
3 | +public interface ProjectLogService { | |
4 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectLog/service/impl/ProjectLogServiceImpl.java
... | ... | @@ -0,0 +1,4 @@ |
1 | +package kr.co.takensoft.ai.system.projectLog.service.impl; | |
2 | + | |
3 | +public class ProjectLogServiceImpl { | |
4 | +} |
+++ src/main/java/kr/co/takensoft/ai/system/projectLog/vo/ProjectLogVO.java
... | ... | @@ -0,0 +1,34 @@ |
1 | +package kr.co.takensoft.ai.system.projectLog.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 ProjectLogVO { | |
19 | + | |
20 | + private String projectLogId; // 프로젝트 로그 아이디 | |
21 | + private String projectGroupId; // 프로젝트 그룹 아이디 | |
22 | + private String actionType; // 로그 내용(E : 수정, S : 공유) | |
23 | + private String useAt; // 사용 여부 (N : 사용 안함, Y : 사용) | |
24 | + private String createdAt; // 생성일자 | |
25 | + private String updatedAt; // 수정일자 | |
26 | + | |
27 | + // 프로젝트 로그 생성용 생성자 | |
28 | + public ProjectLogVO(String projectLogId, String projectGroupId, String actionType) { | |
29 | + this.projectLogId = projectLogId; | |
30 | + this.projectGroupId = projectGroupId; | |
31 | + this.actionType = actionType; | |
32 | + this.useAt = "Y"; | |
33 | + } | |
34 | +} |
+++ src/main/resources/mybatis/mapper/chatMsg/chatMsg-SQL.xml
... | ... | @@ -0,0 +1,69 @@ |
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.chatMsg.dao.ChatMsgDAO"> | |
4 | + | |
5 | + <!-- | |
6 | + 작 성 자 : 박현정 | |
7 | + 작 성 일 : 2025.07.17 | |
8 | + 내 용 : 채팅 메시지 resultMap | |
9 | + --> | |
10 | + <resultMap id="ChatMsgMap" type="ChatMsgVO"> | |
11 | + <result property="chatMsgId" column="chat_msg_id"/> | |
12 | + <result property="chatRoomId" column="chat_room_id"/> | |
13 | + <result property="senderId" column="sender_id"/> | |
14 | + <result property="senderName" column="member_name"/> | |
15 | + <result property="msgContent" column="msg_content"/> | |
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.16 | |
24 | + 내 용 : 채팅 메시지 등록 | |
25 | + --> | |
26 | + <insert id="saveChatMsg" parameterType="ChatMsgVO"> | |
27 | + INSERT INTO chat_msg | |
28 | + (chat_msg_id, | |
29 | + chat_room_id, | |
30 | + sender_id, | |
31 | + msg_content, | |
32 | + use_at, | |
33 | + created_at, | |
34 | + updated_at | |
35 | + ) | |
36 | + VALUES ( | |
37 | + #{chatMsgId}, | |
38 | + #{chatRoomId}, | |
39 | + #{senderId}, | |
40 | + #{msgContent}, | |
41 | + #{useAt}, | |
42 | + CURRENT_TIMESTAMP, | |
43 | + CURRENT_TIMESTAMP | |
44 | + ) | |
45 | + </insert> | |
46 | + | |
47 | + <!-- | |
48 | + 작 성 자 : 박현정 | |
49 | + 작 성 일 : 2025.07.17 | |
50 | + 내 용 : 채팅 메시지 전체 목록 조회 | |
51 | + --> | |
52 | + <select id="findAllChatMsgsByChatRoomId" parameterType="String" resultMap="ChatMsgMap"> | |
53 | + SELECT | |
54 | + cm.chat_msg_id, | |
55 | + cm.chat_room_id, | |
56 | + cm.sender_id, | |
57 | + m.member_name, | |
58 | + cm.msg_content, | |
59 | + cm.use_at, | |
60 | + cm.created_at, | |
61 | + cm.updated_at | |
62 | + FROM chat_msg cm | |
63 | + LEFT JOIN member m ON cm.sender_id = m.member_id | |
64 | + WHERE chat_room_id = #{chatRoomId} | |
65 | + </select> | |
66 | + | |
67 | + | |
68 | + | |
69 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/mybatis/mapper/chatRoom/chatRoom-SQL.xml
... | ... | @@ -0,0 +1,59 @@ |
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.chatRoom.dao.ChatRoomDAO"> | |
4 | + | |
5 | + <!-- | |
6 | + 작 성 자 : 박현정 | |
7 | + 작 성 일 : 2025.07.17 | |
8 | + 내 용 : 채팅방 resultMap | |
9 | +--> | |
10 | + <resultMap id="ChatRoomMap" type="ChatRoomVO"> | |
11 | + <result property="chatRoomId" column="chat_room_id"/> | |
12 | + <result property="projectGroupId" column="project_group_id"/> | |
13 | + <result property="feedbackId" column="feedback_id"/> | |
14 | + <result property="useAt" column="use_at"/> | |
15 | + <result property="createdAt" column="created_at"/> | |
16 | + <result property="updatedAt" column="updated_at"/> | |
17 | + </resultMap> | |
18 | + | |
19 | + <!-- | |
20 | + 작 성 자 : 박현정 | |
21 | + 작 성 일 : 2025.07.16 | |
22 | + 내 용 : 피드백 채팅방 등록 | |
23 | + --> | |
24 | + <insert id="saveChatRoom" parameterType="ChatRoomVO"> | |
25 | + INSERT INTO chat_room | |
26 | + (chat_room_id, | |
27 | + project_group_id, | |
28 | + feedback_id, | |
29 | + use_at, | |
30 | + created_at, | |
31 | + updated_at) | |
32 | + VALUES ( | |
33 | + #{chatRoomId}, | |
34 | + #{projectGroupId}, | |
35 | + #{feedbackId}, | |
36 | + #{useAt}, | |
37 | + CURRENT_TIMESTAMP, | |
38 | + CURRENT_TIMESTAMP | |
39 | + ) | |
40 | + </insert> | |
41 | + | |
42 | + <!-- | |
43 | + 작 성 자 : 박현정 | |
44 | + 작 성 일 : 2025.07.17 | |
45 | + 내 용 : 채팅방 조회 | |
46 | + --> | |
47 | + <select id="findById" parameterType="String" resultMap="ChatRoomMap"> | |
48 | + SELECT | |
49 | + chat_room_id, | |
50 | + project_group_id, | |
51 | + feedback_id, | |
52 | + use_at, | |
53 | + created_at, | |
54 | + updated_at | |
55 | + FROM chat_room | |
56 | + WHERE chat_room_id = #{chatRoomId} | |
57 | + </select> | |
58 | + | |
59 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/mybatis/mapper/feedback/feedback-SQL.xml
... | ... | @@ -0,0 +1,114 @@ |
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.feedback.dao.FeedbackDAO"> | |
4 | + | |
5 | + <!-- | |
6 | + 작 성 자 : 박현정 | |
7 | + 작 성 일 : 2025.07.16 | |
8 | + 내 용 : 피드백 resultMap | |
9 | + --> | |
10 | + <resultMap id="FeedbackMap" type="FeedbackVO"> | |
11 | + <result property="feedbackId" column="feedback_id"/> | |
12 | + <result property="projectGroupId" column="project_group_id"/> | |
13 | + <result property="projectName" column="project_name"/> | |
14 | + <result property="memberId" column="member_id"/> | |
15 | + <result property="memberName" column="member_name"/> | |
16 | + <result property="chatRoomId" column="chat_room_id"/> | |
17 | + <result property="feedbackContent" column="feedback_content"/> | |
18 | + <result property="isChecked" column="is_checked"/> | |
19 | + <result property="useAt" column="use_at"/> | |
20 | + <result property="createdAt" column="created_at"/> | |
21 | + <result property="updatedAt" column="updated_at"/> | |
22 | + </resultMap> | |
23 | + | |
24 | + <!-- | |
25 | + 작 성 자 : 박현정 | |
26 | + 작 성 일 : 2025.07.16 | |
27 | + 내 용 : 피드백 조회 | |
28 | + --> | |
29 | + <select id="findById" parameterType="String" resultMap="FeedbackMap"> | |
30 | + SELECT | |
31 | + f.feedback_id, | |
32 | + f.project_group_id, | |
33 | + p.project_name, | |
34 | + f.member_id, | |
35 | + m.member_name, | |
36 | + cr.chat_room_id, | |
37 | + f.feedback_content, | |
38 | + f.is_checked, | |
39 | + f.use_at, | |
40 | + TO_CHAR(f.created_at, 'YYYY-MM-DD HH24:MI') AS created_at, | |
41 | + TO_CHAR(f.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at | |
42 | + FROM feedback f | |
43 | + LEFT JOIN project p ON f.project_group_id = p.project_group_id AND p.is_main = 'Y' | |
44 | + LEFT JOIN member m ON f.member_id = m.member_id | |
45 | + LEFT JOIN chat_room cr ON f.feedback_id = cr.feedback_id | |
46 | + WHERE f.feedback_id = #{feedbackId} | |
47 | + AND f.use_at = 'Y' | |
48 | + </select> | |
49 | + | |
50 | + <!-- | |
51 | + 작 성 자 : 박현정 | |
52 | + 작 성 일 : 2025.07.16 | |
53 | + 내 용 : 피드백 등록 | |
54 | + --> | |
55 | + <insert id="saveFeedback" parameterType="FeedbackVO"> | |
56 | + INSERT INTO feedback | |
57 | + (feedback_id, | |
58 | + project_group_id, | |
59 | + member_id, | |
60 | + feedback_content, | |
61 | + is_checked, | |
62 | + use_at, | |
63 | + created_at, | |
64 | + updated_at | |
65 | + ) | |
66 | + VALUES ( | |
67 | + #{feedbackId}, | |
68 | + #{projectGroupId}, | |
69 | + #{memberId}, | |
70 | + #{feedbackContent}, | |
71 | + #{isChecked}, | |
72 | + #{useAt}, | |
73 | + CURRENT_TIMESTAMP, | |
74 | + CURRENT_TIMESTAMP | |
75 | + ) | |
76 | + </insert> | |
77 | + | |
78 | + <!-- | |
79 | + 작 성 자 : 박현정 | |
80 | + 작 성 일 : 2025.07.16 | |
81 | + 내 용 : 피드백 목록 조회 (사용자 아이디로 검색) | |
82 | + --> | |
83 | + <select id="findAllByMemberId" resultMap="FeedbackMap" parameterType="String"> | |
84 | + SELECT | |
85 | + f.feedback_id, | |
86 | + f.project_group_id, | |
87 | + p.project_name, | |
88 | + f.member_id, | |
89 | + m.member_name, | |
90 | + cr.chat_room_id, | |
91 | + f.feedback_content, | |
92 | + f.is_checked, | |
93 | + f.use_at, | |
94 | + f.created_at, | |
95 | + f.updated_at | |
96 | + FROM feedback f | |
97 | + LEFT JOIN project p ON f.project_group_id = p.project_group_id AND p.is_main = 'Y' | |
98 | + LEFT JOIN member m ON f.member_id = m.member_id | |
99 | + LEFT JOIN chat_room cr ON f.feedback_id = cr.feedback_id | |
100 | + WHERE f.member_id = #{member_id} | |
101 | + AND f.use_at = 'Y' | |
102 | + </select> | |
103 | + | |
104 | + <update id="setFeedbackCheck" parameterType="String"> | |
105 | + UPDATE feedback | |
106 | + <set> | |
107 | + is_checked = 'Y', | |
108 | + updated_at = CURRENT_TIMESTAMP | |
109 | + </set> | |
110 | + WHERE feedback_id = #{feedbackId} | |
111 | + AND use_at = 'Y' | |
112 | + </update> | |
113 | + | |
114 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/mybatis/mapper/projectLog/projectLog-SQL.xml
... | ... | @@ -0,0 +1,36 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="kr.co.takensoft.ai.system.projectLog.dao.ProjectLogDAO"> | |
4 | + <!-- | |
5 | + 작 성 자 : 박현정 | |
6 | + 작 성 일 : 2025.07.10 | |
7 | + 내 용 : 프로젝트 로그 등록 | |
8 | + --> | |
9 | + <insert id="saveProjectLog" parameterType="projectLogVO"> | |
10 | + INSERT INTO project_log | |
11 | + (project_log_id, | |
12 | + project_group_id, | |
13 | + action_type, | |
14 | + use_at, | |
15 | + created_at, | |
16 | + updated_at) | |
17 | + VALUES ( | |
18 | + #{projectLogId}, | |
19 | + #{projectGroupId}, | |
20 | + #{actionType}, | |
21 | + #{useAt}, | |
22 | + CURRENT_TIMESTAMP, | |
23 | + CURRENT_TIMESTAMP | |
24 | + ) | |
25 | + </insert> | |
26 | + | |
27 | + <!-- | |
28 | + 작 성 자 : 박현정 | |
29 | + 작 성 일 : 2025.07.11 | |
30 | + 내 용 : 활성(사용중) 데이터만 조회하도록 필터링 | |
31 | + --> | |
32 | + <sql id="activeOnly"> | |
33 | + use_at = 'Y' | |
34 | + </sql> | |
35 | + | |
36 | +</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?