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

import com.neusoft.smart.pos.dto.trade.request.PostGrantOrderRequest;
import com.neusoft.smart.pos.dto.trade.request.PostGrantToPayRequest;
import com.neusoft.smart.pos.dto.trade.request.PostReverseGrantRequest;
import com.neusoft.smart.pos.dto.trade.request.PostUnFreezeGrantRequest;
import com.neusoft.smart.pos.dto.trade.response.*;
import com.neusoft.smart.pos.framework.bean.PaginationExtendBean;
import com.neusoft.smart.pos.framework.dto.ResponseData;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 资金预授权订单管理使用远程调用service
 */
@FeignClient(value = "service-trade/grantOrder")
public interface RemoteGrantOrderService {
    
    @PostMapping("/grantOrder")
    ResponseData<PostGrantOrderResponse> saveGrantOrder(@RequestBody PostGrantOrderRequest grantOrderRequest);
    
    @ApiOperation(value = "资金授权解冻使用方法", notes = "资金授权解冻使用方法")
    @PostMapping("/unFreezeGrant")
    ResponseData<PostUnFreezeGrantResponse> unFreezeGrant(@RequestBody PostUnFreezeGrantRequest unFreezeGrantRequest);
    
    @ApiOperation(value = "资金预授权撤销接口", notes = "资金预授权方法")
    @PostMapping("/reverseGrant")
    ResponseData<PostReverseGrantResponse> reverseGrant(@RequestBody PostReverseGrantRequest reverseGrantRequest);
    
    @ApiOperation(value = "资金授权订单列表查询使用接口", notes = "资金授权订单列表查询使用方法")
    @GetMapping("/grantOrders")
    ResponseData<PaginationExtendBean<GetGrantOrderResponse>> queryGrantOrders(@RequestParam(value="serialNo",defaultValue = "") String serialNo
            , @RequestParam(value="grantOrderNumber",defaultValue = "") String grantOrderNumber
            , @RequestParam(value="grantStatus",defaultValue = "") String grantStatus
            , @RequestParam(value="startTime",defaultValue = "") String startTime
            , @RequestParam(value="endTime",defaultValue = "") String endTime
            , @RequestParam(value = "offset", defaultValue = "0") Integer offset
            , @RequestParam(value = "limit", defaultValue = "10") Integer limit
            , @RequestParam(value = "isPage", defaultValue = "true") Boolean isPage);
    
    @ApiOperation(value = "资金授权订单详情查询使用接口", notes = "资金授权订单详情查询使用方法")
    @GetMapping("/grantOrderDetails")
    ResponseData<GetGrantOrderDetailResponse> queryGrantOrderDetails(@RequestParam(value="serialNo",defaultValue = "") String serialNo
            , @RequestParam(value="grantOrderNumber",defaultValue = "") String grantOrderNumber);
    
    @ApiOperation(value = "资金授权转支付接口", notes = "资金预授权转支付方法")
    @PostMapping("/grantToPay")
    ResponseData<PostGrantToPayResponse> grantToPay(@RequestBody PostGrantToPayRequest grantToPayRequest);
}