mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-20 13:30:03 +08:00
27 lines
490 B
Protocol Buffer
27 lines
490 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
// message 语法关键字 定义一个消息
|
|
message Person {
|
|
string name = 1;
|
|
int32 id = 2;
|
|
string email = 3;
|
|
enum PhoneType {
|
|
MOBILE = 0;
|
|
HOME = 1;
|
|
WORK = 2;
|
|
}
|
|
|
|
// 嵌套一个 message
|
|
message PhoneNumber {
|
|
repeated string number = 1;
|
|
PhoneType type = 2;
|
|
}
|
|
|
|
// 上面定义的消息要被使用
|
|
repeated PhoneNumber phones = 4;
|
|
}
|
|
|
|
message AddressBook {
|
|
repeated Person people = 1;
|
|
}
|