【websocket消息体结构】
This commit is contained in:
parent
3a952286e0
commit
89a57588b1
@ -0,0 +1,99 @@
|
||||
package club.joylink.xiannccda.ats.message.collect;
|
||||
|
||||
import club.joylink.xiannccda.dto.protos.WsMessageProto;
|
||||
import com.google.protobuf.GeneratedMessageV3.Builder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/** 设备状态管理信息 */
|
||||
public abstract class DeviceStatusData {
|
||||
|
||||
/** 默认的主键名称 */
|
||||
private static final String DEFAULT_ID_NAME = "id";
|
||||
|
||||
/** 设备主键名称映射 */
|
||||
private static final Map<String, String> DEVICE_ID_NAME_MAP =
|
||||
Map.of("LineNetTrainOffsetDiagram", "groupId");
|
||||
|
||||
/** 设备状态信息 */
|
||||
private static final Map<String, Map<String, Builder>> deviceStatusBuilder =
|
||||
new ConcurrentHashMap<>();
|
||||
|
||||
/** 当前所有设备状态信息 */
|
||||
private static final Map<String, Builder> deviceStatusVOMap = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* 返回全量设备状态信息
|
||||
*
|
||||
* @return 状态消息
|
||||
*/
|
||||
public abstract WsMessageProto.WsMessage collectAllStatus();
|
||||
|
||||
/**
|
||||
* 返回增量设备状态信息
|
||||
*
|
||||
* @return 状态信息
|
||||
*/
|
||||
public abstract WsMessageProto.WsMessage collectIncrementStatus();
|
||||
|
||||
/**
|
||||
* 获取设备状态类型
|
||||
*
|
||||
* @param builder 设备状态信息
|
||||
* @return 状态类型
|
||||
*/
|
||||
public static String findType(Builder builder) {
|
||||
return builder.getDefaultInstanceForType().getClass().getSimpleName();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
* @param protoBuilder 数据信息
|
||||
* @return 主键
|
||||
*/
|
||||
protected String getIdVal(Builder protoBuilder) {
|
||||
String idName = DEVICE_ID_NAME_MAP.getOrDefault(findType(protoBuilder), DEFAULT_ID_NAME);
|
||||
return String.valueOf(
|
||||
protoBuilder.getField(protoBuilder.getDescriptorForType().findFieldByName(idName)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量放入设备状态
|
||||
*
|
||||
* @param builders 设备状态列表
|
||||
*/
|
||||
protected void addAllDeviceStatus(List<Builder> builders) {
|
||||
builders.stream()
|
||||
.collect(Collectors.groupingBy(DeviceStatusData::findType))
|
||||
.forEach(
|
||||
(k, v) -> {
|
||||
Map<String, Builder> deviceStatusMap = deviceStatusBuilder.get(k);
|
||||
if (deviceStatusMap == null) {
|
||||
deviceStatusMap = new ConcurrentHashMap<>(v.size());
|
||||
deviceStatusBuilder.put(k, deviceStatusMap);
|
||||
}
|
||||
Map<String, Builder> newDeviceMap =
|
||||
v.stream().collect(Collectors.toMap(this::getIdVal, b -> b));
|
||||
deviceStatusMap.putAll(newDeviceMap);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 将采集到的设备状态放入内存中
|
||||
*
|
||||
* @param builder 设备状态信息
|
||||
* @return 包装的设备状态
|
||||
*/
|
||||
protected void addDeviceStatus(Builder builder) {
|
||||
String buildType = findType(builder);
|
||||
Map<String, Builder> deviceStatusMap = deviceStatusBuilder.get(buildType);
|
||||
if (deviceStatusMap == null) {
|
||||
deviceStatusMap = new ConcurrentHashMap<>();
|
||||
deviceStatusBuilder.put(buildType, deviceStatusMap);
|
||||
}
|
||||
deviceStatusMap.put(getIdVal(builder), builder);
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package club.joylink.xiannccda.ats.message.collect;
|
||||
|
||||
import club.joylink.xiannccda.dto.protos.WsMessageProto.WsMessage;
|
||||
|
||||
/** 线路设备状态数据 */
|
||||
public class LineDeviceStatusData extends DeviceStatusData {
|
||||
|
||||
@Override
|
||||
public WsMessage collectAllStatus() {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WsMessage collectIncrementStatus() {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package club.joylink.xiannccda.ats.message.collect;
|
||||
|
||||
import club.joylink.xiannccda.dto.protos.WsMessageProto.WsMessage;
|
||||
|
||||
/** 线网设备状态数据 */
|
||||
public class LineNetDeviceStatusData extends DeviceStatusData {
|
||||
|
||||
@Override
|
||||
public WsMessage collectAllStatus() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WsMessage collectIncrementStatus() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -13,6 +13,14 @@ public class StatusDataRepository {
|
||||
/** 主键字段名称 */
|
||||
private static final String ID_NAME = "id";
|
||||
|
||||
/** 线网数据 */
|
||||
|
||||
/** 线路信息 */
|
||||
|
||||
/** 设备状态唯一标识 */
|
||||
|
||||
// private static
|
||||
|
||||
/** 采集回来的设备状态信息 */
|
||||
private static Map<String, GeneratedMessageV3.Builder> deviceStatusBuilder =
|
||||
new ConcurrentHashMap<>();
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -157,91 +157,6 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
return new LineNetTrainOffsetDiagram();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
private LineNetTrainOffsetDiagram(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
this();
|
||||
if (extensionRegistry == null) {
|
||||
throw new java.lang.NullPointerException();
|
||||
}
|
||||
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 8: {
|
||||
|
||||
lineId_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
java.lang.String s = input.readStringRequireUtf8();
|
||||
|
||||
groupId_ = s;
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
|
||||
dir_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
|
||||
show_ = input.readBool();
|
||||
break;
|
||||
}
|
||||
case 40: {
|
||||
|
||||
windowNo_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 48: {
|
||||
|
||||
windowOffset_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 58: {
|
||||
java.lang.String s = input.readStringRequireUtf8();
|
||||
|
||||
destinationId_ = s;
|
||||
break;
|
||||
}
|
||||
case 66: {
|
||||
java.lang.String s = input.readStringRequireUtf8();
|
||||
|
||||
backId_ = s;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (!parseUnknownField(
|
||||
input, unknownFields, extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||
e).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
this.unknownFields = unknownFields.build();
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.internal_static_diagram_LineNetTrainOffsetDiagram_descriptor;
|
||||
@ -256,7 +171,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
|
||||
public static final int LINEID_FIELD_NUMBER = 1;
|
||||
private int lineId_;
|
||||
private int lineId_ = 0;
|
||||
/**
|
||||
* <pre>
|
||||
*线路id
|
||||
@ -271,7 +186,8 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
|
||||
public static final int GROUPID_FIELD_NUMBER = 2;
|
||||
private volatile java.lang.Object groupId_;
|
||||
@SuppressWarnings("serial")
|
||||
private volatile java.lang.Object groupId_ = "";
|
||||
/**
|
||||
* <pre>
|
||||
*车组号
|
||||
@ -317,7 +233,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
|
||||
public static final int DIR_FIELD_NUMBER = 3;
|
||||
private int dir_;
|
||||
private int dir_ = 0;
|
||||
/**
|
||||
* <pre>
|
||||
*方向
|
||||
@ -332,7 +248,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
|
||||
public static final int SHOW_FIELD_NUMBER = 4;
|
||||
private boolean show_;
|
||||
private boolean show_ = false;
|
||||
/**
|
||||
* <pre>
|
||||
*是否显示
|
||||
@ -347,7 +263,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
|
||||
public static final int WINDOWNO_FIELD_NUMBER = 5;
|
||||
private int windowNo_;
|
||||
private int windowNo_ = 0;
|
||||
/**
|
||||
* <pre>
|
||||
*车次窗编号
|
||||
@ -362,7 +278,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
|
||||
public static final int WINDOWOFFSET_FIELD_NUMBER = 6;
|
||||
private int windowOffset_;
|
||||
private int windowOffset_ = 0;
|
||||
/**
|
||||
* <pre>
|
||||
*车次窗位置
|
||||
@ -377,7 +293,8 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
|
||||
public static final int DESTINATIONID_FIELD_NUMBER = 7;
|
||||
private volatile java.lang.Object destinationId_;
|
||||
@SuppressWarnings("serial")
|
||||
private volatile java.lang.Object destinationId_ = "";
|
||||
/**
|
||||
* <pre>
|
||||
*目的地
|
||||
@ -423,7 +340,8 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
|
||||
public static final int BACKID_FIELD_NUMBER = 8;
|
||||
private volatile java.lang.Object backId_;
|
||||
@SuppressWarnings("serial")
|
||||
private volatile java.lang.Object backId_ = "";
|
||||
/**
|
||||
* <pre>
|
||||
*后部车站
|
||||
@ -506,7 +424,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backId_)) {
|
||||
com.google.protobuf.GeneratedMessageV3.writeString(output, 8, backId_);
|
||||
}
|
||||
unknownFields.writeTo(output);
|
||||
getUnknownFields().writeTo(output);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@ -544,7 +462,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backId_)) {
|
||||
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, backId_);
|
||||
}
|
||||
size += unknownFields.getSerializedSize();
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
}
|
||||
@ -575,7 +493,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
.equals(other.getDestinationId())) return false;
|
||||
if (!getBackId()
|
||||
.equals(other.getBackId())) return false;
|
||||
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -603,7 +521,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
hash = (53 * hash) + getDestinationId().hashCode();
|
||||
hash = (37 * hash) + BACKID_FIELD_NUMBER;
|
||||
hash = (53 * hash) + getBackId().hashCode();
|
||||
hash = (29 * hash) + unknownFields.hashCode();
|
||||
hash = (29 * hash) + getUnknownFields().hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
}
|
||||
@ -652,11 +570,13 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
|
||||
public static club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input);
|
||||
}
|
||||
|
||||
public static club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
@ -724,38 +644,26 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
|
||||
// Construct using club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
super(parent);
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
private void maybeForceBuilderInitialization() {
|
||||
if (com.google.protobuf.GeneratedMessageV3
|
||||
.alwaysUseFieldBuilders) {
|
||||
}
|
||||
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
bitField0_ = 0;
|
||||
lineId_ = 0;
|
||||
|
||||
groupId_ = "";
|
||||
|
||||
dir_ = 0;
|
||||
|
||||
show_ = false;
|
||||
|
||||
windowNo_ = 0;
|
||||
|
||||
windowOffset_ = 0;
|
||||
|
||||
destinationId_ = "";
|
||||
|
||||
backId_ = "";
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -782,50 +690,39 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
@java.lang.Override
|
||||
public club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram buildPartial() {
|
||||
club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram result = new club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram(this);
|
||||
result.lineId_ = lineId_;
|
||||
result.groupId_ = groupId_;
|
||||
result.dir_ = dir_;
|
||||
result.show_ = show_;
|
||||
result.windowNo_ = windowNo_;
|
||||
result.windowOffset_ = windowOffset_;
|
||||
result.destinationId_ = destinationId_;
|
||||
result.backId_ = backId_;
|
||||
if (bitField0_ != 0) { buildPartial0(result); }
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder clone() {
|
||||
return super.clone();
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.setField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||
return super.clearField(field);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearOneof(
|
||||
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||
return super.clearOneof(oneof);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
int index, java.lang.Object value) {
|
||||
return super.setRepeatedField(field, index, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder addRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.addRepeatedField(field, value);
|
||||
private void buildPartial0(club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram result) {
|
||||
int from_bitField0_ = bitField0_;
|
||||
if (((from_bitField0_ & 0x00000001) != 0)) {
|
||||
result.lineId_ = lineId_;
|
||||
}
|
||||
if (((from_bitField0_ & 0x00000002) != 0)) {
|
||||
result.groupId_ = groupId_;
|
||||
}
|
||||
if (((from_bitField0_ & 0x00000004) != 0)) {
|
||||
result.dir_ = dir_;
|
||||
}
|
||||
if (((from_bitField0_ & 0x00000008) != 0)) {
|
||||
result.show_ = show_;
|
||||
}
|
||||
if (((from_bitField0_ & 0x00000010) != 0)) {
|
||||
result.windowNo_ = windowNo_;
|
||||
}
|
||||
if (((from_bitField0_ & 0x00000020) != 0)) {
|
||||
result.windowOffset_ = windowOffset_;
|
||||
}
|
||||
if (((from_bitField0_ & 0x00000040) != 0)) {
|
||||
result.destinationId_ = destinationId_;
|
||||
}
|
||||
if (((from_bitField0_ & 0x00000080) != 0)) {
|
||||
result.backId_ = backId_;
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram) {
|
||||
@ -843,6 +740,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
if (!other.getGroupId().isEmpty()) {
|
||||
groupId_ = other.groupId_;
|
||||
bitField0_ |= 0x00000002;
|
||||
onChanged();
|
||||
}
|
||||
if (other.getDir() != 0) {
|
||||
@ -859,13 +757,15 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
}
|
||||
if (!other.getDestinationId().isEmpty()) {
|
||||
destinationId_ = other.destinationId_;
|
||||
bitField0_ |= 0x00000040;
|
||||
onChanged();
|
||||
}
|
||||
if (!other.getBackId().isEmpty()) {
|
||||
backId_ = other.backId_;
|
||||
bitField0_ |= 0x00000080;
|
||||
onChanged();
|
||||
}
|
||||
this.mergeUnknownFields(other.unknownFields);
|
||||
this.mergeUnknownFields(other.getUnknownFields());
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -880,19 +780,73 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram parsedMessage = null;
|
||||
if (extensionRegistry == null) {
|
||||
throw new java.lang.NullPointerException();
|
||||
}
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 8: {
|
||||
lineId_ = input.readInt32();
|
||||
bitField0_ |= 0x00000001;
|
||||
break;
|
||||
} // case 8
|
||||
case 18: {
|
||||
groupId_ = input.readStringRequireUtf8();
|
||||
bitField0_ |= 0x00000002;
|
||||
break;
|
||||
} // case 18
|
||||
case 24: {
|
||||
dir_ = input.readInt32();
|
||||
bitField0_ |= 0x00000004;
|
||||
break;
|
||||
} // case 24
|
||||
case 32: {
|
||||
show_ = input.readBool();
|
||||
bitField0_ |= 0x00000008;
|
||||
break;
|
||||
} // case 32
|
||||
case 40: {
|
||||
windowNo_ = input.readInt32();
|
||||
bitField0_ |= 0x00000010;
|
||||
break;
|
||||
} // case 40
|
||||
case 48: {
|
||||
windowOffset_ = input.readInt32();
|
||||
bitField0_ |= 0x00000020;
|
||||
break;
|
||||
} // case 48
|
||||
case 58: {
|
||||
destinationId_ = input.readStringRequireUtf8();
|
||||
bitField0_ |= 0x00000040;
|
||||
break;
|
||||
} // case 58
|
||||
case 66: {
|
||||
backId_ = input.readStringRequireUtf8();
|
||||
bitField0_ |= 0x00000080;
|
||||
break;
|
||||
} // case 66
|
||||
default: {
|
||||
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
|
||||
done = true; // was an endgroup tag
|
||||
}
|
||||
break;
|
||||
} // default:
|
||||
} // switch (tag)
|
||||
} // while (!done)
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (club.joylink.xiannccda.dto.protos.LineNetTrainOffsetDiagramProto.LineNetTrainOffsetDiagram) e.getUnfinishedMessage();
|
||||
throw e.unwrapIOException();
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
onChanged();
|
||||
} // finally
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private int lineId_ ;
|
||||
/**
|
||||
@ -917,8 +871,9 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setLineId(int value) {
|
||||
|
||||
|
||||
lineId_ = value;
|
||||
bitField0_ |= 0x00000001;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -931,7 +886,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearLineId() {
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
lineId_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
@ -990,11 +945,9 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
*/
|
||||
public Builder setGroupId(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
if (value == null) { throw new NullPointerException(); }
|
||||
groupId_ = value;
|
||||
bitField0_ |= 0x00000002;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1007,8 +960,8 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearGroupId() {
|
||||
|
||||
groupId_ = getDefaultInstance().getGroupId();
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1023,12 +976,10 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
*/
|
||||
public Builder setGroupIdBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
checkByteStringIsUtf8(value);
|
||||
|
||||
if (value == null) { throw new NullPointerException(); }
|
||||
checkByteStringIsUtf8(value);
|
||||
groupId_ = value;
|
||||
bitField0_ |= 0x00000002;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1056,8 +1007,9 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setDir(int value) {
|
||||
|
||||
|
||||
dir_ = value;
|
||||
bitField0_ |= 0x00000004;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1070,7 +1022,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearDir() {
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
dir_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
@ -1099,8 +1051,9 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setShow(boolean value) {
|
||||
|
||||
|
||||
show_ = value;
|
||||
bitField0_ |= 0x00000008;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1113,7 +1066,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearShow() {
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
show_ = false;
|
||||
onChanged();
|
||||
return this;
|
||||
@ -1142,8 +1095,9 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setWindowNo(int value) {
|
||||
|
||||
|
||||
windowNo_ = value;
|
||||
bitField0_ |= 0x00000010;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1156,7 +1110,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearWindowNo() {
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
windowNo_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
@ -1185,8 +1139,9 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder setWindowOffset(int value) {
|
||||
|
||||
|
||||
windowOffset_ = value;
|
||||
bitField0_ |= 0x00000020;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1199,7 +1154,7 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearWindowOffset() {
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
windowOffset_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
@ -1258,11 +1213,9 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
*/
|
||||
public Builder setDestinationId(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
if (value == null) { throw new NullPointerException(); }
|
||||
destinationId_ = value;
|
||||
bitField0_ |= 0x00000040;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1275,8 +1228,8 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearDestinationId() {
|
||||
|
||||
destinationId_ = getDefaultInstance().getDestinationId();
|
||||
bitField0_ = (bitField0_ & ~0x00000040);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1291,12 +1244,10 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
*/
|
||||
public Builder setDestinationIdBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
checkByteStringIsUtf8(value);
|
||||
|
||||
if (value == null) { throw new NullPointerException(); }
|
||||
checkByteStringIsUtf8(value);
|
||||
destinationId_ = value;
|
||||
bitField0_ |= 0x00000040;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1354,11 +1305,9 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
*/
|
||||
public Builder setBackId(
|
||||
java.lang.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
if (value == null) { throw new NullPointerException(); }
|
||||
backId_ = value;
|
||||
bitField0_ |= 0x00000080;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1371,8 +1320,8 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
* @return This builder for chaining.
|
||||
*/
|
||||
public Builder clearBackId() {
|
||||
|
||||
backId_ = getDefaultInstance().getBackId();
|
||||
bitField0_ = (bitField0_ & ~0x00000080);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1387,12 +1336,10 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
*/
|
||||
public Builder setBackIdBytes(
|
||||
com.google.protobuf.ByteString value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
checkByteStringIsUtf8(value);
|
||||
|
||||
if (value == null) { throw new NullPointerException(); }
|
||||
checkByteStringIsUtf8(value);
|
||||
backId_ = value;
|
||||
bitField0_ |= 0x00000080;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@ -1429,7 +1376,18 @@ public final class LineNetTrainOffsetDiagramProto {
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return new LineNetTrainOffsetDiagram(input, extensionRegistry);
|
||||
Builder builder = newBuilder();
|
||||
try {
|
||||
builder.mergeFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(builder.buildPartial());
|
||||
} catch (com.google.protobuf.UninitializedMessageException e) {
|
||||
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(e)
|
||||
.setUnfinishedMessage(builder.buildPartial());
|
||||
}
|
||||
return builder.buildPartial();
|
||||
}
|
||||
};
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
8678
src/main/java/club/joylink/xiannccda/dto/protos/WsMessageProto.java
Normal file
8678
src/main/java/club/joylink/xiannccda/dto/protos/WsMessageProto.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -3,11 +3,13 @@ package club.joylink.xiannccda.service;
|
||||
import club.joylink.xiannccda.entity.LineInfo;
|
||||
import club.joylink.xiannccda.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.xiannccda.repository.ILineInfoRepository;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.security.Principal;
|
||||
@ -57,6 +59,9 @@ public class LineInfoService {
|
||||
if (oldLineInfo == null) {
|
||||
throw BusinessExceptionAssertEnum.DATA_NOT_EXIST.exception(String.format("线路[%s]信息不存在", id));
|
||||
}
|
||||
// if (StringUtils.isNotEmpty(lineInfo.getConfig()) && !JSON.isValid(lineInfo.getConfig())) {
|
||||
// throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception(String.format("线路[%s]config非JSON格式", lineInfo.getConfig()));
|
||||
// }
|
||||
LambdaQueryWrapper<LineInfo> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(LineInfo::getLineId, lineInfo.getLineId()).ne(LineInfo::getId, id);
|
||||
long count = lineInfoRepository.count(wrapper);
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b0bc3b6100b9dbe5fd02a9e8cd2515c840ebf2a8
|
||||
Subproject commit de6b01d1316835220c43fceba3402de3552bb96b
|
Loading…
Reference in New Issue
Block a user