Pārlūkot izejas kodu

feat:检索库

wangshan 3 gadi atpakaļ
vecāks
revīzija
cbbf1dfd55

+ 3 - 1
rpc/manager/etc/manager.yaml

@@ -19,7 +19,9 @@ Redis:
 Nsq:
   ip: 192.168.3.207:4150
   topic: jyinfo
-
+Es:
+  addr: http://192.168.3.206:9800
+  size: 5
 Sensitive:
   information: true
   supplyInfo: false

+ 4 - 1
rpc/manager/init/init.go

@@ -25,7 +25,7 @@ var logFile = flag.String("lf", "etc/logs.yaml", "the config file")
 var logc entity.Logc
 
 //管理员
-var MUserIdMap map[string]bool
+var MUserIdMap = map[string]bool{}
 
 func init() {
 	conf.MustLoad(*configF, &C)
@@ -52,6 +52,9 @@ func init() {
 	//初始NSQ
 	nm := C.Nsq
 	model.InitNsqConfig(&nm)
+	//初始es
+	es := C.Es
+	model.InitEs(&es)
 	//管理员信息
 	if len(C.ManagerUserId) > 0 {
 		for _, v := range C.ManagerUserId {

+ 1 - 0
rpc/manager/internal/config/config.go

@@ -12,6 +12,7 @@ type Config struct {
 	MysqlMain     entity.MysqlMainStruct
 	Redis         entity.RedisStuct
 	Nsq           entity.NsqStruct
+	Es            entity.EsStruct
 	Sensitive     entity.Sensitive
 	ManagerUserId []string
 }

+ 0 - 14
rpc/manager/internal/logic/infoonekeyactionlogic.go

@@ -58,20 +58,6 @@ func (l *InfoOneKeyActionLogic) InfoOneKeyAction(in *manager.OneKeyActionReq) (*
 				switch in.MsgType {
 				case "3": //供应信息
 				case "1", "2": //招标信息,采购信息
-					//var info jycommon.Information
-					//marshal, err := json.Marshal(res)
-					//if err != nil {
-					//	fmt.Println("marshal:", err)
-					//	resp.ErrMsg = err.Error()
-					//	break
-					//}
-					//err = json.Unmarshal(marshal, &info)
-					//if err != nil {
-					//	fmt.Println("unmarshal:", err)
-					//	resp.ErrMsg = err.Error()
-					//	break
-					//}
-					//appInfo := mc.StructToMapMore(info)
 					//nsq发布信息
 					nsq, err := util.NewNsqInfo(model.NsqConfig.Ip, model.NsqConfig.Topic, msgId, "2", mc.InterfaceToStr(in.MsgType), false, res)
 					if err != nil || nsq.NsqPushInfo() != nil {