diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/ApiGatewayService.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/ApiGatewayService.java index 38544dac..156012ee 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/ApiGatewayService.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/ApiGatewayService.java @@ -29,7 +29,7 @@ public class ApiGatewayService { @Autowired private RestTemplate restTemplate; - @Value("${hisense.gateway.url: http://devtest-security-app.hismarttv.com:8080}") + @Value("${hisense.gateway.url:http://devtest-security-app.hismarttv.com:8080}") private String gatewayUrl; /** @@ -68,7 +68,7 @@ public class ApiGatewayService { } //建路由(接口url) - String routeUrl = gatewayUrl + "/apisix/admin/routes"; + String routeUrl = gatewayUrl + "apiops/api/routers"; HashMap routeEntity = new HashMap(); routeEntity.put("name", "api:1:" + resourceEntity.getName()); routeEntity.put("group", id); @@ -83,7 +83,7 @@ public class ApiGatewayService { LambdaUpdateWrapper updateWrapper = new UpdateWrapper().lambda(); updateWrapper.eq(ResourceEntity::getId, resourceEntity.getId()); updateWrapper.set(ResourceEntity::getGroupId, id); - resourceDao.update(resourceEntity, updateWrapper); + resourceDao.update(null, updateWrapper); } } diff --git a/renren-admin/src/main/resources/application-dev.yml b/renren-admin/src/main/resources/application-dev.yml index a239fb37..823b087b 100644 --- a/renren-admin/src/main/resources/application-dev.yml +++ b/renren-admin/src/main/resources/application-dev.yml @@ -27,13 +27,13 @@ spring: initial-size: 10 max-active: 100 min-idle: 10 - max-wait: 6000 + max-wait: 10 pool-prepared-statements: true max-pool-prepared-statement-per-connection-size: 20 time-between-eviction-runs-millis: 60000 min-evictable-idle-time-millis: 300000 #Oracle需要打开注释 -# validation-query: SELECT 1 FROM DUAL + validation-query: SELECT 1 test-while-idle: true test-on-borrow: false test-on-return: false @@ -61,6 +61,10 @@ big_date: name: 青岛市大数据发展管理局 assignee_role_name: 部门审批人 +hisense: + gateway: + url: http://devtest-security-app.hismarttv.com:8080 + ##多数据源的配置,需要引用renren-dynamic-datasource #dynamic: diff --git a/renren-admin/src/test/java/io/renren/ApiGatewayServiceTest.java b/renren-admin/src/test/java/io/renren/ApiGatewayServiceTest.java new file mode 100644 index 00000000..71134cab --- /dev/null +++ b/renren-admin/src/test/java/io/renren/ApiGatewayServiceTest.java @@ -0,0 +1,24 @@ +package io.renren; + +import io.renren.common.redis.RedisUtils; +import io.renren.modules.processForm.service.ApiGatewayService; +import io.renren.modules.sys.entity.SysUserEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class ApiGatewayServiceTest { + @Autowired + private ApiGatewayService apiGatewayService; + + @Test + public void contextLoads() { + apiGatewayService.registerApi2Gateway("1519505145602723841"); + } + +} \ No newline at end of file