跳到主要内容

完整示例

流程 JSON

[
{
"id": "2cecfb40c68611ce",
"type": "tab",
"label": "流程 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "67cf29ef7dc34bcf",
"type": "http in",
"z": "2cecfb40c68611ce",
"name": "接口定义",
"url": "test_clouds_2025_01",
"method": "get",
"upload": false,
"swaggerDoc": "",
"advancedoptions": true,
"apiAuth": "public",
"x": 260,
"y": 140,
"wires": [
[
"14453828b7b9d3e8"
]
]
},
{
"id": "14453828b7b9d3e8",
"type": "http response",
"z": "2cecfb40c68611ce",
"name": "接口响应",
"statusCode": "",
"headers": {},
"commonTemplate": true,
"responseCode": 0,
"responseCodeType": "num",
"responseData": "{}",
"responseDataType": "json",
"responseMsg": "test_clouds_2025_01_res",
"responseMsgType": "str",
"x": 680,
"y": 140,
"wires": []
},
{
"id": "18a1d1390a001458",
"type": "http in",
"z": "2cecfb40c68611ce",
"name": "接口定义",
"url": "test_clouds_2025_02",
"method": "get",
"upload": false,
"swaggerDoc": "",
"advancedoptions": true,
"apiAuth": "public",
"x": 260,
"y": 280,
"wires": [
[
"97484d062d4d0f61"
]
]
},
{
"id": "97484d062d4d0f61",
"type": "http response",
"z": "2cecfb40c68611ce",
"name": "接口响应",
"statusCode": "",
"headers": {},
"commonTemplate": true,
"responseCode": 0,
"responseCodeType": "num",
"responseData": "{}",
"responseDataType": "json",
"responseMsg": "test_clouds_2025_02_res",
"responseMsgType": "str",
"x": 680,
"y": 280,
"wires": []
}
]

导入流程 JSON

image

将流程 JSON 复制粘贴并导入

点击部署

image

开启调试

image

调用接口

接口1

curl --location -k --request GET 'https://${host}:8301/noco-instance/default/public/test_clouds_2025_01'

{"code":0,"msg":"test_clouds_2025_01_res","data":"{}"}

接口2

curl --location -k --request GET 'https://${host}:8301/noco-instance/default/public/test_clouds_2025_02'

{"code":0,"msg":"test_clouds_2025_02_res","data":"{}"}

其中 host 为实际的魔方 IOT Gateway 地址,如生产环境内网为:172.16.0.3,143测试环境为:192.168.102.143