Model层:新增金额分字段定义

- 所有 Model 添加对应的 *Cent int64 字段
- 旧的 float64 字段保留但不输出到 JSON (json:"-")
- 涉及文件:user.go, listing.go, order.go, order_checkout.go, wallet.go, withdrawal.go
- 目标:为后续业务逻辑切换到分存储做准备

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
yml
2026-06-09 13:31:29 +08:00
co-authored by Claude Opus 4.8
parent eaa10d839c
commit b80719d538
6 changed files with 119 additions and 94 deletions
+6 -3
View File
@@ -6,9 +6,12 @@ type WithdrawalRequest struct {
ID uint64 `gorm:"primaryKey" json:"id"`
WithdrawNo string `gorm:"size:64;not null;uniqueIndex" json:"withdraw_no"`
UserID uint64 `gorm:"not null;index" json:"user_id"`
Amount float64 `gorm:"type:decimal(12,2);not null" json:"amount"`
Fee float64 `gorm:"type:decimal(12,2);not null;default:0.00" json:"fee"`
ActualAmount float64 `gorm:"type:decimal(12,2);not null" json:"actual_amount"`
Amount float64 `gorm:"type:decimal(12,2);not null" json:"-"`
AmountCent int64 `gorm:"not null;default:0" json:"-"`
Fee float64 `gorm:"type:decimal(12,2);not null;default:0.00" json:"-"`
FeeCent int64 `gorm:"not null;default:0" json:"-"`
ActualAmount float64 `gorm:"type:decimal(12,2);not null" json:"-"`
ActualAmountCent int64 `gorm:"not null;default:0" json:"-"`
PaymentAccountID *uint64 `json:"payment_account_id"`
AccountType string `gorm:"size:32;not null" json:"account_type"`
AccountName string `gorm:"size:128;not null" json:"account_name"`