From 071ce2adbe79321a01ff178928faa0b8177a679c Mon Sep 17 00:00:00 2001 From: tangfudong <280620913@qq.com> Date: Wed, 14 Jun 2023 09:23:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E5=8E=9F=E6=9C=89=E6=95=B0=E6=8D=AE=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProtocolController.java | 27 ++----------------- .../manager/service/DataOwnerService.java | 6 +++-- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java index 5459b006..dbba49de 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java @@ -10,44 +10,21 @@ package cc.iotkit.manager.controller; import cc.iotkit.common.api.PageRequest; +import cc.iotkit.common.api.Paging; import cc.iotkit.common.api.Request; -import cc.iotkit.common.enums.ErrCode; -import cc.iotkit.common.exception.BizException; -import cc.iotkit.common.satoken.utils.AuthUtil; -import cc.iotkit.common.utils.ReflectUtil; -import cc.iotkit.comps.ComponentManager; -import cc.iotkit.comps.config.ComponentConfig; -import cc.iotkit.data.manager.IProtocolComponentData; -import cc.iotkit.data.manager.IProtocolConverterData; -import cc.iotkit.data.manager.IUserInfoData; import cc.iotkit.manager.dto.bo.ChangeStateBo; import cc.iotkit.manager.dto.bo.protocolcomponent.ProtocolComponentBo; import cc.iotkit.manager.dto.bo.protocolconverter.ProtocolConverterBo; import cc.iotkit.manager.dto.vo.protocolcomponent.ProtocolComponentVo; import cc.iotkit.manager.dto.vo.protocolconverter.ProtocolConverterVo; -import cc.iotkit.manager.service.DataOwnerService; -import cc.iotkit.common.api.Paging; import cc.iotkit.manager.service.IProtocolService; -import cc.iotkit.model.protocol.ProtocolComponent; -import cc.iotkit.model.protocol.ProtocolConverter; import io.swagger.annotations.Api; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.io.FileUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import java.io.File; -import java.io.IOException; -import java.nio.file.*; -import java.util.Objects; -import java.util.UUID; - @Api(tags = {"协议"}) @RestController @RequestMapping("/protocol") @@ -119,7 +96,7 @@ public class ProtocolController { @ApiOperation("修改转换脚本") @PostMapping("/converter/edit") - public boolean editConverter(Request req) { + public boolean editConverter(@Validated @RequestBody Request req) { return protocolService.editConverter(req.getData()); } diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/DataOwnerService.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/DataOwnerService.java index 8ab3aa2c..567b9318 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/DataOwnerService.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/DataOwnerService.java @@ -61,7 +61,8 @@ public class DataOwnerService { } } - throw new BizException(ErrCode.UNAUTHORIZED_EXCEPTION); +// throw new BizException(ErrCode.UNAUTHORIZED_EXCEPTION);暂时先注释,重新设计 + return data; } /** @@ -89,7 +90,8 @@ public class DataOwnerService { return; } - throw new BizException(ErrCode.UNAUTHORIZED_EXCEPTION); +// throw new BizException(ErrCode.UNAUTHORIZED_EXCEPTION);暂时先注释,重新设计 + return; } /**