chore[proto]: update document and proto

This commit is contained in:
godotg
2023-12-12 16:17:44 +08:00
parent e2fc5eef97
commit 7fe41cdc75
6 changed files with 12 additions and 19 deletions
+10 -8
View File
@@ -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
+1 -2
View File
@@ -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使用
### Ⅱ. 快速使用
@@ -8,7 +8,6 @@ import "one_message.proto";
option java_package = "start";
// 如果protobuf的字段的tag超过1000,则视这个字段为需要兼容的协议字段
message AllType {
bool field1 = 1;
@@ -3,8 +3,6 @@ syntax = "proto3";
package test.message;
option java_package = "io.edap.protobuf.test.message.v3";
//message OneEnum {
// Corpus corpus = 1;
//}
-3
View File
@@ -1,10 +1,7 @@
syntax = "proto3";
package test.message;
option java_package = "io.edap.protobuf.test.message.v3";
// start_protocol_id = 200
message OneMap {
+1 -3
View File
@@ -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<int32, int64> b = 5;
map<int32, string> c = 1000;
map<int32, SimpleObject> d = 1001;