package config import ( "app.yhyue.com/moapp/jybase/common" qrpc "app.yhyue.com/moapp/message/model" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/os/gcfg" ) type config struct { Nsq struct { Address string } Redis struct { Address string } Mongodb struct { Address string Size int DbName string ReplSet string UserName string Password string } Etcd struct { Hosts []string Key string } DocPoints struct { AppId string Open struct { Max int64 Jyweb_article_open int64 Jydocs_doc_open int64 } Jywx_subscribe_new int64 Jywx_subscribe_invite int64 Jywx_subscribe_invited int64 } } var PushConfig *pushConfig type pushConfig struct { Webdomain string `json:"webdomain"` Weixinrpc string `json:"weixinrpc"` PushPoolSize int `json:"pushPoolSize"` WxMsg struct { Id string First *qrpc.TmplItem Keyword1 *qrpc.TmplItem Keyword2 *qrpc.TmplItem Keyword3 *qrpc.TmplItem Keyword4 *qrpc.TmplItem Remark *qrpc.TmplItem } `json:"wxTplMsg"` TestId string `json:"testId"` DelayedTime int `json:"delayedTime"` } //var Config *config func init() { //推送配置文件 common.ReadConfig("./etc/push.json", &PushConfig) //系统配置文件 //common.ReadConfig(&Config) g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("./etc/config.yaml") }