package com.ruoyi.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.annotations.UserLoginToken;
import com.ruoyi.common.page.PageResult;
import com.ruoyi.controller.req.OrderChangeRecordPageReq;
import com.ruoyi.frequency.orderextensionrecord.entity.OrderExtensionRecord;
import com.ruoyi.frequency.orderextensionrecord.service.OrderExtensionRecordService;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.RyController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * 延期
 */
@CrossOrigin
@RestController
@RequestMapping("/api/orderExtensionRecord")
@Api(tags = "延期")
public class ApiOrderExtensionRecordController extends RyController {

    @Autowired
    private OrderExtensionRecordService orderExtensionRecordService;


    @PostMapping("/orderExtensionRecordPage")
    @ApiOperation(value = "订单延期记录", notes = "订单延期记录")
    @UserLoginToken
    public ResponseData<PageResult<Page<OrderExtensionRecord>>> orderExtensionRecordPage(@RequestBody @Valid OrderChangeRecordPageReq req) {
        return orderExtensionRecordService.orderExtensionRecordPage(req,getUserVo());
    }

}
