日照智慧社区接口服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

47 lines
1.3 KiB

package com.epmet.redis;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.dto.result.UserBadgeListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @Author zxc
* @DateTime 2020/11/3 2:21 下午
*/
@Component
public class UserBadgeRedis {
@Autowired
private RedisUtils redisUtils;
/**
* @Description 获取徽章信息
* @Param customerId
* @author zxc
* @date 2020/11/3 2:50 下午
*/
public Object getUserBadge(String customerId){
Object userBadge = redisUtils.hGet(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE);
return userBadge;
}
/**
* @Description 存放徽章信息
* @Param userBadge
* @Param customerId
* @author zxc
* @date 2020/11/3 2:51 下午
*/
public void setUserBadge(List<UserBadgeListResultDTO> userBadge,String customerId){
redisUtils.hSet(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(),-1);
}
}