diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/GenerateCppUtils.java b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/GenerateCppUtils.java index 21e253e03..325a3005e 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/GenerateCppUtils.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/cpp/GenerateCppUtils.java @@ -142,7 +142,7 @@ public static void createCppProtocolFile(ProtocolRegistration registration) thro protocolClazzName, protocolId, protocolClazzName, writeObject.trim(), protocolClazzName, readObject.trim()); var outputPath = StringUtils.format("{}/{}/{}.h" - , GenerateCppUtils.protocolOutputPath + , protocolOutputPath , GenerateProtocolPath.getProtocolPath(protocolId) , protocolClazzName); FileUtils.writeStringToFile(new File(outputPath), protocolTemplate, true); diff --git a/protocol/src/main/java/com/zfoo/protocol/serializer/go/GenerateGoUtils.java b/protocol/src/main/java/com/zfoo/protocol/serializer/go/GenerateGoUtils.java index 6bdba8430..43cd4fda9 100644 --- a/protocol/src/main/java/com/zfoo/protocol/serializer/go/GenerateGoUtils.java +++ b/protocol/src/main/java/com/zfoo/protocol/serializer/go/GenerateGoUtils.java @@ -126,14 +126,8 @@ public static void createGoProtocolFile(ProtocolRegistration registration) throw , protocolClazzName, protocolId, protocolClazzName, protocolClazzName , writeObject.trim(), protocolClazzName, protocolClazzName, readObject.trim()); - var protocolPath = GenerateProtocolPath.protocolAbsolutePath(protocolId); - if (StringUtils.isEmpty(protocolPath)) { - protocolPath = protocolClazzName; - } else if (protocolPath.contains(StringUtils.SLASH)) { - protocolPath = StringUtils.substringAfterLast(protocolPath, StringUtils.SLASH); - } - var outputPath = StringUtils.format("{}/{}/{}.go", protocolOutputPath, protocolOutputRootPath, protocolClazzName); - FileUtils.writeStringToFile(outputPath, protocolTemplate, true); + var outputPath = StringUtils.format("{}/{}.go", protocolOutputPath, protocolClazzName); + FileUtils.writeStringToFile(new File(outputPath), protocolTemplate, true); } private static String fieldDefinition(ProtocolRegistration registration) {