| | |
| | | // return ResponseEntity.internalServerError().body("数据处理失败: " + e.getMessage()); |
| | | // } |
| | | if(Objects.nonNull(weightRequest) && CollectionUtil.isNotEmpty(weightRequest.getWeights())){ |
| | | RedisUtil.lSet(WeightRequestDto.DENSITY,weightRequest.getWeights()); |
| | | List<?> objectList = RedisUtil.lGet(WeightRequestDto.DENSITY, 0, -1); |
| | | if(CollectionUtil.isNotEmpty(objectList)){ |
| | | // 删除 Redis 中旧的列表数据 |
| | | RedisUtil.del(WeightRequestDto.DENSITY); |
| | | // 存入新的数据 |
| | | RedisUtil.lSet(WeightRequestDto.DENSITY, weightRequest.getWeights()); |
| | | }else { |
| | | RedisUtil.lSet(WeightRequestDto.DENSITY,weightRequest.getWeights()); |
| | | } |
| | | return Result.success(null,"保存成功"); |
| | | } |
| | | return Result.fail(); |