js_reverse/protobuf/addressbook.proto
2021-08-13 14:53:16 +08:00

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;
}