From 1e8c970c39fdbb62fc744c7eb8416e6085c1d75b Mon Sep 17 00:00:00 2001 From: huangweixiong Date: Mon, 8 Aug 2022 15:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=BD=E5=8A=9B=E6=8C=82=E6=8E=A5=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E7=BD=91=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/controller/ResourceController.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 8aa323c8..47deb781 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -10,6 +10,7 @@ import io.renren.common.utils.Result; import io.renren.common.validator.ValidatorUtils; import io.renren.common.validator.group.AddGroup; import io.renren.common.validator.group.DefaultGroup; +import io.renren.modules.processForm.service.ApiGatewayService; import io.renren.modules.resource.dataResource.AbstractDataResourceService; import io.renren.modules.resource.dataResource.DataResourceFactory; import io.renren.modules.resource.dto.GetDataResourceListDto; @@ -107,6 +108,9 @@ public class ResourceController { @Autowired private SysDeptService sysDeptService; + @Autowired + private ApiGatewayService apiGatewayService; + @Lazy @Autowired private JdbcTemplate jdbcTemplate; @@ -246,6 +250,16 @@ public class ResourceController { logger.info(dto.toString()); resourceService.insertWithAttrs(dto); + if (!"f".equals(source) && dto.getId() != null) {//后台挂架直接上架 + try { + apiGatewayService.registerApi2Gateway(dto.getId().toString()); + }catch (Exception exception){ + //注册失败忽略,简单记录一下 + logger.error("挂接网关注册失败", exception); + } + + } + return new Result().ok(dto.getId() == null ? "" : dto.getId()); }