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