POST api/Control/Control
控制指令 - 路灯
Request Information
URI Parameters
None.
Body Parameters
M_Control| Name | Description | Type | Additional information |
|---|---|---|---|
| Type |
控制类型 //线路、开关、调光、查询、轮询、读取、修改 |
string |
Required |
| Group |
组号 //不填为所有,多组用逗号隔开 |
string |
Required |
| ControlModel |
控制模式 |
string |
Required |
| Target |
目标 |
M_Target |
Required |
| Params |
控制参数 |
M_Params |
Required |
| WaitAck |
是否等待设备应答 //true=等待,false=不等待 |
boolean |
Required |
Request Formats
application/json, text/json
Sample:
{
"Type": "sample string 1",
"Group": "sample string 2",
"ControlModel": "sample string 3",
"Target": {
"Type": "sample string 1",
"List": [
{
"SN": "sample string 1"
},
{
"SN": "sample string 1"
}
]
},
"Params": {
"ListMainC": [
{
"ID": 1,
"Value": "sample string 2"
},
{
"ID": 1,
"Value": "sample string 2"
}
],
"ListOneC": [
{
"ID": 1,
"Value": "sample string 2"
},
{
"ID": 1,
"Value": "sample string 2"
}
],
"ListPWM": [
{
"ID": 1,
"Value": "sample string 2"
},
{
"ID": 1,
"Value": "sample string 2"
}
],
"Value": 1
},
"WaitAck": true
}
application/xml, text/xml
Sample:
<M_Control xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebAPI.DP.Models">
<ControlModel>sample string 3</ControlModel>
<Group>sample string 2</Group>
<Params>
<ListMainC>
<M_MainCItem>
<ID>1</ID>
<Value>sample string 2</Value>
</M_MainCItem>
<M_MainCItem>
<ID>1</ID>
<Value>sample string 2</Value>
</M_MainCItem>
</ListMainC>
<ListOneC>
<M_OneCItem>
<ID>1</ID>
<Value>sample string 2</Value>
</M_OneCItem>
<M_OneCItem>
<ID>1</ID>
<Value>sample string 2</Value>
</M_OneCItem>
</ListOneC>
<ListPWM>
<M_PWMItem>
<ID>1</ID>
<Value>sample string 2</Value>
</M_PWMItem>
<M_PWMItem>
<ID>1</ID>
<Value>sample string 2</Value>
</M_PWMItem>
</ListPWM>
<Value>1</Value>
</Params>
<Target>
<List>
<SNItem>
<SN>sample string 1</SN>
</SNItem>
<SNItem>
<SN>sample string 1</SN>
</SNItem>
</List>
<Type>sample string 1</Type>
</Target>
<Type>sample string 1</Type>
<WaitAck>true</WaitAck>
</M_Control>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
M_Response| Name | Description | Type | Additional information |
|---|---|---|---|
| Contant |
内容,包含返回所需要的类 |
Object |
Required |
| Status |
状态 |
integer |
Required |
| Msg |
信息 |
string |
Required |
| Num |
数值,数据变动条数或增加时返回的ID |
integer |
Required |
Response Formats
application/json, text/json
Sample:
{
"Contant": {},
"Status": 2,
"Msg": "sample string 3",
"Num": 4
}
application/xml, text/xml
Sample:
<M_Response xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebAPI.DP.Models"> <Msg>sample string 3</Msg> <Num>4</Num> <Status>2</Status> <Contant /> </M_Response>