@@ -9,7 +9,7 @@ import { Descriptions, Radio, Space, Switch } from 'antd'; | |||
import dayjs from 'dayjs'; | |||
import { useState } from 'react'; | |||
const requeststr = '{ "code": "string", "name": "string", "typeName": "string", "uintName": "string" }'; | |||
const requeststr = '{ "isPush": true, "callbackUrl": "string", "storeIdList": [ "string" ], "deviceIdList": [ "string" ], "dataInfo": { "code": "string", "name": "string", "typeName": "string", "uintName": "string" } }'; | |||
const returnstr = '{ "statusCode": 0, "data": true, "succeeded": true, "errors": "string", "extras": "string", "timestamp": 0 }'; | |||
@@ -18,13 +18,19 @@ const publicrequestData = [ | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' } | |||
]; | |||
const requestData = [ | |||
{ attribute: 'key', type: 'string', isrequired: "是", explicate: '平台秘钥' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' }, | |||
{ attribute: 'isPush', type: 'bool', isrequired: "是", explicate: '是否下发到设备' }, | |||
{ attribute: 'callbackUrl', type: 'string', isrequired: "否", explicate: '回调地址 isPush为true时 必填' }, | |||
{ attribute: 'storeIdList', type: 'Array[string]', isrequired: "否", explicate: '场景列表 isPush为true时 storeIdList或deviceIdList 二选一必填 ' }, | |||
{ attribute: 'deviceIdList', type: 'Array[string]', isrequired: "否", explicate: '设备列表 isPush为true时 storeIdList或deviceIdList 二选一必填 ' }, | |||
{ attribute: 'dataInfo', type: 'Array[object]', isrequired: "是", explicate: '请求接口的业务参数' }, | |||
]; | |||
const requestInfoData = [ | |||
{ attribute: 'code', type: 'string', isrequired: "是", explicate: '物料Code' }, | |||
{ attribute: 'name', type: 'string', isrequired: "是", explicate: '物料名称' }, | |||
{ attribute: 'typeName', type: 'string', isrequired: "是", explicate: '物料类型名称' }, | |||
{ attribute: 'uintName', type: 'string', isrequired: "是", explicate: '物料单位名称' }, | |||
]; | |||
const returnData = [ | |||
{ attribute: 'statusCode', type: 'int', isrequired: "是", explicate: '状态码' }, | |||
{ attribute: 'data', type: 'bool', isrequired: "否", explicate: '返回具体数据' }, | |||
@@ -34,9 +40,6 @@ const returnData = [ | |||
{ attribute: 'timestamp', type: 'long', isrequired: "是", explicate: '时间戳' }, | |||
]; | |||
const requestColumns = [ | |||
{ | |||
title: '属性', | |||
@@ -118,12 +121,17 @@ const App = () => ( | |||
</Paragraph> | |||
<Title level={4}>请求参数</Title> | |||
Body | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={requestData} /> | |||
<Table pagination={{ position: ["none"] }} columns={requestColumns} | |||
expandable={{ | |||
expandedRowRender: (record) => ( | |||
<Table columns={requestColumns} dataSource={requestInfoData} pagination={false} /> | |||
), | |||
rowExpandable: (record) => record.attribute == 'dataInfo', | |||
}} | |||
dataSource={requestData} /> | |||
</Paragraph> | |||
<Title level={4}>返回参数</Title> | |||
@@ -17,9 +17,19 @@ const publicrequestData = [ | |||
{ attribute: 'key', type: 'string', isrequired: "是", explicate: '平台秘钥' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' } | |||
]; | |||
const requestData = [ | |||
{ attribute: 'isPush', type: 'bool', isrequired: "是", explicate: '是否下发到设备' }, | |||
{ attribute: 'callbackUrl', type: 'string', isrequired: "否", explicate: '回调地址 isPush为true时 必填' }, | |||
{ attribute: 'storeIdList', type: 'Array[string]', isrequired: "否", explicate: '场景列表 isPush为true时 storeIdList或deviceIdList 二选一必填 ' }, | |||
{ attribute: 'deviceIdList', type: 'Array[string]', isrequired: "否", explicate: '设备列表 isPush为true时 storeIdList或deviceIdList 二选一必填 ' }, | |||
{ attribute: 'dataInfo', type: 'Array[object]', isrequired: "是", explicate: '请求接口的业务参数' }, | |||
]; | |||
const requestInfoData = [ | |||
{ attribute: 'materialId', type: 'string', isrequired: "是", explicate: '物料Id' }, | |||
]; | |||
const returnData = [ | |||
{ attribute: 'statusCode', type: 'int', isrequired: "是", explicate: '状态码' }, | |||
{ attribute: 'data', type: 'bool', isrequired: "否", explicate: '返回具体数据' }, | |||
@@ -29,9 +39,6 @@ const returnData = [ | |||
{ attribute: 'timestamp', type: 'long', isrequired: "是", explicate: '时间戳' }, | |||
]; | |||
const requestColumns = [ | |||
{ | |||
title: '属性', | |||
@@ -115,8 +122,14 @@ const App = () => ( | |||
<Title level={4}>请求参数</Title> | |||
Body | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={requestData} /> | |||
<Table pagination={{ position: ["none"] }} columns={requestColumns} | |||
expandable={{ | |||
expandedRowRender: (record) => ( | |||
<Table columns={requestColumns} dataSource={requestInfoData} pagination={false} /> | |||
), | |||
rowExpandable: (record) => record.attribute == 'dataInfo', | |||
}} | |||
dataSource={requestData} /> | |||
</Paragraph> | |||
<Title level={4}>返回参数</Title> | |||
@@ -17,12 +17,24 @@ const publicrequestData = [ | |||
{ attribute: 'key', type: 'string', isrequired: "是", explicate: '平台秘钥' }, | |||
{ attribute: 'sign', type: 'string', isrequired: "是", explicate: '签名,详见 安全规则=>签名算法' } | |||
]; | |||
const requestData = [ | |||
{ attribute: 'isPush', type: 'bool', isrequired: "是", explicate: '是否下发到设备' }, | |||
{ attribute: 'callbackUrl', type: 'string', isrequired: "否", explicate: '回调地址 isPush为true时 必填' }, | |||
{ attribute: 'storeIdList', type: 'Array[string]', isrequired: "否", explicate: '场景列表 isPush为true时 storeIdList或deviceIdList 二选一必填 ' }, | |||
{ attribute: 'deviceIdList', type: 'Array[string]', isrequired: "否", explicate: '设备列表 isPush为true时 storeIdList或deviceIdList 二选一必填 ' }, | |||
{ attribute: 'dataInfo', type: 'Array[object]', isrequired: "是", explicate: '请求接口的业务参数' }, | |||
]; | |||
const requestInfoData = [ | |||
{ attribute: 'id', type: 'string', isrequired: "是", explicate: '物料Code' }, | |||
{ attribute: 'code', type: 'string', isrequired: "是", explicate: '物料Code' }, | |||
{ attribute: 'name', type: 'string', isrequired: "是", explicate: '物料名称' }, | |||
{ attribute: 'typeName', type: 'string', isrequired: "是", explicate: '物料类型名称' }, | |||
{ attribute: 'uintName', type: 'string', isrequired: "是", explicate: '物料单位名称' }, | |||
]; | |||
const returnData = [ | |||
{ attribute: 'statusCode', type: 'int', isrequired: "是", explicate: '状态码' }, | |||
{ attribute: 'data', type: 'bool', isrequired: "否", explicate: '返回具体数据' }, | |||
@@ -118,8 +130,14 @@ const App = () => ( | |||
<Title level={4}>请求参数</Title> | |||
Body | |||
<Paragraph> | |||
<Table pagination={{ position: ["none"] }} | |||
columns={requestColumns} dataSource={requestData} /> | |||
<Table pagination={{ position: ["none"] }} columns={requestColumns} | |||
expandable={{ | |||
expandedRowRender: (record) => ( | |||
<Table columns={requestColumns} dataSource={requestInfoData} pagination={false} /> | |||
), | |||
rowExpandable: (record) => record.attribute == 'dataInfo', | |||
}} | |||
dataSource={requestData} /> | |||
</Paragraph> | |||
<Title level={4}>返回参数</Title> | |||
@@ -138,7 +156,7 @@ const App = () => ( | |||
<blockquote>{"请求头添加如下信息"}</blockquote> | |||
<pre>{' "key: a92370b8-a633-47e6-9662-7755b8fe9ee4" \r\n "sign: 987DA29D82DE9A65F4DFB986170F5272" '}</pre> | |||
</Paragraph> | |||
<Title level={4}>请求数据示例</Title> | |||
<Paragraph> | |||
<blockquote>{"示例说明: post请求"}</blockquote> | |||