| File was renamed from component/component-Influxdb/src/main/java/com/zy/influxdb/service/InfluxDBService.java |
| | |
| | | package com.zy.influxdb.service; |
| | | package com.zy.component.influxdb.service; |
| | | |
| | | import com.influxdb.v3.client.InfluxDBClient; |
| | | import com.influxdb.v3.client.Point; |
| | | import com.influxdb.v3.client.write.WritePrecision; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | try { |
| | | // 执行查询 |
| | | Stream<Object[]> query = influxDBClient.query(sql); |
| | | logger.info("查询数据:{}", query); |
| | | // 转换为 Map 列表(便于后续处理) |
| | | List<Map<String, Object>> collect = query.map(record -> { |
| | | Map<String, Object> map = new LinkedHashMap<>(); |