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 com.icloud.server.web.time.TimeUtilss
import org.springframework.stereotype.Component

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

/**
  * 风控过滤---支付系统级别---当天被支付系统屏蔽了,第二天过期
  */
@Component
class TodayRiskFilter extends AbstractFilter {
  @Resource
  @BeanProperty var amountredis: AmountRedis = _
  override def WxisAccept(context: Context, wxpaye: Wxpaye): Boolean = {
    val str = amountredis.WxgetTodayPayStatus(TimeUtilss.gettoday_tostring(), wxpaye.appid)
    println("当天风控")
    if(str=="1")false else true
  }

  override def AliisAccept(context: Context, alipaye: Alipaye): Boolean = {
    val str = amountredis.AligetTodayPayStatus(TimeUtilss.gettoday_tostring(), alipaye.appid)
    println("当天风控")
    if(str=="1")false else true
  }
}
