规范化后的skill

This commit is contained in:
2026-06-01 14:37:23 +08:00
parent 3d8df9b51f
commit 8dc6e5ab06
14 changed files with 1107 additions and 1139 deletions
@@ -0,0 +1,10 @@
# Example Prompt: Create Workflow API Documentation
请帮我生成一份 E10 创建“用车审批流程”流程实例的接口文档。
背景:
- 读者是外部系统开发人员。
- 文档格式为 Markdown。
- 需要包含 OAuth2 access_token 获取流程。
- 请求示例中不要使用 E10 内部用户 ID 或部门 ID,使用工号和部门编号。
- 输出文件名:E10_用车审批流程_API.md
+36
View File
@@ -0,0 +1,36 @@
{
"workflowName": "用车审批流程",
"workflowId": "<WORKFLOW_ID_INTERNAL_ONLY>",
"formId": "<FORM_ID_INTERNAL_ONLY>",
"mainFields": [
{
"title": "申请人",
"dataKey": "applicant",
"type": "Employee",
"required": "需确认",
"businessGroup": "申请信息"
},
{
"title": "申请部门",
"dataKey": "department",
"type": "Department",
"required": "需确认",
"businessGroup": "申请信息"
},
{
"title": "用车日期",
"dataKey": "vehicleDate",
"type": "Date",
"required": "需确认",
"businessGroup": "用车信息"
},
{
"title": "用车事由",
"dataKey": "reason",
"type": "TextArea",
"required": "需确认",
"businessGroup": "用车信息"
}
],
"detailTables": []
}
+87
View File
@@ -0,0 +1,87 @@
# 创建用车审批流程实例接口
## 接口说明
该接口用于外部系统向 E10 发起用车审批流程实例。
## 前置条件
### 获取 access_token
E10 OpenAPI 使用 OAuth2 code 换取 access_token 的方式。业务接口调用时,`access_token` 作为请求体参数传入,不通过 HTTP `Authorization` Header 传入。
#### Step 1: 获取 code
- **URL**: `POST https://<E10_BASE>/papi/openapi/oauth2/authorize`
- **Content-Type**: `application/json`
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| `corpid` | 是 | String | 企业 corpId。 |
| `response_type` | 是 | String | 固定为 `code`。 |
| `state` | 是 | String | 自定义参数。 |
#### Step 2: code 换 access_token
- **URL**: `POST https://<E10_BASE>/papi/openapi/oauth2/access_token`
- **Content-Type**: `application/json`
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| `app_key` | 是 | String | 应用 key。 |
| `app_secret` | 是 | String | 应用密钥。 |
| `grant_type` | 是 | String | 固定为 `authorization_code`。 |
| `code` | 是 | String | 授权 code。 |
## 身份标识转换
外部系统应使用工号和部门编号等外部稳定标识传值。人员字段使用 `userType: "JOB_NUM"`,部门字段使用 `deptType: "DEPT_CODE"`
## 请求信息
- **URL**: `POST https://<E10_BASE>/papi/openapi/<WORKFLOW_INSTANCE_PATH>`
- **Content-Type**: `application/json`
## 请求示例
### 最小请求
```bash
curl -X POST "https://<E10_BASE>/papi/openapi/<WORKFLOW_INSTANCE_PATH>" \
-H "Content-Type: application/json" \
-d '{
"access_token": "<ACCESS_TOKEN>",
"userType": "JOB_NUM",
"deptType": "DEPT_CODE",
"formData": {
"dataDetails": [
{
"dataKey": "applicant",
"dataOptions": [
{"type": "resource", "value": "EMP001", "userType": "JOB_NUM"}
]
},
{
"dataKey": "vehicleDate",
"content": "2026-06-01"
}
]
}
}'
```
## 流程字段说明
### 申请信息
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| 申请人 | Employee | 需确认 | 人员字段,通过 `dataOptions` 传值,建议使用工号。 |
| 申请部门 | Department | 需确认 | 部门字段,通过 `dataOptions` 传值,建议使用部门编号。 |
### 用车信息
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| 用车日期 | Date | 需确认 | 日期字符串。 |
| 用车事由 | TextArea | 需确认 | 用车原因说明。 |