|
@@ -23,10 +23,7 @@ import com.ruoyi.system.domain.bo.SysOssBo;
|
|
import com.ruoyi.system.domain.vo.SysOssVo;
|
|
import com.ruoyi.system.domain.vo.SysOssVo;
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
import com.ruoyi.system.service.ISysOssService;
|
|
import com.ruoyi.system.service.ISysOssService;
|
|
-import io.swagger.annotations.Api;
|
|
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
-import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
+import io.swagger.annotations.*;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
@@ -72,7 +69,7 @@ public class SysOssController extends BaseController {
|
|
*/
|
|
*/
|
|
@ApiOperation("上传OSS对象存储")
|
|
@ApiOperation("上传OSS对象存储")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
- @ApiImplicitParam(name = "file", value = "文件", dataType = "java.io.File", required = true),
|
|
|
|
|
|
+ @ApiImplicitParam(name = "file", value = "文件", dataType = "java.io.File", required = true),
|
|
})
|
|
})
|
|
@PreAuthorize("@ss.hasPermi('system:oss:upload')")
|
|
@PreAuthorize("@ss.hasPermi('system:oss:upload')")
|
|
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT)
|
|
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT)
|
|
@@ -92,7 +89,7 @@ public class SysOssController extends BaseController {
|
|
@ApiOperation("下载OSS对象存储")
|
|
@ApiOperation("下载OSS对象存储")
|
|
@PreAuthorize("@ss.hasPermi('system:oss:download')")
|
|
@PreAuthorize("@ss.hasPermi('system:oss:download')")
|
|
@GetMapping("/download/{ossId}")
|
|
@GetMapping("/download/{ossId}")
|
|
- public void download(@PathVariable Long ossId, HttpServletResponse response) throws IOException {
|
|
|
|
|
|
+ public void download(@ApiParam("OSS对象ID") @PathVariable Long ossId, HttpServletResponse response) throws IOException {
|
|
SysOss sysOss = iSysOssService.getById(ossId);
|
|
SysOss sysOss = iSysOssService.getById(ossId);
|
|
if (ObjectUtil.isNull(sysOss)) {
|
|
if (ObjectUtil.isNull(sysOss)) {
|
|
throw new ServiceException("文件数据不存在!");
|
|
throw new ServiceException("文件数据不存在!");
|
|
@@ -120,7 +117,8 @@ public class SysOssController extends BaseController {
|
|
@PreAuthorize("@ss.hasPermi('system:oss:remove')")
|
|
@PreAuthorize("@ss.hasPermi('system:oss:remove')")
|
|
@Log(title = "OSS对象存储", businessType = BusinessType.DELETE)
|
|
@Log(title = "OSS对象存储", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{ossIds}")
|
|
@DeleteMapping("/{ossIds}")
|
|
- public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
|
|
+ public AjaxResult<Void> remove(@ApiParam("OSS对象ID串")
|
|
|
|
+ @NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] ossIds) {
|
|
@PathVariable Long[] ossIds) {
|
|
return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true) ? 1 : 0);
|
|
return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true) ? 1 : 0);
|
|
}
|
|
}
|
|
@@ -135,7 +133,7 @@ public class SysOssController extends BaseController {
|
|
public AjaxResult<Void> changePreviewListResource(@RequestBody String body) {
|
|
public AjaxResult<Void> changePreviewListResource(@RequestBody String body) {
|
|
Map<String, Boolean> map = JsonUtils.parseMap(body);
|
|
Map<String, Boolean> map = JsonUtils.parseMap(body);
|
|
SysConfig config = iSysConfigService.getOne(new LambdaQueryWrapper<SysConfig>()
|
|
SysConfig config = iSysConfigService.getOne(new LambdaQueryWrapper<SysConfig>()
|
|
- .eq(SysConfig::getConfigKey, CloudConstant.PEREVIEW_LIST_RESOURCE_KEY));
|
|
|
|
|
|
+ .eq(SysConfig::getConfigKey, CloudConstant.PEREVIEW_LIST_RESOURCE_KEY));
|
|
config.setConfigValue(map.get("previewListResource").toString());
|
|
config.setConfigValue(map.get("previewListResource").toString());
|
|
return toAjax(iSysConfigService.updateConfig(config));
|
|
return toAjax(iSysConfigService.updateConfig(config));
|
|
}
|
|
}
|