feat: 增加手动拍照mqtt
parent
6ab6bb2779
commit
30c009faa3
@ -0,0 +1,34 @@
|
|||||||
|
package com.shxy.xymanager_service.impl;
|
||||||
|
|
||||||
|
import com.shxy.xymanager_common.model.mqtt.MessageSend;
|
||||||
|
import com.shxy.xymanager_common.model.mqtt.Paras;
|
||||||
|
import com.shxy.xymanager_service.mqtt.MqttPublisherService;
|
||||||
|
import com.shxy.xymanager_service.service.MqttService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class MqttServiceImpl implements MqttService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
MqttPublisherService mqttPublisherService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void takePic(String cmdid, Integer channel, Integer preset, Integer type, Integer requestId) throws Exception {
|
||||||
|
MessageSend msg = new MessageSend();
|
||||||
|
msg.setServiceId("PlatformControlDeviceCommandLssueService");
|
||||||
|
msg.setDeviceId(cmdid);
|
||||||
|
msg.setCmd("manualCapturePicture");
|
||||||
|
Paras paras = msg.getParas();
|
||||||
|
paras.setChannelNumber(channel);
|
||||||
|
paras.setPresetPosition(preset);
|
||||||
|
paras.setPassword("");
|
||||||
|
mqttPublisherService.publish(msg);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package com.shxy.xymanager_service.service;
|
||||||
|
|
||||||
|
|
||||||
|
public interface MqttService {
|
||||||
|
|
||||||
|
void takePic(String cmdid, Integer channel, Integer preset, Integer type, Integer requestId) throws Exception;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue