feat: 提交资源

This commit is contained in:
han_han9
2025-10-28 21:55:41 +08:00
parent 591f398085
commit 55c4fcd9ae
2146 changed files with 172747 additions and 456 deletions

7
protos/pkg1.bar.proto Normal file
View File

@@ -0,0 +1,7 @@
package pkg1;
syntax = "proto3";
message Bar {
// In proto3, fields are optional by default; 'required' is not allowed
int32 bar = 1;
}

18
protos/pkg1.common.proto Normal file
View File

@@ -0,0 +1,18 @@
syntax = "proto3";
package pkg1;
// 通用协议码定义,稳定标识每种业务消息类型
enum MessageCode {
MSG_UNKNOWN = 0;
// 用户相关
MSG_USER = 1001;
// 示例Bar 消息
MSG_BAR = 1002;
}
// 统一的包裹消息,承载协议码与具体消息的二进制负载
message Envelope {
int32 code = 1; // 对应 MessageCode
bytes payload = 2; // 具体消息 encode 后的字节
}

10
protos/pkg1.user.proto Normal file
View File

@@ -0,0 +1,10 @@
package pkg1;
syntax = "proto3";
message User {
int32 id = 1;
string name = 2;
int32 age = 3;
repeated string emails = 4;
}