package com.zsc.edu.gateway.modules.iot.device.service;

import com.alibaba.fastjson2.JSONException;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zsc.edu.gateway.modules.iot.device.dto.BatchDeviceDto;
import com.zsc.edu.gateway.modules.iot.device.dto.DeviceDto;
import com.zsc.edu.gateway.modules.iot.device.dto.DeviceServeDto;
import com.zsc.edu.gateway.modules.iot.device.entity.Device;
import com.zsc.edu.gateway.modules.iot.device.query.DeviceQuery;
import com.zsc.edu.gateway.modules.iot.device.vo.DeviceStatusVo;
import com.zsc.edu.gateway.modules.iot.device.vo.DeviceVo;

import java.util.List;

/**
 * @author zhuang
 */
public interface DeviceService extends IService<Device> {
    Device create(DeviceDto dto);

    List<Device> batchCreate(BatchDeviceDto dto);

    Device update(DeviceDto dto, Long id);

    DeviceVo detail(Long id);

    Boolean serve(DeviceServeDto dto);

    IPage<Device> query(Page<Device> page, DeviceQuery query);

    DeviceStatusVo status();

    String send(Long deviceId, Integer qos, JSONObject paras) throws JSONException;

    List<Device> findByName(String name);

    int toggle(Long id);
}
