App用户密码调整
This commit is contained in:
@@ -17,6 +17,11 @@ public interface BusinessTopic {
|
||||
*/
|
||||
String NJCN_APP_EVENT_TOPIC = "njcnAppEventTopic";
|
||||
|
||||
/**
|
||||
* 治理告警接收主题
|
||||
*/
|
||||
String NJCN_APP_WARN_TOPIC = "njcnAppWarnTopic";
|
||||
|
||||
|
||||
interface AppDataTag {
|
||||
|
||||
@@ -31,5 +36,21 @@ public interface BusinessTopic {
|
||||
String RT_TAG = "rt";
|
||||
}
|
||||
|
||||
interface AppEventTag {
|
||||
|
||||
/**
|
||||
* 暂态事件(录波)tag
|
||||
*/
|
||||
String EVENT_TAG = "event";
|
||||
}
|
||||
|
||||
interface AppWarnTag {
|
||||
|
||||
/**
|
||||
* 告警事件tag
|
||||
*/
|
||||
String WARN_TAG = "warn";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.njcn.mq.message;
|
||||
|
||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/8/22 11:06
|
||||
*/
|
||||
@Data
|
||||
public class AppEventMessage extends BaseMessage {
|
||||
|
||||
@ApiModelProperty("网络设备码")
|
||||
private String id;
|
||||
|
||||
private Integer mid;
|
||||
|
||||
@ApiModelProperty("逻辑设备 治理逻辑设备为1 电能质量设备为2")
|
||||
private Integer did;
|
||||
|
||||
private Integer pri;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private Msg msg;
|
||||
|
||||
@Data
|
||||
public static class Msg{
|
||||
|
||||
@ApiModelProperty("逻辑子设备 治理逻辑设备为0 电能质量设备为1、2")
|
||||
private Integer clDid;
|
||||
|
||||
private Integer dataType;
|
||||
|
||||
@ApiModelProperty("数据属性:无-0、实时-1、统计-2")
|
||||
private Integer dataAttr;
|
||||
|
||||
private Integer dsNameIdx;
|
||||
|
||||
private List<DataArray> dataArray;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class DataArray{
|
||||
|
||||
private Integer idx;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long dataTimeSec;
|
||||
|
||||
private Long dataTimeUSec;
|
||||
|
||||
@ApiModelProperty("事件类型")
|
||||
private String type;
|
||||
|
||||
private List<Param> param;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Param{
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
private String unit;
|
||||
|
||||
private Object data;
|
||||
}
|
||||
}
|
||||
@@ -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.AppEventMessage;
|
||||
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 AppEventMessageTemplate extends RocketMQEnhanceTemplate {
|
||||
|
||||
public AppEventMessageTemplate(RocketMQTemplate template) {
|
||||
super(template);
|
||||
}
|
||||
|
||||
public SendResult sendMember(AppEventMessage appEventMessage) {
|
||||
appEventMessage.setSource(BusinessResource.APP_RESOURCE);
|
||||
return send(BusinessTopic.NJCN_APP_EVENT_TOPIC, BusinessTopic.AppEventTag.EVENT_TAG, appEventMessage);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user