package com.yuchen.saas.park.service.fault.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuchen.saas.park.api.entity.fault.EquipmentBreakdownHistory;
import com.yuchen.saas.park.service.fault.service.EquipmentBreakdownHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nest.springwrap.core.mp.support.Condition;
import org.nest.springwrap.core.mp.support.Query;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/10/19 14:28
 * @Description: 设备故障历史
 * @Version: 1.0
 */
@RestController
@RequestMapping("/equipment_breakdown/history")
@Api(tags = "设备故障历史",value = "设备故障规则历史")
public class EquipmentBreakdownHistoryController {

    @Resource
    private EquipmentBreakdownHistoryService equipmentBreakdownHistoryService;

    @GetMapping("/page")
    @ApiOperation(value = "设备故障规则分页", notes = "设备故障规则分页")
    public R page(Query query, EquipmentBreakdownHistory history) {
        Page page = (Page) Condition.getPage(query);
        Page<EquipmentBreakdownHistory> result = equipmentBreakdownHistoryService.page(page, Condition.getQueryWrapper(history));
        return R.data(result);
    }
}