package com.zhongshu.card.server.core.stream;

import com.github.microservice.app.stream.StreamConsumer;
import com.github.microservice.pay.client.model.weChatMiniApp.WeChatMiniAppPayRet;
import com.zhongshu.card.server.core.service.pay.BalancePayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component("weChatMiniAppPayStreamConsumer")
public class WeChatMiniAppPayStream extends StreamConsumer<WeChatMiniAppPayRet> {

    @Autowired
    BalancePayService balancePayService;

    @Override
    public void accept(WeChatMiniAppPayRet weChatMiniAppPayRet) {
        log.info("---------------收到微信支付结果通知广播----------------");
        balancePayService.handleWeChatCallback(weChatMiniAppPayRet);
    }
}
