SpringBoot2.0 整合 FastDFS 中间件,实现文件分布式管理( 九 )

}

/**

* 文件删除

*/

@RequestMapping(value = "http://www.veick.cn/deleteByPath", method = RequestMethod.GET)

public ResponseEntity deleteByPath (){

String filePathName = "group1/M00/00/00/wKhIgl0n4AKABxQEABhlMYw_3Lo825.png" ;

fileDfsUtil.deleteFile(filePathName);

return ResponseEntity.ok("SUCCESS") ;

}

}

2、执行流程

1、访问http://localhost:7010/swagger-ui.html测试界面

2、调用文件上传接口,拿到文件在FastDFS服务的路径

3、浏览器访问:http://192.168.72.130/group1/M00/00/00/wKhIgl0n4AKABxQEABhlMYw_3Lo825.png

推荐阅读