月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-09-07 4bb9adfe6d797a38d83a5b6588466b7f7506a7e2
src/main/java/com/moon/server/controller/data/PublishController.java
@@ -265,4 +265,27 @@
            return fail(ex.getMessage(), -1);
        }
    }
    @SysLog()
    @ApiOperation(value = "更新一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "entity", value = "实体类", dataType = "PublishEntity", paramType = "body")
    })
    @ResponseBody
    @PostMapping(value = "/update", produces = "application/json; charset=UTF-8")
    public ResponseMsg<Integer> update(@RequestBody PublishEntity entity, HttpServletRequest req) {
        try {
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                entity.setUpdateUser(ue.getId());
            }
            permsService.clearPermsCache();
            int count = publishService.update(entity);
            return success(count);
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
        }
    }
}