object转实体
Usercenter_Role role = JSONObject.parseObject(JSONObject.toJSON(roleObj).toString(), Usercenter_Role.class);
redis获取转实体
Object positionObj = RedisUtil.getTableData(usercenterContext.getRedisServerAddr(),usercenterContext.getRedisServerPort(),usercenterContext.getRedisServerPass(), Usercenter_Position.class, db_posiId);
Usercenter_Position position = JSONObject.parseObject(JSONObject.toJSON(positionObj).toString(), Usercenter_Position.class);
string json 转object 实体
String json = JSON.toJSONString(commonResult.getData());
JSONArray picArray = new JSONArray(json);
for(Object ob :JSONUtil.toList(picArray ,type)){
Field field = ReflectUtil.getField(ob, "db_accId");
field.setAccessible(true);
String db_accId = field.get(ob).toString();
Object redisValue = RedisUtil.getTableData(addr,port,pass,Usercenter_Account.class,db_accId);
Usercenter_Account account = JSONObject.parseObject(JSONObject.toJSON(redisValue).toString(), Usercenter_Account.class);
```
|