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

import com.cpop.core.base.R;
import com.cpop.jambox.business.bo.EasyLearnUnionPayBo;
import com.cpop.jambox.business.bo.OncePlaceOrderBo;
import com.cpop.jambox.business.service.EasyLearnOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 果酱-放心学订单表 控制层。
 *
 * @author DB
 * @since 2023-12-14
 */
@RestController
@Api(tags = "果酱-放心学订单表接口")
@RequestMapping("/easyLearn")
@Deprecated
public class EasyLearnController {

    @Autowired
    private EasyLearnOrderService easyLearnOrderService;

    /**
     * 一次性支付下单
     * @author DB
     * @since  2023/10/23 12:15
     * @param bo 下单请求对象
     * @return com.cpop.core.base.R<java.lang.Void>
     */
    @PostMapping("/oncePlaceOrder")
    @ApiOperation("一次性支付下单")
    public R<Object> oncePlaceOrder(@RequestBody @Validated @ApiParam("一次性支付") OncePlaceOrderBo bo) {
        return R.ok(easyLearnOrderService.oncePlaceOrder(bo));
    }

    /**
     * 放心学统一支付
     * @author DB
     * @since 2023/12/28
     * @param bo 请求参数
     * @return R<Object>
     */
    @Deprecated
    @PostMapping("/unionPay")
    @ApiOperation("放心学统一支付")
    public R<Object> unionPay(@RequestBody @Validated EasyLearnUnionPayBo bo) {
        return R.ok(easyLearnOrderService.unionPay(bo));
    }

}
