package models import "git.apinb.com/bsm-sdk/core/database" // WalletBank 对应 wallet_bank,保存钱包绑定的银行卡密文档案。 type WalletBank struct { Entity // 公共实体字段 WalletBasicID uint64 `gorm:"column:wallet_basic_id;not null;index;uniqueIndex:idx_wallet_card" json:"wallet_basic_id"` // 钱包自增主键 CardNoCiphertext string `gorm:"column:card_no_ciphertext;type:text;not null" json:"-"` // 加密银行卡号 CardFingerprint string `gorm:"column:card_fingerprint;type:varchar(64);not null;uniqueIndex:idx_wallet_card" json:"-"` // 银行卡号不可逆指纹 CardNoLast4 string `gorm:"column:card_no_last4;type:varchar(4);not null;index" json:"card_no_last4"` // 银行卡号末四位 BankName string `gorm:"column:bank_name;type:varchar(128);not null" json:"bank_name"` // 银行名称 CardOwner string `gorm:"column:card_owner;type:varchar(128);not null" json:"card_owner"` // 持卡人姓名 IDCardCiphertext string `gorm:"column:id_card_ciphertext;type:text;not null" json:"-"` // 加密身份证号 PhoneCiphertext string `gorm:"column:phone_ciphertext;type:text;not null" json:"-"` // 加密银行预留手机号 BindID string `gorm:"column:bind_id;type:varchar(128);not null;default:'';uniqueIndex:,where:bind_id <> ''" json:"bind_id"` // 支付渠道绑定标识 BankType string `gorm:"column:bank_type;type:varchar(20);not null;default:''" json:"bank_type"` // 银行卡类型 Bank string `gorm:"column:bank;type:varchar(64);not null;default:''" json:"bank"` // 所属银行编码 } func init() { database.AppendMigrate(&WalletBank{}) } func (table *WalletBank) TableName() string { return "wallet_bank" }