package com.icloud.server.scala.engine.filter

import com.icloud.server.redis.AmountRedis
import com.icloud.server.scala.engine.contect.Context
import com.icloud.server.scala.engine.service.{Alipaye, Wxpaye}
import org.springframework.stereotype.Component

import javax.annotation.Resource
import scala.beans.BeanProperty

/**
  * 风控---IP风控
 *  查询是否被封
  */
@Component
class IpFilter extends AbstractFilter {
  @Resource
  @BeanProperty var amountredis: AmountRedis = _
  override def WxisAccept(context: Context, wxpaye: Wxpaye): Boolean = {
    !amountredis.killIP(context.request.ip)
  }

  override def AliisAccept(context: Context, alipaye: Alipaye): Boolean = !amountredis.killIP(context.request.ip)
}
