治理文件mq新增
This commit is contained in:
@@ -23,7 +23,10 @@ public interface BusinessTopic {
|
|||||||
String NJCN_APP_WARN_TOPIC = "njcnAppWarnTopic";
|
String NJCN_APP_WARN_TOPIC = "njcnAppWarnTopic";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 治理文件接收主题
|
||||||
|
*/
|
||||||
|
String NJCN_APP_FILE_TOPIC = "njcnAppFileTopic";
|
||||||
|
|
||||||
|
|
||||||
/********************************数据中心*********************************/
|
/********************************数据中心*********************************/
|
||||||
@@ -60,5 +63,18 @@ public interface BusinessTopic {
|
|||||||
String WARN_TAG = "warn";
|
String WARN_TAG = "warn";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface FileTag {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件信息tag
|
||||||
|
*/
|
||||||
|
String INFO_TAG = "fileInfo";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件流tag
|
||||||
|
*/
|
||||||
|
String STREAM_TAG = "streamInfo";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.njcn.mq.message;
|
||||||
|
|
||||||
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/9/5 16:38
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AppFileMessage extends BaseMessage {
|
||||||
|
|
||||||
|
@ApiModelProperty("网络设备码")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private Integer mid;
|
||||||
|
|
||||||
|
@ApiModelProperty("逻辑设备 治理逻辑设备为1 电能质量设备为2")
|
||||||
|
private Integer did;
|
||||||
|
|
||||||
|
private Integer pri;
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private AppFileMessage.Msg msg;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Msg{
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private AppFileMessage.FileInfo fileInfo;
|
||||||
|
|
||||||
|
private String data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class FileInfo{
|
||||||
|
|
||||||
|
private Long fileTime;
|
||||||
|
|
||||||
|
private Integer fileSize;
|
||||||
|
|
||||||
|
private String fileCheck;
|
||||||
|
|
||||||
|
private String fileChkType;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.njcn.mq.template;
|
||||||
|
|
||||||
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
|
import com.njcn.mq.constant.BusinessResource;
|
||||||
|
import com.njcn.mq.constant.BusinessTopic;
|
||||||
|
import com.njcn.mq.message.AppFileMessage;
|
||||||
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/8/11 15:28
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class AppFileMessageTemplate extends RocketMQEnhanceTemplate {
|
||||||
|
|
||||||
|
public AppFileMessageTemplate(RocketMQTemplate template) {
|
||||||
|
super(template);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendResult sendMember(AppFileMessage appFileMessage, String tag) {
|
||||||
|
appFileMessage.setSource(BusinessResource.APP_RESOURCE);
|
||||||
|
return send(BusinessTopic.NJCN_APP_FILE_TOPIC, tag, appFileMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -161,4 +161,9 @@ public interface InfluxDBTableConstant {
|
|||||||
*/
|
*/
|
||||||
String CL_DID = "cl_did";
|
String CL_DID = "cl_did";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑子设备id
|
||||||
|
*/
|
||||||
|
String UUID = "uuid";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user