yaowanxin
2 天以前 abfe636ee5c8ad51af20505bb4e4054c2b603cb7
cnas-device/src/main/java/com/ruoyi/device/controller/WeightController.java
@@ -24,7 +24,7 @@
            List<Double> weightList = weightRequest.getWeights();
            // 在这里添加数据处理逻辑,例如打印、存储到数据库等
            System.out.println("接收到的数据: " + weightList);
            processThreeTimesValueDataStream(weightList, WeightRequestDto.DENSITY);
            processValueDataStream(weightList, WeightRequestDto.DENSITY);
            // 处理成功返回 200 状态码和消息
            return ResponseEntity.ok("数据处理成功");
@@ -34,7 +34,7 @@
        }
    }
    private void processThreeTimesValueDataStream(List<Double> weightList, String dataStream) {
    private void processValueDataStream(List<Double> weightList, String dataStream) {
        // 处理 weightList 为 null 的情况
        if (weightList == null) {
            // 若 weightList 为 null,可选择删除 Redis 中的对应键或存入空数组,这里选择存入空数组