You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
1.3 KiB

4 weeks ago
package model
import "github.com/shopspring/decimal"
type ExchangeRate struct {
RateId int64 `gorm:"primary_key;column:rate_id" json:"rateId"` // 主键 ID
FromName string `gorm:"column:from_name" json:"fromName"` // 来源币种名称,例如人民币
FromCurrency string `gorm:"column:from_currency" json:"fromCurrency"` // 来源币种代码,例如 CNY
FromAmt decimal.Decimal `gorm:"column:from_amt" json:"fromAmt"` // 来源币种的基准金额
Unit string `gorm:"column:unit" json:"unit"` // 单位,例如 元
ToName string `gorm:"column:to_name" json:"toName"` // 目标币种名称
ToCurrency string `gorm:"column:to_currency" json:"toCurrency"` // 目标币种代码
ToAmt decimal.Decimal `gorm:"column:to_amt" json:"toAmt"` // 目标币种的金额
Date int64 `gorm:"column:date" json:"date"` // 汇率对应的日期(时间戳)
Status string `gorm:"column:status" json:"status"` // 状态值,例如 1 表示正常2 表示禁用
CreateTime int64 `gorm:"column:create_time" json:"create_time"` // 创建时间戳(秒)
}
func (ExchangeRate) TableName() string {
return "exchange_rate"
}