package com.yida.data.server.utils;

import cc.mrbird.febs.common.redis.service.RedisService;
import java.nio.channels.Channel;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class UserUtil {

    private final static String USER_LIST = "device.card.810a.tcp.list";
    private final RedisService redisService;

    public void addUser(String cardId, Channel channel) {
        redisService.hset(USER_LIST, cardId, channel);
    }

    public void remove(String cardId) {
        redisService.hdel(USER_LIST, cardId);
    }
}
