package com.repair.api;

import com.repair.model.pojo.RepairPayRecord;
import com.repair.model.request.RefundableAmountRequest;
import com.repair.model.request.repairPayRequest;
import com.repair.model.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
@RequestMapping("/api/repairPayRecord")
@Api(tags = {"repairPayRecordController"}, value = "支付记录")
public interface RepairPayRecordControllerAPI {

    @PostMapping(value = "/insertrepairPayRecord")
    @ApiOperation(value = "添加支付记录", notes = "添加支付记录数据", httpMethod = "POST")
    CommonResult InsertrepairPayRecord(@Validated @RequestBody RepairPayRecord rc, BindingResult bindingResult);

    @PostMapping(value = "/updaterepairPayRecordById")
    @ApiOperation(value = "编辑支付记录数据", notes = "编辑支付记录数据", httpMethod = "POST")
    CommonResult updaterepairPayRecordById(@Validated @RequestBody RepairPayRecord rc, BindingResult bindingResult);

    @GetMapping(value = "/queryPagerepairPayRecord")
    @ApiOperation(value = "支付记录分页数据", notes = "支付记录分页数据", httpMethod = "GET")
    CommonResult queryPagerepairPayRecords(@RequestParam int currentPage, @RequestParam int pageCount, String name);

    @GetMapping(value = "/deleterepairPayRecordById")
    @ApiOperation(value = "根据ID删除指定支付记录", notes = "根据ID删除指定支付记录", httpMethod = "GET")
    CommonResult deleterepairPayRecordById(@RequestParam int id);

    @PostMapping(value = "/repairPayment")
    @ApiOperation(value = "支付接口", notes = "支付接口", httpMethod = "POST")
    CommonResult repairPayment(@Validated @RequestBody repairPayRequest rpr, BindingResult bindingResult);

    @GetMapping(value = "/queryProsperityRepairPayRecords")
    @ApiOperation(value = "支付成功记录分页数据", notes = "支付成功记录分页数据", httpMethod = "GET")
    CommonResult queryProsperityRepairPayRecords(  @RequestParam int currentPage, @RequestParam int pageCount, String keyWord,String startTime,String endTime);

    @PostMapping(value = "/refundableAmount")
    @ApiOperation(value = "实退", notes = "实退", httpMethod = "POST")
    CommonResult refundableAmount(@RequestBody RefundableAmountRequest rar,@RequestHeader("user_head") String userhead, BindingResult bindingResult);

    @GetMapping(value = "/statistics")
    @ApiOperation(value = "统计", notes = "统计", httpMethod = "GET")
    CommonResult statistics() throws Exception;

    @GetMapping(value = "/restrict")
    @ApiOperation(value = "限制实退金额", notes = "限制实退金额", httpMethod = "GET")
    CommonResult restrict(@RequestParam int payRecordId) throws Exception;

    @GetMapping(value = "/queryExport")
    @ApiOperation(value = "支付成功记录导出", notes = "支付成功记录导出", httpMethod = "GET")
    void queryExport(HttpServletResponse response, String keyWord, String startTime, String endTime);

}
