Expand description
通用适配器:JSON ↔ Protobuf 转换 + 请求分发
核心思路:
- HTTP 请求带 JSON body → 反序列化为 prost Message → encode 为 bytes
- 构造 IncomingRequest { proto_id, body } → 调用 RequestRouter::dispatch
- 响应 bytes → decode 为 prost Message → 序列化为 JSON 返回
Structs§
- ApiResponse
- 通用响应格式(包装 proto 响应,加 ret_type/ret_msg)
- Rest
State - REST 服务共享状态
Functions§
- proto_
request - 通用 protobuf 请求-响应适配器