优化发货接口对接流程

This commit is contained in:
yml2213
2026-07-30 23:44:50 +08:00
parent a16e518b6c
commit ee956e2e01
14 changed files with 428 additions and 141 deletions
+13
View File
@@ -289,6 +289,19 @@ type APIRequestNonce struct {
ExpiresAt time.Time `gorm:"not null;index" json:"expires_at"`
}
// SourceAPINonce 记录源头接口的请求 nonce,保证重放保护跨进程、跨重启生效。
type SourceAPINonce struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"created_at"`
APIKey string `gorm:"size:96;not null;uniqueIndex:idx_source_api_nonce" json:"-"`
Nonce string `gorm:"size:64;not null;uniqueIndex:idx_source_api_nonce" json:"-"`
ExpiresAt time.Time `gorm:"not null;index" json:"-"`
}
func (SourceAPINonce) TableName() string {
return "source_api_nonces"
}
// AuditLog 留存后台和开放接口的重要业务操作。
type AuditLog struct {
ID uint `gorm:"primarykey" json:"id"`