package com.red.circle.other.app.inner.service.user.user.impl;

import com.red.circle.other.infra.database.cache.service.user.RequestBlacklistService;
import com.red.circle.other.app.inner.service.user.user.RequestBlacklistClientService;
import java.util.Set;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 请求黑名单.
 *
 * @author lisizhe on 2023/8/18
 */
@Service
@RequiredArgsConstructor
public class RequestBlacklistClientServiceImpl implements RequestBlacklistClientService {

  private final RequestBlacklistService requestBlacklistService;

  @Override
  public void addIp(String ip) {
    requestBlacklistService.addIp(ip);
  }

  @Override
  public void addPhoneModel(String phoneModel) {
    requestBlacklistService.addPhoneModel(phoneModel);
  }

  @Override
  public void delKey(String key) {
    requestBlacklistService.delKey(key);
  }

  @Override
  public boolean matchIpOrPhoneModel(String ip, String phoneModel) {
    return requestBlacklistService.matchIpOrPhoneModel(ip, phoneModel);
  }

  @Override
  public Set<String> getKeys() {
    return requestBlacklistService.getKeys();
  }
}
