OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-03-14 fe21896bff9b9305df0294e0352b343e0dd4d0b9
src/main/java/kr/wisestone/owl/service/impl/AttachedFileServiceImpl.java
@@ -119,6 +119,35 @@
        }
    }
    //  첨부 파일을 등록한다. - API 에서 사용
    @Override
    @Transactional
    public List<AttachedFile> addAttachedFile(Workspace workspace, Issue issue, List<Map<String, Object>> files) {
        if (workspace == null) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.WORKSPACE_NOT_EXIST));
        }
        if (issue == null) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_EXIST));
        }
        if (files != null && files.size() > 0) {
            List<Map<String, Object>> convertFileMaps = Lists.newArrayList();
            for (Map<String, Object> file : files) {
                String fileName = MapUtil.getString(file, "fileName");
                String fileStr = MapUtil.getString(file, "file");
                String contentType = MapUtil.getString(file, "contentType");
                convertFileMaps.add(CommonUtil.makeFileMap(fileName, fileStr, contentType));
            }
            return this.addAttachedFiles(workspace, convertFileMaps, issue, null, AttachedType.SUMMER);
        }
        return null;
    }
    //  첨부 파일을 등록한다. - 이슈 생성, 수정에서 사용
    @Override
    @Transactional