elonX/model/exchange.go
2025-02-20 16:47:08 +08:00

22 lines
1.3 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"
}