diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CodeGenerateCpp.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CodeGenerateCpp.java index 96b7810a5..44d7ff48f 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CodeGenerateCpp.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CodeGenerateCpp.java @@ -276,11 +276,10 @@ private String protocol_field_definition(ProtocolRegistration registration) { var field = sequencedFields.get(i); IFieldRegistration fieldRegistration = fieldRegistrations[GenerateProtocolFile.indexOf(fields, field)]; var fieldName = field.getName(); - var propertyTypeAndName = cppSerializer(fieldRegistration.serializer()).field(field, fieldRegistration); - var propertyType = propertyTypeAndName.getKey(); - var propertyName = propertyTypeAndName.getValue(); + var fieldTypeValue = cppSerializer(fieldRegistration.serializer()).fieldTypeValue(field, fieldRegistration); + var fieldType = fieldTypeValue.getKey(); - var propertyFullName = StringUtils.format("{} {};", propertyType, propertyName); + var propertyFullName = StringUtils.format("{} {};", fieldType, fieldName); // 生成注释 var fieldNotes = GenerateProtocolNote.fieldNotes(protocolId, fieldName, CodeLanguage.Cpp); for (var fieldNote : fieldNotes) { diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppArraySerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppArraySerializer.java index b53390f61..09e56f312 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppArraySerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppArraySerializer.java @@ -32,9 +32,9 @@ public class CppArraySerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { var type = CodeGenerateCpp.toCppClassName(field.getType().getComponentType().getSimpleName()); - return new Pair<>(StringUtils.format("vector<{}>", type), field.getName()); + return new Pair<>(StringUtils.format("vector<{}>", type), "null"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppBoolSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppBoolSerializer.java index eae6af899..7102903f4 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppBoolSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppBoolSerializer.java @@ -28,8 +28,8 @@ public class CppBoolSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { - return new Pair<>("bool", field.getName()); + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { + return new Pair<>("bool", "false"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppByteSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppByteSerializer.java index ba68ec0d3..3defed025 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppByteSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppByteSerializer.java @@ -28,8 +28,8 @@ public class CppByteSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { - return new Pair<>("int8_t", field.getName()); + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { + return new Pair<>("int8_t", "0"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppDoubleSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppDoubleSerializer.java index e79bdc3ab..014c68df2 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppDoubleSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppDoubleSerializer.java @@ -28,8 +28,8 @@ public class CppDoubleSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { - return new Pair<>("double", field.getName()); + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { + return new Pair<>("double", "0"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppFloatSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppFloatSerializer.java index 142f231d7..4c1bc2d30 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppFloatSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppFloatSerializer.java @@ -28,8 +28,8 @@ public class CppFloatSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { - return new Pair<>("float", field.getName()); + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { + return new Pair<>("float", "0"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppIntSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppIntSerializer.java index d1e19369e..ed547d7cd 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppIntSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppIntSerializer.java @@ -28,8 +28,8 @@ public class CppIntSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { - return new Pair<>("int32_t", field.getName()); + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { + return new Pair<>("int32_t", "0"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppListSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppListSerializer.java index 5c96ef3d5..ae88b2c36 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppListSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppListSerializer.java @@ -32,9 +32,9 @@ public class CppListSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { var type = CodeGenerateCpp.toCppClassName(field.getGenericType().toString()); - return new Pair<>(type, field.getName()); + return new Pair<>(type, "null"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppLongSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppLongSerializer.java index 874e5d09f..68ed9bf3a 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppLongSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppLongSerializer.java @@ -28,8 +28,8 @@ public class CppLongSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { - return new Pair<>("int64_t", field.getName()); + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { + return new Pair<>("int64_t", "0"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppMapSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppMapSerializer.java index 3dac4a55d..a637667a7 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppMapSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppMapSerializer.java @@ -32,9 +32,9 @@ public class CppMapSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { var type = CodeGenerateCpp.toCppClassName(field.getGenericType().toString()); - return new Pair<>(type, field.getName()); + return new Pair<>(type, "null"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppObjectProtocolSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppObjectProtocolSerializer.java index 2a1187db0..8f66a60d4 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppObjectProtocolSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppObjectProtocolSerializer.java @@ -32,11 +32,11 @@ public class CppObjectProtocolSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { ObjectProtocolField objectProtocolField = (ObjectProtocolField) fieldRegistration; var protocolSimpleName = EnhanceObjectProtocolSerializer.getProtocolClassSimpleName(objectProtocolField.getProtocolId()); var type = StringUtils.format("{}", protocolSimpleName); - return new Pair<>(type, field.getName()); + return new Pair<>(type, "null"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppSetSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppSetSerializer.java index a41d62c7d..9e292332e 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppSetSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppSetSerializer.java @@ -32,9 +32,9 @@ public class CppSetSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { var type = CodeGenerateCpp.toCppClassName(field.getGenericType().toString()); - return new Pair<>(type, field.getName()); + return new Pair<>(type, "null"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppShortSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppShortSerializer.java index 1be2763ab..889da0e4a 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppShortSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppShortSerializer.java @@ -28,8 +28,8 @@ public class CppShortSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { - return new Pair<>("int16_t", field.getName()); + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { + return new Pair<>("int16_t", "0"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppStringSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppStringSerializer.java index 4b436a60c..29db200e5 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppStringSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/CppStringSerializer.java @@ -28,8 +28,8 @@ public class CppStringSerializer implements ICppSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { - return new Pair<>("string", field.getName()); + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { + return new Pair<>("string", "null"); } @Override diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/ICppSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/ICppSerializer.java index 8d901d65a..485539a0a 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/ICppSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/ICppSerializer.java @@ -24,9 +24,9 @@ public interface ICppSerializer { /** - * 获取属性的类型和名称 + * 获取属性的类型和默认值 */ - Pair field(Field field, IFieldRegistration fieldRegistration); + Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration); void writeObject(StringBuilder builder, String objectStr, int deep, Field field, IFieldRegistration fieldRegistration); diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/CodeGenerateTypeScript.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/CodeGenerateTypeScript.java index 7c2749ca2..f2dff8912 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/CodeGenerateTypeScript.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/CodeGenerateTypeScript.java @@ -293,7 +293,7 @@ private String protocol_field_definition(ProtocolRegistration registration) { for (var fieldNote : fieldNotes) { tsBuilder.append(fieldNote).append(LS); } - var pair = tsSerializer(fieldRegistration.serializer()).field(field, fieldRegistration); + var pair = tsSerializer(fieldRegistration.serializer()).fieldTypeValue(field, fieldRegistration); tsBuilder.append(StringUtils.format("{}: {} = {};", fieldName, pair.getKey(), pair.getValue())).append(LS); } return tsBuilder.toString(); diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/ITsSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/ITsSerializer.java index ca0297e56..5365147a4 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/ITsSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/ITsSerializer.java @@ -24,9 +24,9 @@ public interface ITsSerializer { /** - * 获取属性的类型,名称,默认值 + * 获取属性的类型,默认值 */ - Pair field(Field field, IFieldRegistration fieldRegistration); + Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration); void writeObject(StringBuilder builder, String objectStr, int deep, Field field, IFieldRegistration fieldRegistration); diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsArraySerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsArraySerializer.java index d7b1b2c50..684737b17 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsArraySerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsArraySerializer.java @@ -31,7 +31,7 @@ public class TsArraySerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { var type = StringUtils.format("Array<{}>", CodeGenerateTypeScript.toTsClassName(field.getType().getComponentType().getSimpleName())); return new Pair<>(type, "[]"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsBoolSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsBoolSerializer.java index a24c4c905..c20192129 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsBoolSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsBoolSerializer.java @@ -28,7 +28,7 @@ public class TsBoolSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { return new Pair<>("boolean", "false"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsByteSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsByteSerializer.java index 7ec38000f..d2d39f900 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsByteSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsByteSerializer.java @@ -28,7 +28,7 @@ public class TsByteSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { return new Pair<>("number", "0"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsDoubleSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsDoubleSerializer.java index f9e85a0ac..306464a97 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsDoubleSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsDoubleSerializer.java @@ -28,7 +28,7 @@ public class TsDoubleSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { return new Pair<>("number", "0"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsFloatSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsFloatSerializer.java index d58069749..eb6e94ee8 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsFloatSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsFloatSerializer.java @@ -28,7 +28,7 @@ public class TsFloatSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { return new Pair<>("number", "0"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsIntSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsIntSerializer.java index 1303eee9b..f64f16a39 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsIntSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsIntSerializer.java @@ -29,7 +29,7 @@ public class TsIntSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { return new Pair<>("number", "0"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsListSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsListSerializer.java index 669700545..bd8d0f84d 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsListSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsListSerializer.java @@ -31,7 +31,7 @@ public class TsListSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { var type = StringUtils.format("{}", CodeGenerateTypeScript.toTsClassName(field.getGenericType().toString())); return new Pair<>(type, "[]"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsLongSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsLongSerializer.java index c94bb2ead..7a0395c79 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsLongSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsLongSerializer.java @@ -28,7 +28,7 @@ public class TsLongSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { return new Pair<>("number", "0"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsMapSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsMapSerializer.java index 4fe9a418e..2adad6a0e 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsMapSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsMapSerializer.java @@ -31,7 +31,7 @@ public class TsMapSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { var type = StringUtils.format("{}", CodeGenerateTypeScript.toTsClassName(field.getGenericType().toString())); return new Pair<>(type, "new Map()"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsObjectProtocolSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsObjectProtocolSerializer.java index f0a6ae1ad..d397077b4 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsObjectProtocolSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsObjectProtocolSerializer.java @@ -30,7 +30,7 @@ public class TsObjectProtocolSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { ObjectProtocolField objectProtocolField = (ObjectProtocolField) fieldRegistration; var protocolSimpleName = EnhanceObjectProtocolSerializer.getProtocolClassSimpleName(objectProtocolField.getProtocolId()); var type = StringUtils.format("{} | null", protocolSimpleName); diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsSetSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsSetSerializer.java index 560e65340..d1a82f208 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsSetSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsSetSerializer.java @@ -31,7 +31,7 @@ public class TsSetSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { var type = StringUtils.format("{}", CodeGenerateTypeScript.toTsClassName(field.getGenericType().toString())); return new Pair<>(type, "new Set()"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsShortSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsShortSerializer.java index c72f79c91..dc34d7f9f 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsShortSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsShortSerializer.java @@ -28,7 +28,7 @@ public class TsShortSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { return new Pair<>("number", "0"); } diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsStringSerializer.java b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsStringSerializer.java index ccd400f3a..f130cf97a 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsStringSerializer.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/typescript/TsStringSerializer.java @@ -28,7 +28,7 @@ public class TsStringSerializer implements ITsSerializer { @Override - public Pair field(Field field, IFieldRegistration fieldRegistration) { + public Pair fieldTypeValue(Field field, IFieldRegistration fieldRegistration) { return new Pair<>("string", "''"); }