diff --git a/src/main/java/com/huoran/iasf/controller/SysFilesController.java b/src/main/java/com/huoran/iasf/controller/SysFilesController.java index f098a80..803cff2 100644 --- a/src/main/java/com/huoran/iasf/controller/SysFilesController.java +++ b/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 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("更新失败"); }