public String saveAttachment(String path, MultipartFile file) {
        String originalFilename = file.getOriginalFilename();
        return attachmentRepository.save(new Attachment()
                .setId(StringExtUtils.getUuid())
                .setName(originalFilename)
                .setExt(FilenameUtils.getExtension(originalFilename))
                .setPath(path)
                .setSize(file.getSize())).getId();
    }
saveAttachment

@param path path
@param file file
@return String
src/main/java/com/tuituidan/openhub/service/AttachmentService.java