Files
hfb_sys/backend/internal/model/withdrawal.go
T
ymlandClaude Opus 4.8 b80719d538 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>
2026-06-09 13:31:29 +08:00

36 lines
1.8 KiB
Go

package model
import "time"
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:"-"`
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"`
AccountNo string `gorm:"size:128;not null" json:"account_no"`
BankName string `gorm:"size:128;not null;default:''" json:"bank_name"`
BankBranch string `gorm:"size:255;not null;default:''" json:"bank_branch"`
Status string `gorm:"size:32;not null;default:'pending'" json:"status"`
ReviewedBy *uint64 `json:"reviewed_by"`
ReviewedAt *time.Time `json:"reviewed_at"`
ReviewRemark string `gorm:"size:255;not null;default:''" json:"review_remark"`
PaidBy *uint64 `json:"paid_by"`
PaidAt *time.Time `json:"paid_at"`
PaymentProofURL string `gorm:"size:512;not null;default:''" json:"payment_proof_url"`
PaymentRemark string `gorm:"size:255;not null;default:''" json:"payment_remark"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (WithdrawalRequest) TableName() string {
return "withdrawal_requests"
}