package com.icloud.server.scala.engine.service

import com.icloud.server.scala.engine.contect.{Context, PayUrl}
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.data.redis.core.StringRedisTemplate
import org.springframework.stereotype.Service

import javax.annotation.Resource
import scala.beans.BeanProperty
/** 装载支付链接--支付链接 contect 瘦身
 * @Author : yang
 * @Date : 2022-07-15 11:48
 * @Version : 2.1.2
 */

@Service
class OnloadPayLink {
  @Resource
  @BeanProperty var payfilterservice: PayFilterService = _
  @Resource
  @BeanProperty var optisizingSelectionService: OptisizingSelectionService = _

  @Resource
  @BeanProperty var goodspayservice: GoodsPayService = _
  @Autowired
  var stringredistemplate: StringRedisTemplate=_


  def process(context: Context) = {

    //查询所有支付的缓存
//    val goodspays = goodspayservice.getGoodsPay
//    //找商品橱窗的id
//    var goodspaye = goodspays.filter(x => {
//      x.id == context.request.goodsid
//    })

    //找商品橱窗的id
    var goodspaye = goodspayservice.getGoodsPayById(context.request.goodsid.toString)


    //风控
//    val gps = goodspayservice.getGoodsPay()
     goodspaye = payfilterservice.filter(context, goodspaye)

//    var v=""

    //查出的那个实体类 ---判断权重或者随机
   optisizingSelectionService.optisize(goodspaye,context)





  }

}
