package com.neusoft.smart.pos.member.task;

import com.neusoft.smart.pos.dto.member.response.DetailedMemberResponse;
import com.neusoft.smart.pos.framework.task.RedisTask;
import com.neusoft.smart.pos.framework.utils.SpringUtils;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;

@Slf4j
public class MemberRedisTask extends RedisTask {
	
	@Setter
	private DetailedMemberResponse detailedMemberResponse;
	
	private RedisTemplate redisTemplate = SpringUtils.getBean("redisTemplate", RedisTemplate.class);
	
	
	@Override
	public void executeTask() {
		if (null != detailedMemberResponse) {
			redisTemplate.opsForValue().set(detailedMemberResponse.getCardHidCode(), detailedMemberResponse);
		}
	}
}
