2024-05-14 15:27:40 +08:00
|
|
|
package product
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type Option struct {
|
2024-05-14 16:17:04 +08:00
|
|
|
ID uint `gorm:"primary_key" json:"id"`
|
2024-05-14 15:27:40 +08:00
|
|
|
Interval time.Duration `yaml:"interval"`
|
|
|
|
ExchangeRate float64 `yaml:"exchangeRate"` //汇率
|
|
|
|
Freight float64 `yaml:"freight"` //运费
|
|
|
|
}
|
2024-05-14 16:17:04 +08:00
|
|
|
|
|
|
|
func (c *Controller) LoadOption() {
|
|
|
|
c.db.FirstOrCreate(&c.Option, Option{Interval: time.Hour * 30, ExchangeRate: 7.3, Freight: 100})
|
|
|
|
}
|