OWL ITS + 탐지시스템(인터넷 진흥원)
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;
    }
}