us-coach-spider/product/option.go
timerzz 8934e23bd8
All checks were successful
Build image / build (push) Successful in 1m34s
feat 配置写入数据库
2024-05-14 16:17:04 +08:00

15 lines
415 B
Go

package product
import "time"
type Option struct {
ID uint `gorm:"primary_key" json:"id"`
Interval time.Duration `yaml:"interval"`
ExchangeRate float64 `yaml:"exchangeRate"` //汇率
Freight float64 `yaml:"freight"` //运费
}
func (c *Controller) LoadOption() {
c.db.FirstOrCreate(&c.Option, Option{Interval: time.Hour * 30, ExchangeRate: 7.3, Freight: 100})
}