diff --git a/protocol/README.md b/protocol/README.md index 9a73227c..741aac21 100644 --- a/protocol/README.md +++ b/protocol/README.md @@ -8,10 +8,8 @@ English | [简体中文](./README_CN.md) do cross-platform - The protocol can customize the private protocol format to make your protocol more secure, and supports adding fields and being compatible with previous and subsequent protocols -- Compatible with Protobuf, it supports the generation of Protobuf protocol files, and provides a generation method from - POJO to PROTO -- There are already quite a few JetBrains plugins that can do it in the way to generate POJOs, and you can search for - Proto in the plugin of Idea +- Support to generate ProtoBuf's Proto file to Pojo protocol file, and the generated protocol can be converted to other + protocols and used by Java ### Ⅱ. Quick use @@ -177,13 +175,16 @@ your protocol number a little more compactly, so that your protocol number will - zfoo provides a proto file parsing tool to convert the proto file of protobuf into a pojo object for use by zfoo -- Generate pojo objects through proto files for client use, [Parse proto configuration](https://github.com/zfoo-project/zfoo/blob/main/protocol/src/test/java/com/zfoo/protocol/generate/GenerateProtobufTesting.java) +- Generate pojo objects through proto files for client + use, [Parse proto configuration](https://github.com/zfoo-project/zfoo/blob/main/protocol/src/test/java/com/zfoo/protocol/generate/GenerateProtobufTesting.java) ### Ⅸ. The difference between zfoo and Protobuf -- Abandoning the deletion field of protobuf can also be compatible with the protocol, improving the performance by 1 times and reducing the size by 1 times. +- Abandoning the deletion field of protobuf can also be compatible with the protocol, improving the performance by 1 + times and reducing the size by 1 times. -- zfoo takes the intersection of type declarations in all languages, instead of protobuf taking the union, simplifying the type implementation of protobuf +- zfoo takes the intersection of type declarations in all languages, instead of protobuf taking the union, simplifying + the type implementation of protobuf - protobuf ``` double @@ -215,7 +216,8 @@ your protocol number a little more compactly, so that your protocol number will string ``` -- zfoo takes the intersection of the grammars of all languages, instead of the union of protobuf, and adds the grammar implementation of protobuf +- zfoo takes the intersection of the grammars of all languages, instead of the union of protobuf, and adds the grammar + implementation of protobuf - protobuf ``` Collection nesting syntax is not supported diff --git a/protocol/README_CN.md b/protocol/README_CN.md index 7933725d..07d6fcd5 100644 --- a/protocol/README_CN.md +++ b/protocol/README_CN.md @@ -4,8 +4,7 @@ - 去中心化网络序列化库,安全可靠,自定义私有协议格式,可前后兼容,让每个人都拥有一套独一无二的协议 - 协议目前原生支持 **C++ Java JavaScript TypeScript C# Go Lua GDScript Python**,可以轻易实现跨平台 -- 兼容protobuf,支持生成protobuf协议文件,提供从pojo到proto的生成方式 -- proto文件到生成pojo的方式已经有不少jetbrains插件可以做到,可以在idea的plugin中搜索proto +- 支持将protobuf的proto文件到生成到pojo协议文件,生成完成的协议不仅可以被转为其它协议也可以被java使用 ### Ⅱ. 快速使用 diff --git a/protocol/src/test/protobuf/all_type.proto b/protocol/src/test/protobuf/all_type.proto index 620bfa2f..eaa438ab 100644 --- a/protocol/src/test/protobuf/all_type.proto +++ b/protocol/src/test/protobuf/all_type.proto @@ -8,7 +8,6 @@ import "one_message.proto"; option java_package = "start"; - // 如果protobuf的字段的tag超过1000,则视这个字段为需要兼容的协议字段 message AllType { bool field1 = 1; diff --git a/protocol/src/test/protobuf/one_enum.proto b/protocol/src/test/protobuf/one_enum.proto index ed2db709..7e93a1e4 100644 --- a/protocol/src/test/protobuf/one_enum.proto +++ b/protocol/src/test/protobuf/one_enum.proto @@ -3,8 +3,6 @@ syntax = "proto3"; package test.message; -option java_package = "io.edap.protobuf.test.message.v3"; - //message OneEnum { // Corpus corpus = 1; //} diff --git a/protocol/src/test/protobuf/one_map.proto b/protocol/src/test/protobuf/one_map.proto index 5396ba24..f874369f 100644 --- a/protocol/src/test/protobuf/one_map.proto +++ b/protocol/src/test/protobuf/one_map.proto @@ -1,10 +1,7 @@ syntax = "proto3"; - package test.message; -option java_package = "io.edap.protobuf.test.message.v3"; - // start_protocol_id = 200 message OneMap { diff --git a/protocol/src/test/protobuf/one_message.proto b/protocol/src/test/protobuf/one_message.proto index c565e80f..1c9e0387 100644 --- a/protocol/src/test/protobuf/one_message.proto +++ b/protocol/src/test/protobuf/one_message.proto @@ -3,8 +3,6 @@ syntax = "proto3"; package test.message; -option java_package = "io.edap.protobuf.test.message.v3"; - // start_protocol_id = 300 message OneMessage { @@ -22,7 +20,7 @@ message Proj { string name = 2; string repoPath = 3; //zzzzzzz - repeated int32 a = 4;//rrrrrrrrrrrrrrrrrrrrrrr + repeated int32 a = 4; map b = 5; map c = 1000; map d = 1001;