35 lines
2.3 KiB
Go
35 lines
2.3 KiB
Go
package model
|
||
|
||
import "time"
|
||
|
||
// Order 对应表 orders,JSON 输出与现网接口 1:1(小写驼峰)
|
||
type Order struct {
|
||
ID string `gorm:"column:id;primaryKey;size:50" json:"id"`
|
||
OrderSN string `gorm:"column:order_sn;uniqueIndex;size:50" json:"orderSn"`
|
||
UserID string `gorm:"column:user_id;size:50" json:"userId"`
|
||
OpenID string `gorm:"column:open_id;size:100" json:"openId"`
|
||
ProductType string `gorm:"column:product_type;size:50" json:"productType"`
|
||
ProductID *string `gorm:"column:product_id;size:50" json:"productId,omitempty"`
|
||
Amount float64 `gorm:"column:amount;type:decimal(10,2)" json:"amount"`
|
||
Description *string `gorm:"column:description;size:200" json:"description,omitempty"`
|
||
Status *string `gorm:"column:status;size:20" json:"status,omitempty"`
|
||
TransactionID *string `gorm:"column:transaction_id;size:100" json:"transactionId,omitempty"`
|
||
PayTime *time.Time `gorm:"column:pay_time" json:"payTime,omitempty"`
|
||
ReferralCode *string `gorm:"column:referral_code;size:255" json:"referralCode,omitempty"`
|
||
ReferrerID *string `gorm:"column:referrer_id;size:255" json:"referrerId,omitempty"`
|
||
RefundReason *string `gorm:"column:refund_reason;size:500" json:"refundReason,omitempty"`
|
||
PaymentMethod *string `gorm:"column:payment_method;size:20" json:"paymentMethod,omitempty"`
|
||
// 代付:关联代付请求、实际付款人
|
||
GiftPayRequestID *string `gorm:"column:gift_pay_request_id;size:50" json:"giftPayRequestId,omitempty"`
|
||
PayerUserID *string `gorm:"column:payer_user_id;size:50" json:"payerUserId,omitempty"`
|
||
// 飞书 webhook 推送状态(paid 后实时推送;失败可补偿重推)
|
||
WebhookPushStatus string `gorm:"column:webhook_push_status;size:20;default:''" json:"webhookPushStatus,omitempty"`
|
||
WebhookPushedAt *time.Time `gorm:"column:webhook_pushed_at" json:"webhookPushedAt,omitempty"`
|
||
WebhookPushAttempts int `gorm:"column:webhook_push_attempts;default:0" json:"webhookPushAttempts,omitempty"`
|
||
WebhookPushError *string `gorm:"column:webhook_push_error;size:500" json:"webhookPushError,omitempty"`
|
||
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
|
||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
|
||
}
|
||
|
||
func (Order) TableName() string { return "orders" }
|