| | |
| | | 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; |
| | |
| | | return issueComment; |
| | | } |
| | | |
| | | // 댓글을 등록한다. (api용) |
| | | @Override |
| | | @Transactional |
| | | public IssueComment addIssueComment(IssueCommentForm issueCommentForm, User user) { |
| | | // 사용하고 있는 업무 공간이 활성 상태인지 확인한다. 사용 공간에서 로그인한 사용자가 비활성인지 확인한다. |
| | | this.workspaceService.checkUseWorkspace(user); |
| | | |
| | | 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; |
| | | } |
| | | |
| | | private void verifyComment(String comment) { |
| | | if (StringUtils.isEmpty(comment)) { |
| | | throw new OwlRuntimeException( |