1.redis取出數據轉成UserEntity
//數據存入redis中
redisTemplate.opsForValue().set(loginame, JSON.toJSONString(users),1000,TimeUnit.SECONDS);
//獲取數據並轉成用戶實體
String userJson = (String) redisTemplate.opsForValue().get("loginame");
UserEntity user = (UserEntity) JSONArray.parseArray(userJson, UserEntity.class);