26 lines
1.0 KiB
Protocol Buffer
26 lines
1.0 KiB
Protocol Buffer
syntax = "proto3";
|
||
|
||
package topfans.event;
|
||
|
||
option go_package = "github.com/topfans/backend/pkg/proto/event;event";
|
||
|
||
// ==================== 通用事件 ====================
|
||
// 独立 proto 文件,跨服务复用。其他服务(如 socialService、assetService 等)
|
||
// 可以只引用 event.proto 而不必引用 statistic.proto,避免循环依赖。
|
||
|
||
// 单条事件
|
||
message Event {
|
||
string event_id = 1; // 事件 ID(UUID,客户端生成,用于去重)
|
||
int64 user_id = 2; // 用户 ID
|
||
int64 star_id = 3; // 顶粉星城 ID
|
||
string event_type = 4; // 事件类型(如 "asset.like", "exhibition.start")
|
||
int64 occurred_at = 5; // 事件发生时间(ms timestamp)
|
||
int64 received_at = 6; // 服务端接收时间(ms,服务端填充)
|
||
map<string, string> properties = 7; // 自定义属性(扁平 key-value)
|
||
}
|
||
|
||
// 批量事件请求
|
||
message BatchEventRequest {
|
||
repeated Event events = 1;
|
||
}
|