代码拉取完成,页面将自动刷新
此模块集成,七牛文件服务;如果有需要,可以扩展阿里云等等云服务
<dependency>
<artifactId>csx-bsf-file</artifactId>
<groupId>com.yh.csx.bsf</groupId>
<version>1.7.1-SNAPSHOT</version>
</dependency>
## bsf file 集成
##file服务的启用开关,非必须,默认true
bsf.file.enabled=true
##file服务默认为七牛云,可以扩展其他的文件服务
bsf.file.provider=qiniu
##七牛云的accessKey
bsf.file.qiniu.accessKey =
##七牛云的securityKey
bsf.file.qiniu.securityKey =
##七牛云的bucketName
bsf.file.qiniu.bucketName =
##七牛云的bucketUrl
bsf.file.qiniu.bucketUrl =
bsf.file.qiniu.tempDir=
关于七牛云的使用,请参阅七牛云
@Autowired(required = false)
private FileProvider fileProvider;
/**
* 文件上传
*/
@PostMapping("/upload")
public CommonResponse<String> uploadFile(MultipartFile file) throws Exception {
return CommonResponse.success(fileProvider.upload(file.getInputStream(), file.getOriginalFilename()));
}
/**
* 上传服务器本地文件
*/
public CommonResponse<String> uploadLocalFile(String file) throws Exception {
return CommonResponse.success(fileProvider.upload(file, FileUtils.getFileName(file)));
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。