josn
batteryParamInfo.setDischargeMosStatus(1);
redisService.set("test", JSONUtil.toJsonStr(batteryParamInfo));
// BatteryParamInfo batteryParam = (BatteryParamInfo) redisService.get("test"); 错误转换
Object test = redisService.get("test");
JSONObject jsonObject = JSONUtil.parseObj(test);
BatteryParamInfo battery = JSONUtil.toBean(jsonObject, BatteryParamInfo.class);
System.out.println(battery);
评论区