package model import "time" type PaymentTransaction struct { ID int64 `gorm:"primaryKey;column:id;type:BIGINT;not null" json:"id"` UserID int64 `gorm:"column:user_id;type:BIGINT;not null" json:"userId"` BusinessType string `gorm:"column:business_type;type:VARCHAR(32);not null" json:"businessType"` BusinessOrderID int64 `gorm:"column:business_order_id;type:BIGINT;not null" json:"businessOrderId"` Provider string `gorm:"column:provider;type:VARCHAR(32);not null" json:"provider"` MerchantOrderNo string `gorm:"column:merchant_order_no;type:VARCHAR(128);not null" json:"merchantOrderNo"` ProviderTradeNo *string `gorm:"column:provider_trade_no;type:VARCHAR(128)" json:"-"` ProviderPayload string `gorm:"column:provider_payload;type:TEXT" json:"-"` RequestedAt *time.Time `gorm:"column:requested_at" json:"-"` TotalFeeFen int64 `gorm:"column:total_fee_fen;type:BIGINT;not null" json:"totalFeeFen"` Status string `gorm:"column:status;type:VARCHAR(16);not null;default:unpaid" json:"status"` CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"` PaidAt *time.Time `gorm:"column:paid_at" json:"paidAt"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"` } func (PaymentTransaction) TableName() string { return "payment_transaction" } type PaymentCallbackEvent struct { ID int64 `gorm:"primaryKey;column:id;type:BIGINT;not null" json:"id"` Provider string `gorm:"column:provider;type:VARCHAR(32);not null" json:"provider"` EventKey string `gorm:"column:event_key;type:VARCHAR(128);not null" json:"eventKey"` PayloadHash string `gorm:"column:payload_hash;type:VARCHAR(64);not null" json:"payloadHash"` Verified bool `gorm:"column:verified;type:TINYINT(1);not null" json:"verified"` ProcessedAt *time.Time `gorm:"column:processed_at" json:"processedAt"` ResultCode string `gorm:"column:result_code;type:VARCHAR(64)" json:"resultCode"` CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"` } type AGPayCallback struct { TradeNo string `json:"tradeNo" binding:"required,max=128"` } func (PaymentCallbackEvent) TableName() string { return "payment_callback_event" }