2023-04-09 11:38:30 +08:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"io/ioutil"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Dadi struct {
|
2023-04-09 12:16:09 +08:00
|
|
|
Enable bool `json:"enable"`
|
2023-04-09 11:38:30 +08:00
|
|
|
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
|
|
|
|
}
|