package com.cpop.jambox.business.controller.callback;

import com.cpop.jambox.business.service.EasyLearnOrderService;
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author DB
 * @version 1.0.0
 * @since 2023-12-21 16:06
 */
@RestController
@Api(tags = "果酱-放心学回调接口")
@RequestMapping("/easyLearn/callback")
@Deprecated
public class EasyLearnCallBackController {

    @Autowired
    private EasyLearnOrderService easyLearnOrderService;

    /**
     * 微信支付订单通知
     * @author DB
     * @since 2023/12/21
     * @param xmlData 数据
     * @return java.lang.String
     */
    @PostMapping("/notify/oncePay")
    public String oncePayResult(@RequestBody String xmlData){
        easyLearnOrderService.oncePayResult(xmlData);
        return WxPayNotifyResponse.success("成功");
    }

    /**
     * 微信支付联合支付订单通知
     * @param xmlData 数据
     * @return java.lang.String
     */
    @PostMapping("/notify/unionPay")
    public String unionPay(@RequestBody String xmlData){
        easyLearnOrderService.unionPayResult(xmlData);
        return WxPayNotifyResponse.success("成功");
    }



}
