bidprice2

This commit is contained in:
jiangyong27 2023-04-09 11:38:30 +08:00
parent 683eeed3c3
commit 6bf037c5ec
2 changed files with 34 additions and 0 deletions

4
conf/dadi.json Normal file
View File

@ -0,0 +1,4 @@
{
"bidProfit": 50,
"couponCost": 3000
}

30
config/daid.go Normal file
View File

@ -0,0 +1,30 @@
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
}