From f8d35ef0bfc812494f7d30dff1d075a3327209f1 Mon Sep 17 00:00:00 2001
From: minhee <alsdldlfrl@gmail.com>
Date: 금, 11 2월 2022 18:30:04 +0900
Subject: [PATCH] - 사용자 정의 필드 필드 유형 변경시 기본값 항목 표시 오류 수정 폼에도 적용 - 입력 폼에서 탭키 안먹는 현상 수정

---
 src/main/java/kr/wisestone/owl/service/impl/IssueCommentServiceImpl.java |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/src/main/java/kr/wisestone/owl/service/impl/IssueCommentServiceImpl.java b/src/main/java/kr/wisestone/owl/service/impl/IssueCommentServiceImpl.java
index 832585a..a2963aa 100644
--- a/src/main/java/kr/wisestone/owl/service/impl/IssueCommentServiceImpl.java
+++ b/src/main/java/kr/wisestone/owl/service/impl/IssueCommentServiceImpl.java
@@ -3,6 +3,7 @@
 import kr.wisestone.owl.constant.MsgConstants;
 import kr.wisestone.owl.domain.Issue;
 import kr.wisestone.owl.domain.IssueComment;
+import kr.wisestone.owl.domain.User;
 import kr.wisestone.owl.exception.OwlRuntimeException;
 import kr.wisestone.owl.repository.IssueCommentRepository;
 import kr.wisestone.owl.service.IssueCommentService;
@@ -47,6 +48,26 @@
     public IssueComment addIssueComment(IssueCommentForm issueCommentForm) {
         //  �궗�슜�븯怨� �엳�뒗 �뾽臾� 怨듦컙�씠 �솢�꽦 �긽�깭�씤吏� �솗�씤�븳�떎. �궗�슜 怨듦컙�뿉�꽌 濡쒓렇�씤�븳 �궗�슜�옄媛� 鍮꾪솢�꽦�씤吏� �솗�씤�븳�떎.
         this.workspaceService.checkUseWorkspace();
+
+        IssueComment issueComment = ConvertUtil.copyProperties(issueCommentForm, IssueComment.class);
+
+        this.verifyComment(issueCommentForm.getDescription());
+
+        Issue issue = this.issueService.getIssue(issueCommentForm.getIssueId());
+        issueComment.setIssue(issue);
+        issueComment.setWorkspace(issue.getProject().getWorkspace());
+
+        this.issueCommentRepository.saveAndFlush(issueComment);
+
+        return issueComment;
+    }
+
+    //  �뙎湲��쓣 �벑濡앺븳�떎. (api�슜)
+    @Override
+    @Transactional
+    public IssueComment addIssueComment(IssueCommentForm issueCommentForm, User user) {
+        //  �궗�슜�븯怨� �엳�뒗 �뾽臾� 怨듦컙�씠 �솢�꽦 �긽�깭�씤吏� �솗�씤�븳�떎. �궗�슜 怨듦컙�뿉�꽌 濡쒓렇�씤�븳 �궗�슜�옄媛� 鍮꾪솢�꽦�씤吏� �솗�씤�븳�떎.
+        this.workspaceService.checkUseWorkspace(user);
 
         IssueComment issueComment = ConvertUtil.copyProperties(issueCommentForm, IssueComment.class);
 
@@ -133,7 +154,14 @@
     @Override
     @Transactional(readOnly = true)
     public List<IssueCommentVo> findIssueComment(Long issueId) {
-        return this.issueCommentRepository.findByIssueId(issueId);
+        List<IssueCommentVo> issueCommentVos = this.issueCommentRepository.findByIssueId(issueId);
+        Issue issue = this.issueService.getIssue(issueId);
+        if (issueCommentVos != null && issueCommentVos.size() > 0) {
+            for (IssueCommentVo issueCommentVo : issueCommentVos) {
+                issueCommentVo.setTitle(issue.getTitle());
+            }
+        }
+        return issueCommentVos;
     }
 
 }

--
Gitblit v1.8.0