neo-cmp-cli 1.13.11 → 1.13.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/antd-custom-cmp-template/package.json +1 -1
- package/template/asset-manage-template/package.json +1 -1
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/empty-custom-cmp-template/package.json +1 -1
- package/template/map-custom-cmp-template/package.json +1 -1
- package/template/neo-bi-cmps/docs/gartner-pipeline-apis.md +279 -0
- package/template/neo-bi-cmps/docs/gartner-pipeline-prd.md +389 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/SKILL.md +188 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/references/01-Trigger/345/274/200/345/217/221.md +183 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/references/02-/350/207/252/345/256/232/344/271/211API/345/274/200/345/217/221.md +196 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/references/03-SDK/345/267/245/345/205/267/347/261/273/346/216/245/345/217/243.md +346 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/references/04-/350/256/241/345/210/222/344/275/234/344/270/232/345/274/200/345/217/221.md +188 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/references/05-/351/241/265/351/235/242/345/274/200/345/217/221.md +293 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/references/06-/346/265/201/347/250/213/346/211/251/345/261/225/345/274/200/345/217/221.md +175 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/references/PaaS/345/271/263/345/217/260/345/274/200/345/217/221/346/211/213/345/206/214/350/247/243/350/257/273.md +313 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/references/auth-config.md +77 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/scripts/deploy_server_script.py +118 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/scripts/download_server_script.py +74 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/scripts/gen_entity_desc.py +69 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/scripts/gen_entitylist.py +87 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/scripts/query_crm.py +65 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/scripts/uninstall_server_script.py +48 -0
- package/template/neo-bi-cmps/docs/neo-backend-dev/scripts/update_model_jar.py +49 -0
- package/template/neo-bi-cmps/docs/neo-frontend-dev/SKILL.md +138 -0
- package/template/neo-bi-cmps/docs/neo-frontend-dev/references/auth-config.md +77 -0
- package/template/neo-bi-cmps/docs/neo-frontend-dev/references/component-dev.md +205 -0
- package/template/neo-bi-cmps/docs/neo-frontend-dev/references/entityTable-example.md +167 -0
- package/template/neo-bi-cmps/docs/neo-frontend-dev/references/templates.md +38 -0
- package/template/neo-bi-cmps/docs/neo-frontend-dev/scripts/gen_entity_desc.py +69 -0
- package/template/neo-bi-cmps/docs/neo-frontend-dev/scripts/gen_entitylist.py +87 -0
- package/template/neo-bi-cmps/docs/neo-frontend-dev/scripts/query_crm.py +65 -0
- package/template/neo-bi-cmps/docs/prototype-pipeline-forecasting.html +2453 -0
- package/template/neo-bi-cmps/docs//350/264/246/345/217/267/347/233/270/345/205/263/344/277/241/346/201/257.md +10 -0
- package/template/neo-bi-cmps/package.json +1 -1
- package/template/neo-custom-cmp-template/package.json +1 -1
- package/template/neo-custom-cmp-template/src/components/entityForm__c/index.tsx +48 -54
- package/template/neo-custom-cmp-template/src/components/entityForm__c/model.ts +1 -1
- package/template/neo-custom-cmp-template/src/components/entityForm__c/style.scss +80 -77
- package/template/neo-h5-cmps/package.json +1 -1
- package/template/neo-order-cmps/package.json +1 -1
- package/template/neo-web-entity-grid/package.json +1 -1
- package/template/neo-web-entity-grid/src/components/createForm__c/index.tsx +46 -54
- package/template/neo-web-entity-grid/src/components/createForm__c/resetAntd.scss +74 -0
- package/template/neo-web-entity-grid/src/components/createForm__c/style.scss +81 -152
- package/template/neo-web-entity-grid/src/components/searchForm__c/index.tsx +47 -52
- package/template/neo-web-entity-grid/src/components/searchForm__c/style.scss +60 -74
- package/template/neo-web-form/package.json +1 -1
- package/template/neo-web-form/src/components/batchAddTable__c/index.tsx +16 -7
- package/template/neo-web-form/src/components/batchAddTable__c/style.scss +14 -0
- package/template/neo-web-form/src/components/batchAddTable__c/tableModal.scss +60 -13
- package/template/react-custom-cmp-template/package.json +1 -1
- package/template/react-ts-custom-cmp-template/package.json +1 -1
- package/template/vue2-custom-cmp-template/package.json +1 -1
package/template/neo-bi-cmps/docs/neo-backend-dev/references/01-Trigger/345/274/200/345/217/221.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# 技能包:Trigger 开发
|
|
2
|
+
|
|
3
|
+
## 概述
|
|
4
|
+
|
|
5
|
+
Trigger(触发器)用于在业务数据操作保存至数据库之前(before)或之后(after)增加自定义业务逻辑。
|
|
6
|
+
|
|
7
|
+
## 适用场景
|
|
8
|
+
|
|
9
|
+
- 创建数据时根据业务规则校验数据
|
|
10
|
+
- 编辑数据后自动同步至第三方系统
|
|
11
|
+
- 数据保存前自动填充/修改字段值
|
|
12
|
+
- 批量数据的查重校验
|
|
13
|
+
|
|
14
|
+
## 支持的操作
|
|
15
|
+
|
|
16
|
+
| 操作 | 说明 |
|
|
17
|
+
|------|------|
|
|
18
|
+
| add | 创建 |
|
|
19
|
+
| update | 更新 |
|
|
20
|
+
| delete | 删除 |
|
|
21
|
+
| transfer | 转移 |
|
|
22
|
+
| lock | 锁定 |
|
|
23
|
+
| unlock | 解锁 |
|
|
24
|
+
| recover | 从回收站恢复 |
|
|
25
|
+
|
|
26
|
+
## 代码模板
|
|
27
|
+
|
|
28
|
+
### 前置 Trigger(before)
|
|
29
|
+
|
|
30
|
+
```java
|
|
31
|
+
package other.{company}.{project};
|
|
32
|
+
|
|
33
|
+
import com.rkhd.platform.sdk.exception.ScriptBusinessException;
|
|
34
|
+
import com.rkhd.platform.sdk.log.Logger;
|
|
35
|
+
import com.rkhd.platform.sdk.log.LoggerFactory;
|
|
36
|
+
import com.rkhd.platform.sdk.model.XObject;
|
|
37
|
+
import com.rkhd.platform.sdk.trigger.*;
|
|
38
|
+
|
|
39
|
+
import java.util.ArrayList;
|
|
40
|
+
import java.util.List;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 前置 Trigger 模板
|
|
44
|
+
* 在数据保存到数据库之前执行,可修改数据或阻止保存
|
|
45
|
+
*/
|
|
46
|
+
public class BeforeTriggerTemplate implements Trigger {
|
|
47
|
+
|
|
48
|
+
private static final Logger LOG = LoggerFactory.getLogger();
|
|
49
|
+
|
|
50
|
+
@Override
|
|
51
|
+
public TriggerResponse execute(TriggerRequest request) throws ScriptBusinessException {
|
|
52
|
+
LOG.info("BeforeTrigger 开始执行, 操作: " + request.getOperate());
|
|
53
|
+
|
|
54
|
+
List<DataResult> results = new ArrayList<>();
|
|
55
|
+
|
|
56
|
+
for (XObject xObject : request.getDataList()) {
|
|
57
|
+
try {
|
|
58
|
+
// === 在此编写业务逻辑 ===
|
|
59
|
+
|
|
60
|
+
// 示例:修改字段值
|
|
61
|
+
// xObject.setAttribute("fieldApiName__c", "newValue");
|
|
62
|
+
|
|
63
|
+
// 示例:校验数据,不通过则阻止保存
|
|
64
|
+
// String name = xObject.getAttribute("name");
|
|
65
|
+
// if (name == null || name.isEmpty()) {
|
|
66
|
+
// results.add(new DataResult(false, "名称不能为空", xObject));
|
|
67
|
+
// if (!request.getPartialSuccess()) {
|
|
68
|
+
// return new TriggerResponse(false, "数据校验失败", results);
|
|
69
|
+
// }
|
|
70
|
+
// continue;
|
|
71
|
+
// }
|
|
72
|
+
|
|
73
|
+
results.add(new DataResult(true, "", xObject));
|
|
74
|
+
} catch (Exception e) {
|
|
75
|
+
LOG.error("处理数据异常: " + e.getMessage());
|
|
76
|
+
results.add(new DataResult(false, e.getMessage(), xObject));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return new TriggerResponse(true, "", results);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 后置 Trigger(after)
|
|
86
|
+
|
|
87
|
+
```java
|
|
88
|
+
package other.{company}.{project};
|
|
89
|
+
|
|
90
|
+
import com.rkhd.platform.sdk.exception.ScriptBusinessException;
|
|
91
|
+
import com.rkhd.platform.sdk.log.Logger;
|
|
92
|
+
import com.rkhd.platform.sdk.log.LoggerFactory;
|
|
93
|
+
import com.rkhd.platform.sdk.model.XObject;
|
|
94
|
+
import com.rkhd.platform.sdk.trigger.*;
|
|
95
|
+
|
|
96
|
+
import java.util.ArrayList;
|
|
97
|
+
import java.util.List;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 后置 Trigger 模板
|
|
101
|
+
* 在数据保存到数据库之后执行,可用于数据同步、通知等
|
|
102
|
+
*/
|
|
103
|
+
public class AfterTriggerTemplate implements Trigger {
|
|
104
|
+
|
|
105
|
+
private static final Logger LOG = LoggerFactory.getLogger();
|
|
106
|
+
|
|
107
|
+
@Override
|
|
108
|
+
public TriggerResponse execute(TriggerRequest request) throws ScriptBusinessException {
|
|
109
|
+
LOG.info("AfterTrigger 开始执行, 操作: " + request.getOperate());
|
|
110
|
+
|
|
111
|
+
List<DataResult> results = new ArrayList<>();
|
|
112
|
+
|
|
113
|
+
for (XObject xObject : request.getDataList()) {
|
|
114
|
+
try {
|
|
115
|
+
LOG.info("处理数据 ID: " + xObject.getId());
|
|
116
|
+
|
|
117
|
+
// === 在此编写业务逻辑 ===
|
|
118
|
+
|
|
119
|
+
// 示例:同步数据到外部系统
|
|
120
|
+
// syncToExternalSystem(xObject);
|
|
121
|
+
|
|
122
|
+
results.add(new DataResult(true, "成功", xObject));
|
|
123
|
+
} catch (Exception e) {
|
|
124
|
+
LOG.error("处理数据异常: " + e.getMessage());
|
|
125
|
+
results.add(new DataResult(false, e.getMessage(), xObject));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return new TriggerResponse(true, "成功", results);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 使用 TriggerContext 在 before/after 间传参
|
|
135
|
+
|
|
136
|
+
```java
|
|
137
|
+
// Before Trigger 中设置上下文
|
|
138
|
+
TriggerContext triggerContext = new TriggerContext();
|
|
139
|
+
triggerContext.set("key", "value");
|
|
140
|
+
return new TriggerResponse(true, "", results, triggerContext);
|
|
141
|
+
|
|
142
|
+
// After Trigger 中获取上下文
|
|
143
|
+
TriggerContext triggerContext = request.getTriggerContext();
|
|
144
|
+
String value = triggerContext.get("key");
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## 配置文件模板
|
|
148
|
+
|
|
149
|
+
scriptTrigger.xml:
|
|
150
|
+
|
|
151
|
+
```xml
|
|
152
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
153
|
+
<configs>
|
|
154
|
+
<config>
|
|
155
|
+
<!-- 前置 Trigger -->
|
|
156
|
+
<trigger>
|
|
157
|
+
<object>{objectApiKey}__c</object>
|
|
158
|
+
<operate>add</operate>
|
|
159
|
+
<position>before</position>
|
|
160
|
+
<order>1</order>
|
|
161
|
+
<class>other.{company}.{project}.trigger.BeforeTriggerTemplate</class>
|
|
162
|
+
</trigger>
|
|
163
|
+
<!-- 后置 Trigger -->
|
|
164
|
+
<trigger>
|
|
165
|
+
<object>{objectApiKey}__c</object>
|
|
166
|
+
<operate>add</operate>
|
|
167
|
+
<position>after</position>
|
|
168
|
+
<order>1</order>
|
|
169
|
+
<class>other.{company}.{project}.trigger.AfterTriggerTemplate</class>
|
|
170
|
+
</trigger>
|
|
171
|
+
</config>
|
|
172
|
+
</configs>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## 开发注意事项
|
|
176
|
+
|
|
177
|
+
1. **类名不能以 "test" 结尾**
|
|
178
|
+
2. **Java 文件必须 UTF-8 无 BOM 编码**
|
|
179
|
+
3. **DataResult 数量必须与 TriggerRequest 数据量一致**
|
|
180
|
+
4. **return 必须返回 TriggerResponse 对象**
|
|
181
|
+
5. **Package 名称必须三级且以 other 开始**(如 `other.xsy.demo`),不能生成4级或以上的包名
|
|
182
|
+
6. **同步脚本最大运行时长 15 秒**,超时会被自动终止
|
|
183
|
+
7. **API 调用默认不触发 Trigger**
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# 技能包:自定义 API 开发
|
|
2
|
+
|
|
3
|
+
## 概述
|
|
4
|
+
|
|
5
|
+
自定义 API 允许开发者根据业务需求封装自定义的 REST API 接口,供外部系统或页面代码调用。
|
|
6
|
+
|
|
7
|
+
## 适用场景
|
|
8
|
+
|
|
9
|
+
- 封装复杂的业务查询逻辑为 API
|
|
10
|
+
- 为外部系统提供数据集成接口
|
|
11
|
+
- 为自定义页面提供后端数据服务
|
|
12
|
+
- 实现跨对象的复杂数据操作
|
|
13
|
+
|
|
14
|
+
## 代码模板
|
|
15
|
+
|
|
16
|
+
### GET 请求 API
|
|
17
|
+
|
|
18
|
+
```java
|
|
19
|
+
package other.{company}.{project};
|
|
20
|
+
|
|
21
|
+
import com.rkhd.platform.sdk.api.annotations.RequestMethod;
|
|
22
|
+
import com.rkhd.platform.sdk.api.annotations.RestApi;
|
|
23
|
+
import com.rkhd.platform.sdk.api.annotations.RestMapping;
|
|
24
|
+
import com.rkhd.platform.sdk.api.annotations.RestQueryParam;
|
|
25
|
+
import com.rkhd.platform.sdk.exception.ApiEntityServiceException;
|
|
26
|
+
import com.rkhd.platform.sdk.log.Logger;
|
|
27
|
+
import com.rkhd.platform.sdk.log.LoggerFactory;
|
|
28
|
+
import com.rkhd.platform.sdk.model.QueryResult;
|
|
29
|
+
import com.rkhd.platform.sdk.model.XObject;
|
|
30
|
+
import com.rkhd.platform.sdk.service.XObjectService;
|
|
31
|
+
|
|
32
|
+
import com.alibaba.fastjson.JSONArray;
|
|
33
|
+
import com.alibaba.fastjson.JSONObject;
|
|
34
|
+
|
|
35
|
+
import java.util.List;
|
|
36
|
+
|
|
37
|
+
@RestApi(baseUrl = "/custom")
|
|
38
|
+
public class CustomGetApi {
|
|
39
|
+
|
|
40
|
+
private Logger log = LoggerFactory.getLogger();
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* GET 请求示例
|
|
44
|
+
* 访问路径: /rest/data/v2.0/scripts/api/getData?keyword=xxx
|
|
45
|
+
*/
|
|
46
|
+
@RestMapping(value = "/getData", method = RequestMethod.GET)
|
|
47
|
+
public String handleGet(@RestQueryParam("keyword") String keyword)
|
|
48
|
+
throws ApiEntityServiceException {
|
|
49
|
+
try {
|
|
50
|
+
log.info("收到查询请求, keyword: " + keyword);
|
|
51
|
+
|
|
52
|
+
// 查询数据
|
|
53
|
+
String sql = "SELECT id, name FROM account WHERE name LIKE '%" + keyword + "%' LIMIT 10";
|
|
54
|
+
QueryResult queryResult = XObjectService.instance().query(sql);
|
|
55
|
+
List<XObject> records = queryResult.getRecords();
|
|
56
|
+
|
|
57
|
+
// 构建返回结果
|
|
58
|
+
JSONObject result = new JSONObject();
|
|
59
|
+
JSONArray dataArray = new JSONArray();
|
|
60
|
+
|
|
61
|
+
if (records != null) {
|
|
62
|
+
for (XObject record : records) {
|
|
63
|
+
JSONObject item = new JSONObject();
|
|
64
|
+
item.put("id", record.getId());
|
|
65
|
+
item.put("name", record.getAttribute("name"));
|
|
66
|
+
dataArray.add(item);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
result.put("code", "200");
|
|
71
|
+
result.put("data", dataArray);
|
|
72
|
+
result.put("total", dataArray.size());
|
|
73
|
+
return result.toJSONString();
|
|
74
|
+
|
|
75
|
+
} catch (Exception e) {
|
|
76
|
+
log.error("查询异常: " + e.getMessage());
|
|
77
|
+
JSONObject error = new JSONObject();
|
|
78
|
+
error.put("code", "500");
|
|
79
|
+
error.put("message", e.getMessage());
|
|
80
|
+
return error.toJSONString();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### POST 请求 API
|
|
87
|
+
|
|
88
|
+
```java
|
|
89
|
+
package other.{company}.{project};
|
|
90
|
+
|
|
91
|
+
import com.rkhd.platform.sdk.api.annotations.RequestMethod;
|
|
92
|
+
import com.rkhd.platform.sdk.api.annotations.RestApi;
|
|
93
|
+
import com.rkhd.platform.sdk.api.annotations.RestMapping;
|
|
94
|
+
import com.rkhd.platform.sdk.api.annotations.RestBeanParam;
|
|
95
|
+
import com.rkhd.platform.sdk.exception.ApiEntityServiceException;
|
|
96
|
+
import com.rkhd.platform.sdk.log.Logger;
|
|
97
|
+
import com.rkhd.platform.sdk.log.LoggerFactory;
|
|
98
|
+
import com.rkhd.platform.sdk.model.XObject;
|
|
99
|
+
import com.rkhd.platform.sdk.service.XObjectService;
|
|
100
|
+
|
|
101
|
+
import com.alibaba.fastjson.JSON;
|
|
102
|
+
import com.alibaba.fastjson.JSONObject;
|
|
103
|
+
|
|
104
|
+
@RestApi(baseUrl = "/custom")
|
|
105
|
+
public class CustomPostApi {
|
|
106
|
+
|
|
107
|
+
private Logger log = LoggerFactory.getLogger();
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* POST 请求示例
|
|
111
|
+
* 访问路径: /rest/data/v2.0/scripts/api/createData
|
|
112
|
+
* Content-Type: application/json
|
|
113
|
+
* 注意:POST方法参数必须使用 @RestBeanParam(name="xxx") 注解
|
|
114
|
+
*/
|
|
115
|
+
@RestMapping(value = "/createData", method = RequestMethod.POST)
|
|
116
|
+
public String handlePost(@RestBeanParam(name = "requestBody") String requestBody)
|
|
117
|
+
throws ApiEntityServiceException {
|
|
118
|
+
try {
|
|
119
|
+
log.info("收到创建请求, body: " + requestBody);
|
|
120
|
+
|
|
121
|
+
JSONObject body = JSON.parseObject(requestBody);
|
|
122
|
+
|
|
123
|
+
// 创建数据
|
|
124
|
+
// XObject xObject = new CustomEntity1__c();
|
|
125
|
+
// xObject.setAttribute("name", requestBody.getString("name"));
|
|
126
|
+
// xObject.setAttribute("entityType", MetadataService.instance()
|
|
127
|
+
// .getBusiType(xObject.getApiKey(), "defaultBusiType").getId());
|
|
128
|
+
// XObjectService.instance().insert(xObject);
|
|
129
|
+
|
|
130
|
+
JSONObject result = new JSONObject();
|
|
131
|
+
result.put("code", "200");
|
|
132
|
+
result.put("message", "创建成功");
|
|
133
|
+
return result.toJSONString();
|
|
134
|
+
|
|
135
|
+
} catch (Exception e) {
|
|
136
|
+
log.error("创建异常: " + e.getMessage());
|
|
137
|
+
JSONObject error = new JSONObject();
|
|
138
|
+
error.put("code", "500");
|
|
139
|
+
error.put("message", e.getMessage());
|
|
140
|
+
return error.toJSONString();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## 配置文件模板
|
|
147
|
+
|
|
148
|
+
scriptTrigger.xml:
|
|
149
|
+
|
|
150
|
+
```xml
|
|
151
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
152
|
+
<configs>
|
|
153
|
+
<config>
|
|
154
|
+
<customApi>
|
|
155
|
+
<class>other.{company}.{project}.api.CustomGetApi</class>
|
|
156
|
+
</customApi>
|
|
157
|
+
<customApi>
|
|
158
|
+
<class>other.{company}.{project}.api.CustomPostApi</class>
|
|
159
|
+
</customApi>
|
|
160
|
+
</config>
|
|
161
|
+
</configs>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## 调用方式
|
|
165
|
+
|
|
166
|
+
### 外部调用
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
GET https://api.xiaoshouyi.com/rest/data/v2.0/scripts/api/getData?keyword=xxx
|
|
170
|
+
POST https://api.xiaoshouyi.com/rest/data/v2.0/scripts/api/createData
|
|
171
|
+
|
|
172
|
+
Header:
|
|
173
|
+
Authorization: Bearer {access_token}
|
|
174
|
+
Content-Type: application/json
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 页面代码中调用(NeoLappSdk.js)
|
|
178
|
+
|
|
179
|
+
```javascript
|
|
180
|
+
lapp.connection.invoke({
|
|
181
|
+
url: '/rest/data/v2.0/scripts/api/getData?keyword=test',
|
|
182
|
+
method: 'GET'
|
|
183
|
+
}).then(
|
|
184
|
+
res => { console.log(res); },
|
|
185
|
+
err => { console.log(err); }
|
|
186
|
+
)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## 注意事项
|
|
190
|
+
|
|
191
|
+
1. 自定义 API 入参最大值 **15 MB**
|
|
192
|
+
2. 外部并发调用限制:用户级 **15 次/秒**,租户级 **50 次/秒**
|
|
193
|
+
3. 第三方包仅支持 **fastJson** 和 **commons-lang**
|
|
194
|
+
4. POST 方法参数必须使用 `@RestBeanParam(name="xxx")` 注解,不能直接用裸参数
|
|
195
|
+
5. `QueryResult.getRecords()` 返回 `List<XObject>`,没有 `getTotalSize()` 方法,需通过 `records.size()` 或单独 count 查询获取总数
|
|
196
|
+
6. Package 名称必须三级且以 other 开始(如 `other.xsy.pipeline`),不能生成四级包名
|