| | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private String memberId; |
| | | private long userId; |
| | | private Integer userType; |
| | | private long expire; |
| | | |
| | | |
| | | public JwtPayLoad() { |
| | | } |
| | | |
| | | public JwtPayLoad(String memberId) { |
| | | this.memberId = memberId; |
| | | /** |
| | | * @param userId |
| | | * @param userType 0=消费者 Member 1=内部员工 |
| | | */ |
| | | public JwtPayLoad(long userId,Integer userType) { |
| | | this.userId = userId; |
| | | this.userType = userType; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public Map<String, Object> toMap() { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("memberId", this.memberId); |
| | | map.put("userId", this.userId); |
| | | map.put("userType", this.userType); |
| | | return map; |
| | | } |
| | | |
| | |
| | | return new JwtPayLoad(); |
| | | } else { |
| | | JwtPayLoad jwtPayLoad = new JwtPayLoad(); |
| | | jwtPayLoad.setMemberId((String) map.get("memberId")); |
| | | |
| | | jwtPayLoad.setUserId(Long.valueOf(map.get("userId").toString()) ); |
| | | jwtPayLoad.setUserType((Integer) map.get("userType")); |
| | | return jwtPayLoad; |
| | | } |
| | | } |