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

import com.neusoft.smart.pos.dto.payment.request.PostCancelOrderRequest;
import com.neusoft.smart.pos.dto.payment.request.PostQueryOrderRequest;
import com.neusoft.smart.pos.dto.payment.response.PostCancelOrderResponse;
import com.neusoft.smart.pos.dto.payment.response.PostQueryOrderResponse;
import com.neusoft.smart.pos.dto.payorder.request.*;
import com.neusoft.smart.pos.dto.payorder.response.*;
import com.neusoft.smart.pos.framework.dto.ResponseData;
import com.neusoft.smart.pos.payorder.service.PayOrderService;
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 = "/payorder")
@Validated
public class PayOrderController {

    @Autowired
    private PayOrderService payOrderService;// = ServiceFactory.getOrderServiceInstance(null,null);
//
//    @ApiOperation(value = "支付订单生成使用接口", notes = "支付订单生成使用方法")
//    @PostMapping("/createPayOrder")
//    public ResponseData<PostPayOrderResponse> createPayOrder(@RequestBody PostCreatePayOrderRequest createOrderRequest) {
//        return new ResponseData<>(payOrderService.createPayOrder(createOrderRequest));
//    }
//    @ApiOperation(value = "订单保存使用接口", notes = "根据订单编号更新订单信息方法")
//    @PostMapping("/savePayOrder")
//    public ResponseData<PostOrderResponse> saveOrder(@RequestBody PostSaveOrderRequest saveOrderRequest) {
//        return null;//new ResponseData<>(orderService.saveOrder(saveOrderRequest));
//    }
//

//    @ApiOperation(value = "支付单取消接口", notes = "根据商户号订单编号取消预付单信息方法")
//    @PostMapping("/canclePayOrder")
//    public ResponseData<PostCancelOrderResponse> canclePayOrder(@RequestBody PostCancelOrderRequest cannelOrderRequest) {
//        return new ResponseData<>(payOrderService.canclePayOrder(cannelOrderRequest));
//    }
//
//    @ApiOperation(value = "更新订单状态接口", notes = "根据订单编号计算并更新订单状态方法")
//    @PutMapping("/updatePayOrderStatus")
//    public ResponseData<PutUpdateOrderStatusResponse> updateOrderStatus(@Valid @RequestBody PutUpdateOrderStatusRequest updateOrderStatusRequest, BindingResult bindingResult) {
//        return null;//new ResponseData<>(orderService.updateOrderStatus(updateOrderStatusRequest));
//    }

//    //setOrderStatus
//    @ApiOperation(value = "设置订单状态接口", notes = "根据订单编号设置订单状态方法")
//    @PutMapping("/setPayOrderStatus")
//    public ResponseData<PutSetOrderStatusResponse> setOrderStatus(@Valid @RequestBody PutSetOrderStatusRequest setOrderStatusRequest, BindingResult bindingResult) {
//        return null;//new ResponseData<>(orderService.setOrderStatus(setOrderStatusRequest));
//    }

//    @ApiOperation(value = "支付单信息查询接口", notes = "根据商户号订单编号查询预付单信息方法")
//    @PostMapping("/queryPayOrder")
//    public ResponseData<PostQueryOrderResponse> queryPayOrder(@RequestBody PostQueryOrderRequest queryOrderRequest) {
//        return new ResponseData<>(payOrderService.queryPayOrder(queryOrderRequest));
//    }
//
////    @ApiOperation(value = "订单商品信息列表查询接口", notes = "订单信息商品信息列表查询方法")
////    @GetMapping("/getAllPayOrderListByOrderNumber")
////    public ResponseData<GetOrderInfoResponse> getAllPayOrderListByOrderNumber(@RequestParam(value="orderNumber",defaultValue = "") String orderNumber) {
////        return new ResponseData<>(orderService.getOrderGoodsListByOrderNumber(orderNumber));
////    }
//
//    //doPay
//    @ApiOperation(value = "订单支付使用接口", notes = "开启订单支付流程的方法")
//    @PostMapping("/doPay")
//    public ResponseData<PostDoPayOrderResponse> doPay(@RequestBody PostDoPayOrderRequest doPayOrderRequest) {
//        return null;//new ResponseData<>(orderService.doPay(doPayOrderRequest));
//    }
}
