123456789101112131415161718192021222324252627282930313233343536 |
- package init
- import (
- "app.yhyue.com/moapp/jy_docs/rpc/partnerlib/internal/config"
- "app.yhyue.com/moapp/jy_docs/services/partner"
- jyDocsRpcUtil "app.yhyue.com/moapp/jy_docs/services/util"
- "flag"
- "github.com/zeromicro/go-zero/core/conf"
- )
- var (
- configFile = flag.String("c", "etc/partnerlib.yaml", "the partnerlib file")
- interfaceFile = flag.String("i", "etc/interface.yaml", "the interface file")
- crontabFile = flag.String("cron", "etc/crontab.yaml", "the crontab file")
- warnFile = flag.String("warn", "etc/warn.yaml", "the warn file")
- C config.Config
- I config.InterfaceInfo
- Cron config.CrontabInfo
- Warn config.Warn
- )
- func init() {
- conf.MustLoad(*configFile, &C)
- conf.MustLoad(*interfaceFile, &I)
- conf.MustLoad(*crontabFile, &Cron)
- conf.MustLoad(*warnFile, &Warn)
- if C.JyDocsMysqlDB.DataSourceName != "" && C.EsConfig.Addr != "" {
- jyDocsRpcUtil.InitDB(C.JyDocsMysqlDB.DataSourceName, C.JyDocsMysqlDB.DriverName, C.JyDocsMysqlDB.MaxOpenConn, C.JyDocsMysqlDB.MaxIdleConn)
- jyDocsRpcUtil.InitESV7(C.EsConfig.Addr, C.EsConfig.Pool, C.EsConfig.UserName, C.EsConfig.Password)
- jyDocsRpcUtil.InitRedis(C.RedisAddr)
- jyDocsRpcUtil.InitMongo(C.Mongo)
- jyDocsRpcUtil.InitOss(C.FileSystemConf)
- }
- //初始化 分类对应关系
- go partner.InitDocClass()
- }
|