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

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

@Slf4j
@Component("chinaumsSenselessSignStreamConsumer")
public class ChinaumsSenselessSignStream extends StreamConsumer<ChinaSenselessSignRet> {

    @Autowired
    ChinaumsSenselessPayService chinaumsSenselessPayService;

    @Override
    public void accept(ChinaSenselessSignRet chinaSenselessSignRet) {
        log.info("****************收到银联签约结果通知：{}", JsonUtil.toJson(chinaSenselessSignRet));
        chinaumsSenselessPayService.handleSignRetMessage(chinaSenselessSignRet);
    }
}
