|
@@ -3,12 +3,10 @@ package common
|
|
|
import (
|
|
|
"flag"
|
|
|
"log"
|
|
|
- "strings"
|
|
|
|
|
|
. "app.yhyue.com/moapp/jybase/es"
|
|
|
"app.yhyue.com/moapp/jybase/mongodb"
|
|
|
"app.yhyue.com/moapp/jybase/mysql"
|
|
|
- "app.yhyue.com/moapp/jybase/redis"
|
|
|
"bp.jydev.jianyu360.cn/BaseService/fileCenter/rpc/filecenter"
|
|
|
"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
|
|
|
"bp.jydev.jianyu360.cn/CRM/application/api/internal/config"
|
|
@@ -16,13 +14,11 @@ import (
|
|
|
"bp.jydev.jianyu360.cn/CRM/baseCenter/rpc/basecenter"
|
|
|
"github.com/zeromicro/go-zero/core/conf"
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
|
- "github.com/zeromicro/go-zero/zrpc"
|
|
|
)
|
|
|
|
|
|
var configFile = flag.String("fs", "etc/crmapplication.yaml", "the config file")
|
|
|
var C config.Config
|
|
|
|
|
|
-//
|
|
|
var logFile = flag.String("lf", "etc/logs.yaml", "the config file")
|
|
|
var logc entity.Logc
|
|
|
|
|
@@ -101,12 +97,6 @@ func init() {
|
|
|
}
|
|
|
CrmMysql.Init()
|
|
|
}
|
|
|
- //初始化数据库配置
|
|
|
- rm := DB.Redis
|
|
|
- if len(rm.Addr) > 0 {
|
|
|
- logx.Info("--初始化 redis--")
|
|
|
- redis.InitRedisBySize(strings.Join(rm.Addr, ","), 100, 30, 300)
|
|
|
- }
|
|
|
if DB.Mongo.Main.Address != "" {
|
|
|
logx.Info("--初始化 mongodb--")
|
|
|
Mgo = mongodb.MongodbSim{
|
|
@@ -143,6 +133,7 @@ func init() {
|
|
|
log.Println("--初始化 elasticsearch--")
|
|
|
NewEs(DB.Es.Version, DB.Es.Addr, DB.Es.Size, DB.Es.UserName, DB.Es.Password)
|
|
|
}
|
|
|
+
|
|
|
UserCenterRpc = usercenter.NewUserCenter(zrpc.MustNewClient(C.UserCenterRpc))
|
|
|
FileCenterRpc = filecenter.NewFileCenter(zrpc.MustNewClient(C.FileCenterRpc))
|
|
|
BaseCenterRpc = basecenter.NewBaseCenter(zrpc.MustNewClient(C.BaseCenterRpc))
|