获取适配器参数配置列表

maven 引入pai-api-apistore

<dependency>
    <groupId>cn.flyrise</groupId>
    <artifactId>pai-api-apistore</artifactId>
</dependency>

注入service

    @Resource
    private IApistoreTenantService apistoreTenantService;

findParamListByAppCode方法

请求参数名称 请求参数类型 说明 是否可为空
appCode String 应用套件标识
parkId String 园区id
from String 内部标识

from的值对应SecurityConstants.FROM_IN

示例

//按园区区分   
apistoreTenantService.findParamListByAppCode(appCode,parkId,SecurityConstants.FROM_IN);

//默认配置,不按园区区分
apistoreTenantService.findParamListByAppCode(appCode,null,SecurityConstants.FROM_IN);

findParamListByAppCode方法(V1.3版本)

请求参数名称 请求参数类型 说明 是否可为空
appCode String 应用套件标识
entId String 企业id
parkId String 园区id
from String 内部标识

示例

//按园区区分   
apistoreTenantService.findParamListByAppCode(appCode,entId,parkId,SecurityConstants.FROM_IN);

//默认配置,不按园区区分
apistoreTenantService.findParamListByAppCode(appCode,entId,null,SecurityConstants.FROM_IN);

响应数据结构

这里id的值对应的就是configId的值

同域名请求失败解决

适配器代码中,如果需要请求中台一些服务接口的,请按以下进行调整:

其中pai-xxx为对应的工程名称,类似这些参数建议优先考虑做为Nacos配置

http://pai.flyrise.cn 改成 http://pai-xxx.test.svc.cluster.local:8080

获取token的地址改为如下:

http://pai-auth:8080/oauth/token

文档更新时间: 2022-06-14 08:38   作者:姚连洲