POST api/Device/Type/DataMap/Add

向系统中添加一个型号物理量对应关系的记录。

Request Information

URI Parameters

None.

Body Parameters

Dev_Type_DataMapTableItem
NameDescriptionTypeAdditional information
TypeID

型号ID TypeID Char(4) FK 型号的内部编码。

string

Required

Max length: 4

Min length: 4

DataId

自增长ID PK

integer

None.

UnitName

物理量单位

string

Max length: 10

DataInnerId

协议中的物理量ID DataInnerId int PK 数据量的ID,如0表示天气,1表示室外温度。

integer

Required

DataInnerName

协议中的物理量名

string

Required

DataType

数据类型 DataType char(1) NN D数值量,E枚举量,S字符量

string

Max length: 1

Min length: 1

DataTrigger

触发器 DataTrigger varchar(100) 如果对应的数据更新需要启动触发的,在这里定义。

string

Max length: 100

Request Formats

application/json, text/json

Sample:
{
  "TypeID": "sample string 1",
  "DataId": 2,
  "UnitName": "sample string 3",
  "DataInnerId": 4,
  "DataInnerName": "sample string 5",
  "DataType": "sample string 6",
  "DataTrigger": "sample string 7"
}

application/xml, text/xml

Sample:
<Dev_Type_DataMapTableItem xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer.CleverFarmer">
  <DataId>2</DataId>
  <DataInnerId>4</DataInnerId>
  <DataInnerName>sample string 5</DataInnerName>
  <DataTrigger>sample string 7</DataTrigger>
  <DataType>sample string 6</DataType>
  <TypeID>sample string 1</TypeID>
  <UnitName>sample string 3</UnitName>
</Dev_Type_DataMapTableItem>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'Dev_Type_DataMapTableItem'.

application/bson

Sample:
Binary JSON content. See http://bsonspec.org for details.

Response Information

Resource Description

向系统中添加一个型号物理量对应关系的记录。

CommonOperationResult
NameDescriptionTypeAdditional information
errcode

错误代码,通常0表示成功,其他值表示错误。

integer

None.

errmsg

错误描述,当errcode不为零时,此值可以用于呈现给用户。

string

None.

tag

操作同时,服务器端需要返回的其他值。

string

None.

Response Formats

application/json, text/json

Sample:
{
  "errcode": 1,
  "errmsg": "sample string 2",
  "tag": "sample string 3"
}

application/xml, text/xml

Sample:
<CommonOperationResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer">
  <errcode>1</errcode>
  <errmsg>sample string 2</errmsg>
  <tag>sample string 3</tag>
</CommonOperationResult>

application/bson

Sample:
Binary JSON content. See http://bsonspec.org for details.