class EruptFlowFileController {

    private final EruptProp eruptProp;

    /**
     * 上传图片
     * @param file
     * @return
     */
    @SneakyThrows
    @PostMapping("/upload")
    @EruptRouter(verifyType = EruptRouter.VerifyType.LOGIN)
    public EruptApiModel upload(@RequestParam("file") MultipartFile file) {
        if (file.isEmpty() || StringUtils.isBlank(file.getOriginalFilename())) {
            return EruptApiModel.errorApi("上传失败，请选择文件");
        }
        String path;
        if (eruptProp.isKeepUploadFileName()) {
            path = File.separator + DateUtil.getFormatDate(new Date(), DateUtil.DATE) + File.separator + file.getOriginalFilename()
                    .replaceAll("&|#|\\?|\\s", "");
        } else {
            String[] fileNameSplit = file.getOriginalFilename().split("\\.");
            path = File.separator + DateUtil.getFormatDate(new Date(), DateUtil.DATE)
                    + File.separator + RandomStringUtils.randomAlphabetic(12) + EruptConst.DOT + fileNameSplit[fileNameSplit.length - 1];
        }
        //加一个独享空间，方便查找
        path = File.separator + FlowConstant.SERVER_NAME + path;

        try {
            //是否本地存储
            boolean localSave = true;
            AttachmentProxy attachmentProxy = EruptUtil.findAttachmentProxy();
            if (null != attachmentProxy) {
                path = attachmentProxy.upLoad(file.getInputStream(), path.replace("\\", "/"));
                localSave = attachmentProxy.isLocalSave();
            }
            if (localSave) {
                File dest = new File(eruptProp.getUploadPath() + path);
                if (!dest.getParentFile().exists()) {
                    if (!dest.getParentFile().mkdirs()) {
                        return EruptApiModel.errorApi("上传失败，文件目录无法创建");
                    }
                }
                file.transferTo(dest);
            }
            return EruptApiModel.successApi(new FileUploadResult(file.getOriginalFilename(), EruptRestPath.ERUPT_ATTACHMENT+path.replace("\\", "/")));
        } catch (Exception e) {
            return EruptApiModel.errorApi("上传失败，" + e.getMessage());
        }
    }

    @SneakyThrows
    @DeleteMapping("/file")
    @EruptRouter(verifyType = EruptRouter.VerifyType.LOGIN)
    public EruptApiModel deleteFile(@RequestParam("path") String path) {<FILL_FUNCTION_BODY>}
}

        path = eruptProp.getUploadPath() + path.replace(EruptRestPath.ERUPT_ATTACHMENT, "");
        File file = new File(path);
        if(file.exists()) {
            FileUtils.delete(file);
        }
        return EruptApiModel.successApi();
    
<no_super_class>