update 优化 pr57 代码结构

dev
疯狂的狮子Li 3 years ago
parent f768b083ec
commit f0590487e3

@ -90,7 +90,7 @@ public class SysOssController extends BaseController {
@SaCheckPermission("system:oss:download") @SaCheckPermission("system:oss:download")
@GetMapping("/download/{ossId}") @GetMapping("/download/{ossId}")
public void download(@PathVariable Long ossId, HttpServletResponse response) throws IOException { public void download(@PathVariable Long ossId, HttpServletResponse response) throws IOException {
iSysOssService.download(ossId,response); iSysOssService.download(ossId, response);
} }
/** /**
@ -102,7 +102,7 @@ public class SysOssController extends BaseController {
@Log(title = "OSS对象存储", businessType = BusinessType.DELETE) @Log(title = "OSS对象存储", businessType = BusinessType.DELETE)
@DeleteMapping("/{ossIds}") @DeleteMapping("/{ossIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ossIds) { public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ossIds) {
return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true) ? 1 : 0); return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true));
} }
} }

@ -156,11 +156,9 @@ public class SysOssServiceImpl implements ISysOssService {
*/ */
private SysOssVo matchingUrl(SysOssVo oss) { private SysOssVo matchingUrl(SysOssVo oss) {
OssClient storage = OssFactory.instance(oss.getService()); OssClient storage = OssFactory.instance(oss.getService());
/** // 仅修改桶类型为 private 的URL临时URL时长为120s
* private URLURL100s
*/
if (AccessPolicyType.PRIVATE == storage.getAccessPolicy()) { if (AccessPolicyType.PRIVATE == storage.getAccessPolicy()) {
oss.setUrl(storage.getPrivateUrl(oss.getFileName(), 100)); oss.setUrl(storage.getPrivateUrl(oss.getFileName(), 120));
} }
return oss; return oss;
} }

Loading…
Cancel
Save