暂存一下,防止丢失

This commit is contained in:
2026-07-24 16:07:18 +08:00
parent 5d6e23f1a5
commit a18ed8bc8d
180 changed files with 13597 additions and 1986 deletions

View File

@@ -52,4 +52,35 @@ CREATE INDEX idx_integration_log_request ON tb_integration_log (request_id, crea
CREATE INDEX idx_integration_log_correlation ON tb_integration_log (correlation_id, created_at ASC) WHERE correlation_id IS NOT NULL;
COMMENT ON TABLE tb_integration_log IS '外部集成调用、回调及未发送尝试记录';
COMMENT ON COLUMN tb_integration_log.id IS '外部集成记录主键ID';
COMMENT ON COLUMN tb_integration_log.integration_id IS '跨重试保持稳定的外部集成记录ID';
COMMENT ON COLUMN tb_integration_log.idempotency_key IS '外部操作业务幂等键,空值表示该操作无幂等键';
COMMENT ON COLUMN tb_integration_log.provider IS '外部服务提供方稳定编码';
COMMENT ON COLUMN tb_integration_log.direction IS '交互方向inbound入站outbound出站';
COMMENT ON COLUMN tb_integration_log.operation IS '外部接口或回调操作稳定编码';
COMMENT ON COLUMN tb_integration_log.external_id IS '外部系统返回的业务或请求标识';
COMMENT ON COLUMN tb_integration_log.resource_type IS '本地主要业务资源类型';
COMMENT ON COLUMN tb_integration_log.resource_id IS '本地主要业务资源ID';
COMMENT ON COLUMN tb_integration_log.resource_key IS '本地主要业务资源稳定键';
COMMENT ON COLUMN tb_integration_log.trigger_source IS '触发来源,如接口、回调、轮询或人工恢复';
COMMENT ON COLUMN tb_integration_log.trigger_scene IS '触发外部交互的业务场景';
COMMENT ON COLUMN tb_integration_log.trigger_series IS '同一计划或补偿序列的稳定标识';
COMMENT ON COLUMN tb_integration_log.scheduled_at IS '计划执行外部交互的时间';
COMMENT ON COLUMN tb_integration_log.started_at IS '实际开始外部交互的时间';
COMMENT ON COLUMN tb_integration_log.attempt IS '同一幂等操作的技术尝试序号';
COMMENT ON COLUMN tb_integration_log.result IS '尝试结果pending 仅为内部执行态,其余为公开终态';
COMMENT ON COLUMN tb_integration_log.http_status IS '外部HTTP响应状态码';
COMMENT ON COLUMN tb_integration_log.provider_code IS '外部服务返回的稳定结果码';
COMMENT ON COLUMN tb_integration_log.provider_message IS '脱敏截断后的外部结果摘要';
COMMENT ON COLUMN tb_integration_log.request_summary IS '删除敏感信息后的请求摘要';
COMMENT ON COLUMN tb_integration_log.response_summary IS '删除敏感信息后的响应摘要';
COMMENT ON COLUMN tb_integration_log.content_hash IS '请求或回调正文的安全摘要';
COMMENT ON COLUMN tb_integration_log.duration_ms IS '本次外部交互耗时毫秒数';
COMMENT ON COLUMN tb_integration_log.state_changed IS '本次交互是否导致本地业务状态变化';
COMMENT ON COLUMN tb_integration_log.metadata IS '不含敏感值的结构化扩展元数据';
COMMENT ON COLUMN tb_integration_log.recovery_strategy IS '结果未知或失败后的恢复策略摘要';
COMMENT ON COLUMN tb_integration_log.request_id IS '来源HTTP请求ID';
COMMENT ON COLUMN tb_integration_log.correlation_id IS '跨事务和异步链路关联ID';
COMMENT ON COLUMN tb_integration_log.audit_event_id IS '预留的审计事件ID仅代码显式维护且不建立外键';
COMMENT ON COLUMN tb_integration_log.created_at IS '外部集成记录创建时间';
COMMENT ON COLUMN tb_integration_log.updated_at IS '外部集成记录更新时间';