93 lines
1.9 KiB
Java
93 lines
1.9 KiB
Java
package com.ruoyi.iot.service;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import com.ruoyi.iot.constants.IotConstants;
|
|
import com.ruoyi.iot.domain.IotDeviceInfo;
|
|
import com.ruoyi.iot.domain.response.CommandResponse;
|
|
import com.ruoyi.iot.interfaces.IotDevice;
|
|
|
|
|
|
/**
|
|
* @author wjh
|
|
* 2024/3/20
|
|
*/
|
|
public interface IotService {
|
|
|
|
/**
|
|
* 获取设备在线状态
|
|
*/
|
|
default String getOnlineStatus(IotDevice device) {
|
|
return getOnlineStatus(device, IotConstants.ONLINE_TYPE_GET);
|
|
}
|
|
|
|
/**
|
|
* 获取设备在线状态
|
|
*/
|
|
String getOnlineStatus(IotDevice device, String type);
|
|
|
|
/**
|
|
* 获取设备信息
|
|
*/
|
|
List<IotDeviceInfo> getDeviceInfo(List<? extends IotDevice> deviceList);
|
|
|
|
/**
|
|
* 创建设备
|
|
*/
|
|
int create(String mac);
|
|
|
|
/**
|
|
* 开锁
|
|
* @param device 设备
|
|
* @param sub 上报频率
|
|
* @param reason 原因
|
|
* @return 结果
|
|
*/
|
|
CommandResponse unlock(IotDevice device, int sub, String reason);
|
|
|
|
/**
|
|
* 锁车
|
|
* @param device 设备
|
|
* @param sub 上报频率
|
|
* @param reason 原因
|
|
* @return 结果
|
|
*/
|
|
CommandResponse lock(IotDevice device, int sub, String reason);
|
|
|
|
/**
|
|
* 强制断电
|
|
* @param device 设备
|
|
* @param sub 上报频率
|
|
* @param reason 原因
|
|
* @return 结果
|
|
*/
|
|
CommandResponse qLock(IotDevice device, int sub, String reason);
|
|
|
|
/**
|
|
* 播放语音
|
|
* @param device 设备
|
|
* @param type 语音类型
|
|
* @param reason 原因
|
|
* @return 结果
|
|
*/
|
|
CommandResponse play(IotDevice device, String type, String reason);
|
|
|
|
/**
|
|
* 重启
|
|
* @param device 设备
|
|
* @param reason 原因
|
|
* @return 结果
|
|
*/
|
|
CommandResponse reboot(IotDevice device, String reason);
|
|
|
|
/**
|
|
* 开坐垫锁
|
|
* @param device 设备
|
|
* @param reason 原因
|
|
* @return 结果
|
|
*/
|
|
CommandResponse unlockSeat(IotDevice device, String reason);
|
|
|
|
}
|