package com.clx.performance.controller.temp;

import com.clx.performance.service.thirdparty.nbbank.NbBankService;
import com.clx.performance.vo.pc.nbbank.NbBankOrderPayResultVO;
import com.clx.performance.vo.pc.nbbank.NbBankOrderResultVO;
import com.msl.common.result.Result;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Author: aiqingguo
 * @Description: 临时接口
 * @Date: 2023-8-21 12:10:16
 * @Version: 1.0
 */
@Slf4j
@RestController
@RequestMapping(value="/temp/bank")
public class TempBankController {

    @Autowired
    private NbBankService bankService;

    @ApiOperation(value = "转账支付", notes = "<br>By:艾庆国")
    @RequestMapping(value = "/orderTransferPay", method = RequestMethod.POST)
    public Result<NbBankOrderPayResultVO> directBankTransferOrder() {

        return Result.ok(bankService.orderTransferPay(1));
    }

    @ApiOperation(value = "订单支付", notes = "<br>By:艾庆国")
    @RequestMapping(value = "/orderDirectPay", method = RequestMethod.POST)
    public Result<NbBankOrderPayResultVO> orderDirectPay() {

        return Result.ok(bankService.orderDirectPay(null,2,"313332082914","86041110000076809", "黑玫瑰"));
    }

    @ApiOperation(value = "查询", notes = "<br>By:艾庆国")
    @RequestMapping(value = "/getResult", method = RequestMethod.POST)
    public Result<NbBankOrderResultVO> getResult(String merSeqNo) {

        return Result.ok(bankService.getResult(merSeqNo));
    }

    @ApiOperation(value = "调账", notes = "<br>By:艾庆国")
    @RequestMapping(value = "/adjust", method = RequestMethod.POST)
    public Result<NbBankOrderResultVO> adjust(String merSeqNo, Integer amount) {

        return Result.ok(bankService.adjust(merSeqNo, amount));
    }

    @ApiOperation(value = "退款", notes = "<br>By:艾庆国")
    @RequestMapping(value = "/refund", method = RequestMethod.POST)
    public Result<NbBankOrderResultVO> refund(String orgMerSeqNo, Integer amount, String orgTransSeqNo) {

        return Result.ok(bankService.refund(orgMerSeqNo,amount,orgTransSeqNo));
    }

}
