文件更新

master
chen 2 years ago
parent 6765eb34ac
commit 1e2ed7cbc2
  1. 6
      src/main/java/com/huoran/iasf/controller/SysFilesController.java

@ -1,5 +1,6 @@
package com.huoran.iasf.controller;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@ -68,14 +69,13 @@ public class SysFilesController {
@ApiOperation(value = "更新文件信息")
@PostMapping("/update")
public R update(FileParameters fileParameters) {
if (fileParameters.getId()==null){
public R update(@RequestBody FileParameters fileParameters) {
if (StrUtil.isEmpty(fileParameters.getId())){
return R.fail("id不能为空");
}
UpdateWrapper<SysFilesEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("quote",fileParameters.getQuote()).
set("is_release",fileParameters.getIsRelease()).
eq("site",fileParameters.getSite()).
eq("id", fileParameters.getId());
return sysFilesService.update(updateWrapper) ? R.success() : R.fail("更新失败");
}

Loading…
Cancel
Save