|
|
|
@ -2,6 +2,7 @@ package com.huoran.iasf.controller; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.huoran.iasf.common.utils.R; |
|
|
|
@ -50,7 +51,6 @@ public class SysFilesController { |
|
|
|
|
return result.toJSONString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "新增") |
|
|
|
|
@PostMapping("/upload") |
|
|
|
|
// @RequiresPermissions(value = {"sysFiles:add", "sysContent:update", "sysContent:add"}, logical = Logical.OR)
|
|
|
|
@ -66,6 +66,19 @@ public class SysFilesController { |
|
|
|
|
return sysFilesService.saveFile(file,fileParameters); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "更新文件信息") |
|
|
|
|
@PostMapping("/update") |
|
|
|
|
public R update(FileParameters fileParameters) { |
|
|
|
|
if (fileParameters.getId()==null){ |
|
|
|
|
return R.fail("id不能为空"); |
|
|
|
|
} |
|
|
|
|
UpdateWrapper<SysFilesEntity> updateWrapper = new UpdateWrapper<>(); |
|
|
|
|
updateWrapper.set("quote",fileParameters.getQuote()). |
|
|
|
|
eq("site",fileParameters.getSite()). |
|
|
|
|
eq("id", fileParameters.getId()); |
|
|
|
|
return sysFilesService.update(updateWrapper) ? R.success() : R.fail("更新失败"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "文件预览") |
|
|
|
|
@GetMapping("/preview/{id}") |
|
|
|
|
public void preview(@PathVariable String id, HttpServletRequest req, HttpServletResponse res) { |
|
|
|
|