package com.usky.ems.controller.web;

import com.usky.common.core.bean.ApiResult;
import com.usky.ems.service.EmsDeviceEventService;
import com.usky.ems.service.vo.DeviceEventDTO;
import com.usky.ems.service.vo.DeviceEventVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 设备事件接口
 *
 * POST /device-event/list  查询设备事件列表
 */
@RestController
@RequestMapping("/device-event")
public class EmsDeviceEventController {

    @Autowired
    private EmsDeviceEventService emsDeviceEventService;

    @PostMapping("/list")
    public ApiResult<List<DeviceEventVO>> list(@RequestBody DeviceEventDTO dto) {
        return ApiResult.success(emsDeviceEventService.list(dto));
    }
}

