【能力上架申请】审批通过后网关注册成功只更新groupid字段

This commit is contained in:
huangweixiong 2022-04-28 11:24:51 +08:00
parent 84cc1b43f2
commit 27afac32a7
3 changed files with 33 additions and 5 deletions

View File

@ -68,7 +68,7 @@ public class ApiGatewayService {
} }
//建路由接口url //建路由接口url
String routeUrl = gatewayUrl + "/apisix/admin/routes"; String routeUrl = gatewayUrl + "apiops/api/routers";
HashMap routeEntity = new HashMap(); HashMap routeEntity = new HashMap();
routeEntity.put("name", "api:1:" + resourceEntity.getName()); routeEntity.put("name", "api:1:" + resourceEntity.getName());
routeEntity.put("group", id); routeEntity.put("group", id);
@ -83,7 +83,7 @@ public class ApiGatewayService {
LambdaUpdateWrapper<ResourceEntity> updateWrapper = new UpdateWrapper<ResourceEntity>().lambda(); LambdaUpdateWrapper<ResourceEntity> updateWrapper = new UpdateWrapper<ResourceEntity>().lambda();
updateWrapper.eq(ResourceEntity::getId, resourceEntity.getId()); updateWrapper.eq(ResourceEntity::getId, resourceEntity.getId());
updateWrapper.set(ResourceEntity::getGroupId, id); updateWrapper.set(ResourceEntity::getGroupId, id);
resourceDao.update(resourceEntity, updateWrapper); resourceDao.update(null, updateWrapper);
} }
} }

View File

@ -27,13 +27,13 @@ spring:
initial-size: 10 initial-size: 10
max-active: 100 max-active: 100
min-idle: 10 min-idle: 10
max-wait: 6000 max-wait: 10
pool-prepared-statements: true pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20 max-pool-prepared-statement-per-connection-size: 20
time-between-eviction-runs-millis: 60000 time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000 min-evictable-idle-time-millis: 300000
#Oracle需要打开注释 #Oracle需要打开注释
# validation-query: SELECT 1 FROM DUAL validation-query: SELECT 1
test-while-idle: true test-while-idle: true
test-on-borrow: false test-on-borrow: false
test-on-return: false test-on-return: false
@ -61,6 +61,10 @@ big_date:
name: 青岛市大数据发展管理局 name: 青岛市大数据发展管理局
assignee_role_name: 部门审批人 assignee_role_name: 部门审批人
hisense:
gateway:
url: http://devtest-security-app.hismarttv.com:8080
##多数据源的配置需要引用renren-dynamic-datasource ##多数据源的配置需要引用renren-dynamic-datasource
#dynamic: #dynamic:

View File

@ -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");
}
}