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, Goodspaye, Wxpaye}
import org.springframework.stereotype.Component

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

/**
  * 风控过滤---支付系统级别---长久被微信/支付宝的系统封号---- 主风控
 *  查询是否被封
  */
@Component
class RiskFilter extends AbstractFilter {
  @Resource
  @BeanProperty var amountredis: AmountRedis = _
  override def WxisAccept(context: Context, wxpaye: Wxpaye): Boolean = {
    println("微信主风控")
    !amountredis.if_WxForceout(wxpaye.appid)
  }

  override def AliisAccept(context: Context, alipaye: Alipaye): Boolean = {
    println("支付宝主风控")
    !amountredis.if_AliForceout(alipaye.appid)
  }
}
