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.orderchangerecord.entity.OrderChangeRecord;
import com.ruoyi.frequency.orderchangerecord.service.OrderChangeRecordService;
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/orderChangeRecord")
@Api(tags = "调价")
public class ApiOrderChangeRecordController extends RyController {

    @Autowired
    private OrderChangeRecordService orderChangeRecordService;


    @PostMapping("/orderChangeRecordPage")
    @ApiOperation(value = "订单调价记录", notes = "订单调价记录")
    @UserLoginToken
    public ResponseData<PageResult<Page<OrderChangeRecord>>> orderChangeRecordPage(@RequestBody @Valid OrderChangeRecordPageReq req) {
        return orderChangeRecordService.orderChangeRecordPage(req,getUserVo());
    }

}
