film/config/daid.go

31 lines
452 B
Go
Raw Normal View History

2023-04-09 11:38:30 +08:00
package config
import (
"encoding/json"
"io/ioutil"
)
type Dadi struct {
BidProfit int64 `json:"bidProfit"`
CouponCost int64 `json:"couponCost"`
}
var (
dadiConfig *Dadi = nil
)
func LoadDadiConfig() {
body, err := ioutil.ReadFile("conf/dadi.json")
if err != nil {
panic(err)
}
dadiConfig = new(Dadi)
if err := json.Unmarshal([]byte(body), dadiConfig); err != nil {
panic(err)
}
}
func GetDadiConfig() *Dadi {
return dadiConfig
}