feat: 实现公共工具包,包括日志、错误处理、数据库和缓存
This commit is contained in:
55
backend/shared/proto/common/common.proto
Normal file
55
backend/shared/proto/common/common.proto
Normal file
@@ -0,0 +1,55 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package common;
|
||||
|
||||
// 通用响应结构
|
||||
message Response {
|
||||
int32 code = 1;
|
||||
string message = 2;
|
||||
bytes data = 3;
|
||||
}
|
||||
|
||||
// 分页请求
|
||||
message PaginationRequest {
|
||||
int32 page = 1;
|
||||
int32 page_size = 2;
|
||||
}
|
||||
|
||||
// 分页响应
|
||||
message PaginationResponse {
|
||||
int32 total = 1;
|
||||
int32 page = 2;
|
||||
int32 page_size = 3;
|
||||
int32 total_pages = 4;
|
||||
}
|
||||
|
||||
// 错误信息
|
||||
message Error {
|
||||
int32 code = 1;
|
||||
string message = 2;
|
||||
string details = 3;
|
||||
}
|
||||
|
||||
// 空请求
|
||||
message EmptyRequest {
|
||||
}
|
||||
|
||||
// 空响应
|
||||
message EmptyResponse {
|
||||
}
|
||||
|
||||
// ID 请求
|
||||
message IDRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// ID 响应
|
||||
message IDResponse {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
// 状态响应
|
||||
message StatusResponse {
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user