This commit is contained in:
@@ -512,6 +512,24 @@ pub fn query_analytics_metric(
|
||||
}
|
||||
}
|
||||
|
||||
// 通用埋点入口开放给 Axum 调用;具体入口仍在业务 handler 成功后显式触发。
|
||||
#[spacetimedb::procedure]
|
||||
pub fn record_tracking_event_and_return(
|
||||
ctx: &mut ProcedureContext,
|
||||
input: RuntimeTrackingEventInput,
|
||||
) -> RuntimeTrackingEventProcedureResult {
|
||||
match ctx.try_with_tx(|tx| record_tracking_event(tx, input.clone())) {
|
||||
Ok(()) => RuntimeTrackingEventProcedureResult {
|
||||
ok: true,
|
||||
error_message: None,
|
||||
},
|
||||
Err(message) => RuntimeTrackingEventProcedureResult {
|
||||
ok: false,
|
||||
error_message: Some(message),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// 登录成功埋点由认证链路主动调用;任务中心只负责读取和刷新任务进度。
|
||||
#[spacetimedb::procedure]
|
||||
pub fn record_daily_login_tracking_event_and_return(
|
||||
|
||||
Reference in New Issue
Block a user