当前位置:网站首页>[party benefits] jsonobject to string, leave blank
[party benefits] jsonobject to string, leave blank
2022-07-01 03:39:00 【Three person studio】
The same problem :
Redis Leave an empty field and take it out
JSONObject To String Leave blank fields when typing
take String Type to JSONObject Leave blank fields when typing
reason
Object The type and JSONObject Type to String When type , Empty fields are automatically ignored .
Solution
Use class Entity classes are output as templates , take String Type to entity type
Need to introduce hutool
import cn.hutool.json.JSONUtil;
...
UserInfo userinfo = JSONUtil.toBean(String.valueOf(redisUtil.get(UserToken)),UserInfo.class)
UserInfo.java
import lombok.Data;
// Virtual entity class that outputs user information
@Data
public class UserInfo {
private String id;
private String username;
private String realname;
}
Then through the entity class get and set Just output .
边栏推荐
- Research on target recognition and tracking based on 3D laser point cloud
- Edge drawing: a combined real-time edge and segment detector
- 打包iso文件的话,怎样使用hybrid格式输出?isohybrid:command not found
- 静态库使用MFC和共享库使用MFC的区别
- [deep learning] activation function (sigmoid, etc.), forward propagation, back propagation and gradient optimization; optimizer. zero_ grad(), loss. backward(), optimizer. Function and principle of st
- [daily training] 1175 Prime permutation
- 报错:Plug-ins declaring extensions or extension points must set the singleton directive to true
- How do I use Google Chrome 11's Upload Folder feature in my own code?
- The combination of applet container technology and IOT
- Leetcode:829. 连续整数求和
猜你喜欢

Unexpected token o in JSON at position 1 ,JSON解析问题

FCN全卷积网络理解及代码实现(来自pytorch官方实现)

Data exchange JSON

家居网购项目
![[深度学习]激活函数(Sigmoid等)、前向传播、反向传播和梯度优化;optimizer.zero_grad(), loss.backward(), optimizer.step()的作用及原理](/img/9f/187ca83be1b88630a6c6fbfb0620ed.png)
[深度学习]激活函数(Sigmoid等)、前向传播、反向传播和梯度优化;optimizer.zero_grad(), loss.backward(), optimizer.step()的作用及原理

The combination of applet container technology and IOT

后台系统页面左边菜单按钮和右边内容的处理,后台系统页面出现双滚动

数据库中COMMENT关键字的使用

用小程序的技术优势发展产业互联网

访问阿里云存储的图片URL实现在网页直接预览略缩图而不直接下载
随机推荐
TEC: Knowledge Graph Embedding with Triple Context
详解Spark运行模式(local+standalone+yarn)
RSN:Learning to Exploit Long-term Relational Dependencies in Knowledge Graphs
复习专栏之---消息队列
E15 solution for cx5120 controlling Huichuan is620n servo error
Nacos
The value of the second servo encoder is linked to the NC virtual axis of Beifu PLC for display
[small sample segmentation] interpretation of the paper: prior guided feature enrichment network for fee shot segmentation
Complete knapsack problem
还在浪费脑细胞自学吗,这份面试笔记绝对是C站天花板
LeetCode 128最长连续序列(哈希set)
Leetcode:829. Sum of continuous integers
Md5sum operation
报错:Plug-ins declaring extensions or extension points must set the singleton directive to true
Ridge regression and lasso regression
4、【WebGIS实战】软件操作篇——数据导入及处理
后台系统页面左边菜单按钮和右边内容的处理,后台系统页面出现双滚动
5. [WebGIS practice] software operation - service release and permission management
Golang multi graph generation gif
用小程序的技术优势发展产业互联网