private void setUserCache(String appId, String sessionToken, BaasUser user) { ValueOperations<String, String> ops = redisTemplate.opsForValue(); ops.set( "App_" + appId + USER_CLASS_NAME + "_" + sessionToken, jsonUtil.writeValueAsString(user)); }
private BaasUser getUserCache(String appId, String sessionToken) { ValueOperations<String, String> ops = redisTemplate.opsForValue(); String userStr = ops.get("App_" + appId + USER_CLASS_NAME + "_" + sessionToken); return jsonUtil.readValue(userStr, BaasUser.class); }