采集数据时新增一个parent_code字段,同时device_code更改为必填

This commit is contained in:
Yu Sun
2022-08-20 14:18:13 +08:00
parent c33b6b9cd8
commit a948c11eb9
4 changed files with 30 additions and 12 deletions

View File

@@ -175,6 +175,15 @@ $worker -> onMessage = function(TcpConnection $connection, Request $request) {
'errmsg' => '节点编码和数值类型不匹配!'
)));
$connection -> send($response);
} else if ($data_capture -> check_res === 'NO_DEVICE_CODE') {
$response = new Response(200, [
'Content-Type' => 'application/json;charset=utf-8',
], json_encode(array(
'action' => 'result_set_node_data',
'errcode' => 4002,
'errmsg' => 'device_code为必填字段'
)));
$connection -> send($response);
}
$res = $data_capture -> set_node_data();
if ($res === true) {