| | |
| | | return "Message sent to topic " + topic; |
| | | } |
| | | |
| | | @GetMapping("/create") |
| | | public String create(@RequestParam String topic, @RequestParam String message) { |
| | | try { |
| | | iotdbCfg.getSessionPool().createTimeseries("root.f2.myt1", TSDataType.UNKNOWN, null, null); |
| | | } catch (IoTDBConnectionException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } catch (StatementExecutionException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | return "Message sent to topic " + topic; |
| | | } |
| | | |
| | | @GetMapping("/rec2") |
| | | public void testRec2() { |
| | | //数据格式:{"174":[{"values":{"d1":12},"ts":"1721978780449"}]} 174是应用id |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/recalarm") |
| | | public void testAlarm() { |
| | | //数据格式:{"174":[{"values":{"d1":12},"ts":"1721978780449"}]} 174是应用id |
| | | //多条格式:{"174":[{"values":{"DeviceStatus":2},"ts":"1722478128278"},{"values":{"spindleSpeed":22},"ts":"1722478128281"}]} |
| | | String payload = "{\"174\":[{\"values\":{\"Alarm\":\"告警信息1\"},\"ts\":\"1725504995056\"}]}"; |
| | | //payload = "{\"174\":[{\"values\":{\"Output\":11},\"ts\":\"1722478128278\"},{\"values\":{\"SpindleSpeed\":22},\"ts\":\"1722478128281\"}]}"; |
| | | recService.handle(payload); |
| | | } |
| | | |
| | | @GetMapping("/tpl") |
| | | public Object tpl(String tplname) throws StatementExecutionException, IoTDBConnectionException { |
| | | boolean b = iotdbCfg.getSessionPool().checkTimeseriesExists("root.f2.output_22005.*"); |