当前位置:网站首页>[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 .
边栏推荐
- Leetcode: offer 59 - I. maximum value of sliding window
- The value of the second servo encoder is linked to the NC virtual axis of Beifu PLC for display
- 后台系统页面左边菜单按钮和右边内容的处理,后台系统页面出现双滚动
- Bilinear upsampling and f.upsample in pytorch_ bilinear
- torch.histc
- Edlines: a real time line segment detector with a false detection control
- 4. [WebGIS practice] software operation chapter - data import and processing
- Go tool cli for command line implementation
- Asgnet paper and code interpretation 2
- Basic concept and classification of sorting
猜你喜欢

Nacos

Appium自动化测试基础--补充:C/S架构和B/S架构说明

Edlines: a real time line segment detector with a false detection control

家居网购项目

E15 solution for cx5120 controlling Huichuan is620n servo error

访问阿里云存储的图片URL实现在网页直接预览略缩图而不直接下载

Random seed torch in deep learning manual_ seed(number)、torch. cuda. manual_ seed(number)

pytorch中的双线性插值上采样(Bilinear Upsampling)、F.upsample_bilinear

RSN:Learning to Exploit Long-term Relational Dependencies in Knowledge Graphs

Nacos
随机推荐
10、Scanner. Next() cannot read spaces /indexof -1
torch.histc
Test function in pychram
数据交换 JSON
Binary tree god level traversal: Morris traversal
过滤器 Filter
The shell script uses two bars to receive external parameters
Explain spark operation mode in detail (local+standalone+yarn)
Leetcode 31 next spread, leetcode 64 minimum path sum, leetcode 62 different paths, leetcode 78 subset, leetcode 33 search rotation sort array (modify dichotomy)
Promise中finally的用法
4、【WebGIS实战】软件操作篇——数据导入及处理
Ctfshow blasting WP
Edlines: a real time line segment detector with a false detection control
How to achieve 0 error (s) and 0 warning (s) in keil5
Pytorch training deep learning network settings CUDA specified GPU visible
Leetcode: offer 59 - I. maximum value of sliding window
Implement pow (x, n) function
Keil5中如何做到 0 Error(s), 0 Warning(s).
MFC窗口滚动条用法
Leetcode:829. 连续整数求和