Commit 5ed78a04 by 孙龙

init

parent fcdae79c
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
/.idea /.idea
/.DS_Store /.DS_Store
/logs/* /logs/*
/config/*.toml
...@@ -15,3 +15,4 @@ send_mail="http://crm.liexin.net/api/sendCaiGouEmailByOrderAdmin" ...@@ -15,3 +15,4 @@ send_mail="http://crm.liexin.net/api/sendCaiGouEmailByOrderAdmin"
[Ding_msg] [Ding_msg]
webhook="https://oapi.dingtalk.com/robot/send?access_token=ec03b2cba0d62ef0bd7b9ebb16aaf69b5f626658dfb6b194045381324b0786cf" webhook="https://oapi.dingtalk.com/robot/send?access_token=ec03b2cba0d62ef0bd7b9ebb16aaf69b5f626658dfb6b194045381324b0786cf"
jingDiao="https://oapi.dingtalk.com/robot/send?access_token=eaeae1253e9c125a053bc8a7bcfec5096a23625a98044eaa346591863449ba17"
...@@ -10,6 +10,7 @@ type Config struct{ ...@@ -10,6 +10,7 @@ type Config struct{
Liexin_databases *LiexinMysqlConfig Liexin_databases *LiexinMysqlConfig
Rabbitmq_ichunt *RabbitmqIchunt Rabbitmq_ichunt *RabbitmqIchunt
Crm_domain *SendMail Crm_domain *SendMail
Ding_msg *Ding
} }
...@@ -29,13 +30,24 @@ type SendMail struct{ ...@@ -29,13 +30,24 @@ type SendMail struct{
SendMailUrl string `toml:"send_mail"` SendMailUrl string `toml:"send_mail"`
} }
type Ding struct {
Webhook string `toml:"webhook"`
JingDiao string `toml:"jingDiao"`
}
var Configs *Config =new (Config) var Configs *Config =new (Config)
func Init(){ func Init(){
_, err := toml.DecodeFile("config/config.toml",Configs) var err error
_, err = toml.DecodeFile("config/config.toml",Configs)
_, err = toml.DecodeFile("config/db.toml",Configs)
if err!=nil{ if err!=nil{
fmt.Println(err) fmt.Println(err)
} }
fmt.Printf("%+v",Configs.Liexin_databases)
fmt.Printf("%+v",Configs.Rabbitmq_ichunt)
fmt.Printf("%+v",Configs.Crm_domain)
fmt.Printf("%+v",Configs.Ding_msg)
//fmt.Printf("%+v",Configs.Crm_domain) //fmt.Printf("%+v",Configs.Crm_domain)
//fmt.Printf("%+v",Configs.Rabbitmq_ichunt) //fmt.Printf("%+v",Configs.Rabbitmq_ichunt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment