29 lines
1.2 KiB
Go
29 lines
1.2 KiB
Go
package model
|
||
|
||
import (
|
||
"time"
|
||
|
||
core "git.yuntuo.hk/k2safe/orbit/model"
|
||
)
|
||
|
||
// AttemptReceipt 表示执行操作的持久化确认,用于断线或确认丢失后的幂等补取。
|
||
// 对应表 pulse_attempt_receipts;这是服务端持久化模型,不直接作为 API 响应。
|
||
type AttemptReceipt struct {
|
||
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
|
||
core.Record
|
||
// AttemptID 关联的独立执行尝试标识。
|
||
AttemptID core.ID `db:"attempt_id"`
|
||
// Operation 稳定操作类型,用于区分不同接口的幂等作用域。
|
||
Operation string `db:"operation"`
|
||
// MessageID 可靠操作消息身份,跨重连重报时保持稳定。
|
||
MessageID core.ID `db:"message_id"`
|
||
// RequestDigest 规范化请求语义的 SHA-256 摘要,用于识别同键不同内容。
|
||
RequestDigest core.Digest `db:"request_digest"`
|
||
// Response 首次可靠提交后的响应 JSON,供重复请求补取确认。
|
||
Response core.JSON `db:"response"`
|
||
// ExpiresAt 过期时间,统一 UTC;到期后的行为由对应资源策略决定。
|
||
ExpiresAt time.Time `db:"expires_at"`
|
||
}
|
||
|
||
func (AttemptReceipt) TableName() string { return "pulse_attempt_receipts" }
|