package com.neusoft.smart.pos.gateway.service.feignService;

import com.neusoft.smart.pos.dto.trade.request.*;
import com.neusoft.smart.pos.dto.trade.response.*;
import com.neusoft.smart.pos.framework.dto.ResponseData;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * 订单管理使用远程调用service
 */
@FeignClient(value = "service-trade/order")
public interface RemoteOrderService {

    @PostMapping("/order")
    ResponseData<PostOrderResponse> saveOrder(@RequestBody PostTradeOrderRequest tradeOrderRequest);

    @PostMapping("/unionPayOrder")
    ResponseData<PostUnionPayOrderResponse> saveUnionPayOrder(@RequestBody PostTradeOrderRequest tradeOrderRequest);

    @PutMapping("/orderPaySuccess")
    ResponseData<PutOrderPaySuccessResponse> updateOrderPaySuccessStatus(@RequestBody PutOrderPaySuccessRequest orderPaySuccessRequest);

    @PostMapping("/rechargeOrder")
    ResponseData<PostRechargeOrderResponse> saveRechargeOrder(@RequestBody PostTradeOrderRequest tradeOrderRequest);

    @PostMapping("/wxOrder")
    ResponseData<PostWxOrderResponse> saveWxOrder(@RequestBody PostTradeOrderRequest tradeOrderRequest);

    @PutMapping("/rechargeOrderPaySuccess")
    ResponseData<PutOrderPaySuccessResponse> updateRechargeOrderPaySuccessStatus(@RequestBody PutOrderPaySuccessRequest orderPaySuccessRequest);
    
    @GetMapping("/orderInfoByOrderNumber")
    ResponseData<GetOrderInfoByOrderNumberResponse> queryOrderInfoByOrderNumber(@RequestParam(value="orderNumber",defaultValue = "") String orderNumber);
    
    @GetMapping("/order")
    ResponseData<GetOrderResponse> queryShopOrderInfo(@RequestParam(value="orderNumber",defaultValue = "") String orderNumber);

    @PutMapping("/orderScore")
    ResponseData<PutOrderScoreResponse> updateOrderScore(@RequestBody PutOrderScoreRequest orderScoreRequest);

    @GetMapping("/orderByValidateCardPay")
    ResponseData<GetOrderResponse> queryShopOrderInfoByValidateCardPay(@RequestParam(value="serialNo",defaultValue = "") String serialNo,@RequestParam(value="orderNumber",defaultValue = "") String orderNumber);

    @PutMapping("/reverseOrder")
    ResponseData<PutReverseOrderResponse> reverseOrder(@RequestBody PutReverseOrderRequest reverseOrderRequest);
    
    @GetMapping("/queryOrderPayStatusByThirdPlatform")
    ResponseData<GetOrderPayStatusResponse> queryOrderPayStatusByThirdPlatform(@RequestParam(value="orderNumber",defaultValue = "") String orderNumber , @RequestParam(value="serialNo",defaultValue = "") String serialNo);

    @PostMapping("/recordOrder")
    ResponseData<PostTradeRecordOrderResponse> recordOrder(@RequestBody PostTradeRecordOrderRequest tradeRecordOrderRequest);

    @GetMapping("/wxOrder")
    ResponseData<GetWxOrdersResponse.Order> queryWxOrderWithDetails(@RequestParam(value = "orderNo", defaultValue = "") String orderNo);
    
    @PutMapping("/printerFlag")
    ResponseData<PutPrinterFlagResponse> updatePrinterFlag(@RequestBody PutPrinterFlagRequest printerFlagRequest);
    
    @ApiOperation(value = "订单编号查询接口", notes = "订单编号查询接口")
    @GetMapping("/orderNumber")
    ResponseData<String> queryOrderNumber();
}