package com.neusoft.smart.pos.payorder.controller;

import com.neusoft.smart.pos.dto.order.request.*;
import com.neusoft.smart.pos.dto.order.response.*;
import com.neusoft.smart.pos.framework.dto.ResponseData;
import com.neusoft.smart.pos.payorder.service.PayRefundOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Api(value = "退款订单管理接口", description = "退款订单管理接口")
@RestController
@RequestMapping(path = "/orderRefund")
@Validated
public class PayRefundOrderController {
    @Autowired
    private PayRefundOrderService payRefundOrderService;

    //doPay
    @ApiOperation(value = "退款订单支付使用接口", notes = "开启退款订单支付流程的方法")
    @PostMapping("/doRefund")
    public ResponseData<PostDoRefundOrderResponse> doRefund(@RequestBody PostDoPayOrderRequest doPayOrderRequest) {
        return new ResponseData<>(payRefundOrderService.doRefund(doPayOrderRequest));
    }
}
