浏览代码

fenzhihebing

123456 2 年之前
父节点
当前提交
1f81c41e6c

+ 29 - 22
jyBXBase/entity/db.go

@@ -1,55 +1,62 @@
 package entity
 
 type Mongo struct {
-      Main    *MongoStruct `json:"main,optional"`
-      MgoLog  *MongoStruct `json:"mgoLog,optional"`
-      Ent     *MongoStruct `json:"ent,optional"`
-      Bidding *MongoStruct `json:"bidding,optional"`
+	Main    *MongoStruct `json:"main,optional"`
+	MgoLog  *MongoStruct `json:"mgoLog,optional"`
+	Ent     *MongoStruct `json:"ent,optional"`
+	Bidding *MongoStruct `json:"bidding,optional"`
 }
 
 //
 type MongoStruct struct {
-      Address        string `json:"address"`
-      Size           int    `json:"size"`
-      DbName         string `json:"dbName"`
-      UserName       string `json:"userName,optional"`
-      Password       string `json:"password,optional"`
-      Collection     string `json:"collection,optional"`
-      CollectionBack string `json:"collectionBack,optional"`
-      MaxOpenConns   int    `json:"maxOpenConns,optional"`
-      MaxIdleConns   int    `json:"maxIdleConns,optional"`
+	Address        string `json:"address"`
+	Size           int    `json:"size"`
+	DbName         string `json:"dbName"`
+	UserName       string `json:"userName,optional"`
+	Password       string `json:"password,optional"`
+	Collection     string `json:"collection,optional"`
+	CollectionBack string `json:"collectionBack,optional"`
+	MaxOpenConns   int    `json:"maxOpenConns,optional"`
+	MaxIdleConns   int    `json:"maxIdleConns,optional"`
 }
 
 type Mysql struct {
+<<<<<<< HEAD
 <<<<<<< HEAD
       Main        *MysqlStruct `json:"main,optional"`
       BaseService *MysqlStruct `json:"baseService,omitempty"`
 =======
+=======
+>>>>>>> feature/v1.1.5
 	Main         *MysqlStruct `json:"main,optional"`
+	BaseService  *MysqlStruct `json:"baseService,omitempty"`
 	Push         *MysqlStruct `json:"push,optional"`
 	MemberPush   *MysqlStruct `json:"memberPush"`
 	EntnichePush *MysqlStruct `json:"entnichePush"`
+<<<<<<< HEAD
 	BaseService  *MysqlStruct `json:"baseService"`
 >>>>>>> master
+=======
+>>>>>>> feature/v1.1.5
 }
 
 //mysql
 type MysqlStruct struct {
-      DbName       string `json:"dbName,optional"`
-      Address      string `json:"address,optional"`
-      UserName     string `json:"userName,optional"`
-      Password     string `json:"password,optional"`
-      MaxOpenConns int    `json:"maxOpenConns,optional"`
-      MaxIdleConns int    `json:"maxIdleConns,optional"`
+	DbName       string `json:"dbName,optional"`
+	Address      string `json:"address,optional"`
+	UserName     string `json:"userName,optional"`
+	Password     string `json:"password,optional"`
+	MaxOpenConns int    `json:"maxOpenConns,optional"`
+	MaxIdleConns int    `json:"maxIdleConns,optional"`
 }
 
 //redis
 type RedisStuct struct {
-      Addr []string `json:"addr"`
+	Addr []string `json:"addr"`
 }
 
 //es
 type EsStruct struct {
-      Addr string `json:"addr"`
-      Size int    `json:"size"`
+	Addr string `json:"addr"`
+	Size int    `json:"size"`
 }

+ 11 - 4
jyBXBase/rpc/etc/db.yaml

@@ -13,11 +13,18 @@ mysql:
         password: '=PDT49#80Z!RVv52_z'
         maxOpenConns: 5
         maxIdleConns: 5
-    baseService:
-        dbName: base_service
-        address: 192.168.3.217:4000
+    memberPush:
+        dbName: jianyu
+        address: 192.168.3.11:3366
         userName: root
-        password: '=PDT49#80Z!RVv52_z'
+        password: Topnet123
+        maxOpenConns: 5
+        maxIdleConns: 5
+    entnichePush:
+        dbName: jianyu
+        address: 192.168.3.11:3366
+        userName: root
+        password: Topnet123
         maxOpenConns: 5
         maxIdleConns: 5
 redis:

+ 70 - 43
jyBXBase/rpc/init/db.go

@@ -4,6 +4,7 @@
 package init
 
 import (
+<<<<<<< HEAD
 <<<<<<< HEAD
         "app.yhyue.com/moapp/jybase/esv1"
         "app.yhyue.com/moapp/jybase/mongodb"
@@ -25,12 +26,16 @@ var (
 
 	"github.com/zeromicro/go-zero/core/logx"
 
+=======
+>>>>>>> feature/v1.1.5
 	"jyBXBase/entity"
+	"strings"
 
 	"app.yhyue.com/moapp/jybase/esv1"
 	"app.yhyue.com/moapp/jybase/mongodb"
 	"app.yhyue.com/moapp/jybase/mysql"
 	"app.yhyue.com/moapp/jybase/redis"
+	"github.com/zeromicro/go-zero/core/logx"
 )
 
 var (
@@ -42,48 +47,52 @@ var (
 	Mgo                mongodb.MongodbSim
 	MgoEnt             mongodb.MongodbSim
 	MgoBidding         mongodb.MongodbSim
+<<<<<<< HEAD
 >>>>>>> master
+=======
+>>>>>>> feature/v1.1.5
 )
 
 //
 func MongoDBInit(em *entity.Mongo) {
-      //初始化 mongodb
-      if em.Main.Address != "" {
-	  logx.Info("--初始化 mongodb--")
-	  Mgo = mongodb.MongodbSim{
-	        MongodbAddr: em.Main.Address,
-	        Size:        em.Main.Size,
-	        DbName:      em.Main.DbName,
-	  }
-	  Mgo.InitPool()
-      }
-      //
-      if em.Bidding.Address != "" {
-	  logx.Info("--初始化 mongodb bidding--")
-	  MgoBidding = mongodb.MongodbSim{
-	        MongodbAddr: em.Bidding.Address,
-	        Size:        em.Bidding.Size,
-	        DbName:      em.Bidding.DbName,
-	        UserName:    em.Bidding.UserName,
-	        Password:    em.Bidding.Password,
-	  }
-	  MgoBidding.InitPool()
-      }
-      if em.Ent.Address != "" {
-	  logx.Info("--初始化 mongodb ent--")
-	  MgoEnt = mongodb.MongodbSim{
-	        MongodbAddr: em.Ent.Address,
-	        Size:        em.Ent.Size,
-	        DbName:      em.Ent.DbName,
-	        UserName:    em.Ent.UserName,
-	        Password:    em.Ent.Password,
-	  }
-	  MgoEnt.InitPool()
-      }
+	//初始化 mongodb
+	if em.Main.Address != "" {
+		logx.Info("--初始化 mongodb--")
+		Mgo = mongodb.MongodbSim{
+			MongodbAddr: em.Main.Address,
+			Size:        em.Main.Size,
+			DbName:      em.Main.DbName,
+		}
+		Mgo.InitPool()
+	}
+	//
+	if em.Bidding.Address != "" {
+		logx.Info("--初始化 mongodb bidding--")
+		MgoBidding = mongodb.MongodbSim{
+			MongodbAddr: em.Bidding.Address,
+			Size:        em.Bidding.Size,
+			DbName:      em.Bidding.DbName,
+			UserName:    em.Bidding.UserName,
+			Password:    em.Bidding.Password,
+		}
+		MgoBidding.InitPool()
+	}
+	if em.Ent.Address != "" {
+		logx.Info("--初始化 mongodb ent--")
+		MgoEnt = mongodb.MongodbSim{
+			MongodbAddr: em.Ent.Address,
+			Size:        em.Ent.Size,
+			DbName:      em.Ent.DbName,
+			UserName:    em.Ent.UserName,
+			Password:    em.Ent.Password,
+		}
+		MgoEnt.InitPool()
+	}
 }
 
 //
 func MysqlInit(em *entity.Mysql) {
+<<<<<<< HEAD
 <<<<<<< HEAD
       //初始化 mysql-main
       if em.Main.Address != "" {
@@ -112,6 +121,21 @@ func MysqlInit(em *entity.Mysql) {
 	  BaseServiceMysql.Init()
       }
 =======
+=======
+	//初始化 mysql-main
+	if em.Main.Address != "" {
+		logx.Info("--初始化 main mysql--")
+		MainMysql = &mysql.Mysql{
+			Address:      em.Main.Address,
+			UserName:     em.Main.UserName,
+			PassWord:     em.Main.Password,
+			DBName:       em.Main.DbName,
+			MaxOpenConns: em.Main.MaxOpenConns,
+			MaxIdleConns: em.Main.MaxIdleConns,
+		}
+		MainMysql.Init()
+	}
+>>>>>>> feature/v1.1.5
 	//初始化 mysql-main
 	if em.Main.Address != "" {
 		logx.Info("--初始化 main mysql--")
@@ -176,23 +200,26 @@ func MysqlInit(em *entity.Mysql) {
 		}
 		BaseServiceMysql.Init()
 	}
+<<<<<<< HEAD
 >>>>>>> master
+=======
+>>>>>>> feature/v1.1.5
 }
 
 //
 func RedisInit(rm *entity.RedisStuct) {
-      //初始化 redis
-      if len(rm.Addr) > 0 {
-	  logx.Info("--初始化 redis--")
-	  redis.InitRedisBySize(strings.Join(rm.Addr, ","), 100, 30, 300)
-      }
+	//初始化 redis
+	if len(rm.Addr) > 0 {
+		logx.Info("--初始化 redis--")
+		redis.InitRedisBySize(strings.Join(rm.Addr, ","), 100, 30, 300)
+	}
 }
 
 //
 func EsInit(es *entity.EsStruct) {
-      //初始化 elasticsearch
-      if es.Addr != "" {
-	  logx.Info("--初始化 elasticsearch--")
-	  elastic.InitElasticSize(es.Addr, es.Size)
-      }
+	//初始化 elasticsearch
+	if es.Addr != "" {
+		logx.Info("--初始化 elasticsearch--")
+		elastic.InitElasticSize(es.Addr, es.Size)
+	}
 }

+ 20 - 19
jyBXBase/rpc/init/init.go

@@ -1,12 +1,13 @@
 package init
 
 import (
-        "flag"
-        _ "github.com/go-sql-driver/mysql"
-        "github.com/zeromicro/go-zero/core/conf"
-        "github.com/zeromicro/go-zero/core/logx"
-        "jyBXBase/entity"
-        "jyBXBase/rpc/internal/config"
+	"flag"
+	"jyBXBase/entity"
+	"jyBXBase/rpc/internal/config"
+
+	_ "github.com/go-sql-driver/mysql"
+	"github.com/zeromicro/go-zero/core/conf"
+	"github.com/zeromicro/go-zero/core/logx"
 )
 
 var configFile = flag.String("cf", "etc/bxbase.yaml", "the config file")
@@ -22,19 +23,19 @@ var logFile = flag.String("lf", "etc/logs.yaml", "the logs file")
 var logc entity.Logc
 
 func init() {
-        //初始化日志信息
-        conf.MustLoad(*logFile, &logc)
-        if len(logc.Level) > 0 {
-	      for _, v := range logc.Level {
-		    logx.MustSetup(logx.LogConf{
-			  Mode:     logc.Mode,
-			  Path:     logc.Path,
-			  Level:    v,
-			  KeepDays: logc.KeepDays,
-		    })
-		    logx.Info(v, "--日志记录")
-	      }
-        }
+	//初始化日志信息
+	conf.MustLoad(*logFile, &logc)
+	if len(logc.Level) > 0 {
+		for _, v := range logc.Level {
+			logx.MustSetup(logx.LogConf{
+				Mode:     logc.Mode,
+				Path:     logc.Path,
+				Level:    v,
+				KeepDays: logc.KeepDays,
+			})
+			logx.Info(v, "--日志记录")
+		}
+	}
 	//基本配置
 	conf.MustLoad(*configFile, &C)
 	//数据库配置

+ 119 - 0
jyBXBase/rpc/type/bxbase/bxbase.pb.go

@@ -1,12 +1,17 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 <<<<<<< HEAD
+<<<<<<< HEAD
 // 	protoc-gen-go v1.28.0
 // 	protoc        v3.15.1
 =======
 // 	protoc-gen-go v1.27.1
 // 	protoc        v3.19.4
 >>>>>>> master
+=======
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.19.4
+>>>>>>> feature/v1.1.5
 // source: bxbase.proto
 
 package bxbase
@@ -2830,6 +2835,9 @@ var file_bxbase_proto_rawDesc = []byte{
 	0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72,
 	0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65,
 <<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> feature/v1.1.5
 	0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
 	0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49,
 	0x64, 0x22, 0x71, 0x0a, 0x11, 0x4e, 0x65, 0x77, 0x73, 0x65, 0x74, 0x42, 0x69, 0x64, 0x64, 0x69,
@@ -2888,6 +2896,7 @@ var file_bxbase_proto_rawDesc = []byte{
 	0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07,
 	0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65,
 	0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20,
+<<<<<<< HEAD
 	0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xf9, 0x04, 0x0a, 0x06, 0x62, 0x78,
 	0x62, 0x61, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x6c, 0x61, 0x62, 0x65, 0x6c,
 	0x12, 0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x41, 0x64, 0x64, 0x6c, 0x61, 0x62, 0x65,
@@ -3097,6 +3106,116 @@ var file_bxbase_proto_rawDesc = []byte{
 	0x5a, 0x08, 0x2e, 0x2f, 0x62, 0x78, 0x62, 0x61, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
 	0x6f, 0x33,
 >>>>>>> master
+=======
+	0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x20, 0x0a, 0x08, 0x41, 0x70, 0x70,
+	0x49, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x22, 0xd0, 0x07, 0x0a, 0x0c,
+	0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04,
+	0x79, 0x65, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x79, 0x65, 0x61, 0x72,
+	0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x03, 0x64, 0x61, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, 0x64, 0x18,
+	0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x03, 0x62, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x69,
+	0x64, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x69, 0x64,
+	0x55, 0x6e, 0x69, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x69, 0x64, 0x55, 0x6e, 0x69, 0x74, 0x41,
+	0x70, 0x70, 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x69, 0x64,
+	0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72,
+	0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x70, 0x72, 0x6f,
+	0x6a, 0x65, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55,
+	0x6e, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+	0x63, 0x74, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+	0x74, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70,
+	0x70, 0x65, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28,
+	0x02, 0x52, 0x03, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x69,
+	0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x69, 0x74,
+	0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e,
+	0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x69, 0x74,
+	0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18,
+	0x0d, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x62, 0x75, 0x79, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09,
+	0x62, 0x75, 0x79, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x09, 0x62, 0x75, 0x79, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x62, 0x75,
+	0x79, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x18, 0x0f, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x75, 0x79, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70,
+	0x70, 0x65, 0x6e, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x69, 0x64, 0x44, 0x61, 0x79, 0x55, 0x70,
+	0x64, 0x61, 0x74, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x62, 0x69, 0x64, 0x44,
+	0x61, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x62, 0x69, 0x64, 0x44,
+	0x61, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x11, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x10, 0x62, 0x69, 0x64, 0x44, 0x61, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
+	0x55, 0x6e, 0x69, 0x74, 0x12, 0x36, 0x0a, 0x16, 0x62, 0x69, 0x64, 0x44, 0x61, 0x79, 0x55, 0x70,
+	0x64, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x18, 0x12,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x62, 0x69, 0x64, 0x44, 0x61, 0x79, 0x55, 0x70, 0x64, 0x61,
+	0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x08,
+	0x62, 0x69, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08,
+	0x62, 0x69, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x69, 0x64, 0x46,
+	0x69, 0x65, 0x6c, 0x64, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
+	0x62, 0x69, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x2e, 0x0a, 0x12,
+	0x62, 0x69, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65,
+	0x6e, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x62, 0x69, 0x64, 0x46, 0x69, 0x65,
+	0x6c, 0x64, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x24, 0x0a, 0x0d,
+	0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x63, 0x63, 0x75, 0x72, 0x61, 0x63, 0x79, 0x18, 0x16, 0x20,
+	0x01, 0x28, 0x02, 0x52, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x63, 0x63, 0x75, 0x72, 0x61,
+	0x63, 0x79, 0x12, 0x2c, 0x0a, 0x11, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x63, 0x63, 0x75, 0x72,
+	0x61, 0x63, 0x79, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x66,
+	0x69, 0x65, 0x6c, 0x64, 0x41, 0x63, 0x63, 0x75, 0x72, 0x61, 0x63, 0x79, 0x55, 0x6e, 0x69, 0x74,
+	0x12, 0x38, 0x0a, 0x17, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x63, 0x63, 0x75, 0x72, 0x61, 0x63,
+	0x79, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x17, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x41, 0x63, 0x63, 0x75, 0x72, 0x61, 0x63, 0x79,
+	0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x75,
+	0x73, 0x68, 0x18, 0x19, 0x20, 0x01, 0x28, 0x02, 0x52, 0x04, 0x70, 0x75, 0x73, 0x68, 0x12, 0x1a,
+	0x0a, 0x08, 0x70, 0x75, 0x73, 0x68, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x08, 0x70, 0x75, 0x73, 0x68, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x75,
+	0x73, 0x68, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x18, 0x1b, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x0e, 0x70, 0x75, 0x73, 0x68, 0x55, 0x6e, 0x69, 0x74, 0x41, 0x70, 0x70, 0x65,
+	0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18,
+	0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12,
+	0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x1d, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x32, 0xab,
+	0x05, 0x0a, 0x06, 0x62, 0x78, 0x62, 0x61, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x41, 0x64, 0x64,
+	0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x41, 0x64,
+	0x64, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x62, 0x78, 0x63, 0x6f,
+	0x6c, 0x2e, 0x41, 0x64, 0x64, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x12, 0x44, 0x0a,
+	0x0e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
+	0x18, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c,
+	0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x62, 0x78, 0x63, 0x6f,
+	0x6c, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x52, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x63, 0x74, 0x69,
+	0x6f, 0x6e, 0x12, 0x15, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c,
+	0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x62, 0x78, 0x63, 0x6f,
+	0x6c, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
+	0x12, 0x35, 0x0a, 0x08, 0x42, 0x43, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x2e, 0x62,
+	0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x42, 0x43, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
+	0x1a, 0x15, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x41, 0x63,
+	0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0c, 0x49, 0x73, 0x43, 0x6f, 0x6c,
+	0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e,
+	0x49, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a,
+	0x16, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x41, 0x63,
+	0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12,
+	0x0e, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a,
+	0x0e, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x12,
+	0x38, 0x0a, 0x0a, 0x53, 0x68, 0x6f, 0x77, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x14, 0x2e,
+	0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
+	0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x68, 0x6f, 0x77,
+	0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x09, 0x41, 0x64, 0x64,
+	0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x13, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x41,
+	0x64, 0x64, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x62, 0x78,
+	0x63, 0x6f, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x33, 0x0a,
+	0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x13, 0x2e, 0x62,
+	0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65,
+	0x71, 0x1a, 0x0f, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52,
+	0x65, 0x73, 0x12, 0x32, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12,
+	0x13, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x53, 0x65, 0x61, 0x72, 0x63,
+	0x68, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x43, 0x6f, 0x6d,
+	0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x0d, 0x4e, 0x65, 0x77, 0x65, 0x73, 0x74,
+	0x42, 0x69, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x17, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e,
+	0x4e, 0x65, 0x77, 0x65, 0x73, 0x74, 0x42, 0x69, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71,
+	0x1a, 0x18, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x4e, 0x65, 0x77, 0x73, 0x65, 0x74, 0x42,
+	0x69, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x08, 0x49, 0x6e,
+	0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x12, 0x0f, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e, 0x41,
+	0x70, 0x70, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x62, 0x78, 0x63, 0x6f, 0x6c, 0x2e,
+	0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0a, 0x5a, 0x08,
+	0x2e, 0x2f, 0x62, 0x78, 0x62, 0x61, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+>>>>>>> feature/v1.1.5
 }
 
 var (

+ 4 - 0
jyBXBase/rpc/type/bxbase/bxbase_grpc.pb.go

@@ -2,10 +2,14 @@
 // versions:
 // - protoc-gen-go-grpc v1.2.0
 <<<<<<< HEAD
+<<<<<<< HEAD
 // - protoc             v3.15.1
 =======
 // - protoc             v3.19.4
 >>>>>>> master
+=======
+// - protoc             v3.19.4
+>>>>>>> feature/v1.1.5
 // source: bxbase.proto
 
 package bxbase

+ 2 - 2
jyBXSubscribe/rpc/etc/bxsubscribe.yaml

@@ -1,11 +1,11 @@
 Name: bxsubscribe.rpc
-ListenOn: 0.0.0.0:8001
+ListenOn: 0.0.0.0:8010
 Etcd:
   Hosts:
   - 127.0.0.1:2379
   Key: bxsubscribe.rpc
 Timeout: 20000
-Webrpcport: 8011
+Webrpcport: 8013
 DefaultDay: 7
 DefaulCount:
   Pay: 1000

+ 12 - 0
jyBXSubscribe/rpc/internal/logic/getsublistlogic.go

@@ -7,6 +7,7 @@ import (
 	"jyBXSubscribe/rpc/internal/svc"
 	"jyBXSubscribe/rpc/model"
 	"jyBXSubscribe/rpc/type/bxsubscribe"
+	"time"
 )
 
 type GetSubListLogic struct {
@@ -25,6 +26,7 @@ func NewGetSubListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetSub
 
 // 获取订阅推送列表
 func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubscribe.SubscribeInfosResp, error) {
+	start := time.Now().Unix()
 	//1、推送信息已读标识
 	//超级订阅 i_apppushunread=0
 	//大会员 i_member_apppushunread=0
@@ -63,6 +65,11 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 	    	  spqp.BaseServiceMysql = IC.PushMysql
 	          }*/
 	hasNextPage, total, list := model.NewSubscribePush(in.UserType).Datas(spqp)
+<<<<<<< HEAD
+=======
+	start1 := time.Now().Unix()
+	logx.Info("1、查询数据用户", start1-start)
+>>>>>>> feature/v1.1.5
 	//hasNextPage, total, list = false, 0, []*bxsubscribe.SubscribeInfo{}
 	/*
 	 *无推送记录生成推送记录
@@ -72,8 +79,13 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 	if in.PageNum == 1 && spqp.IsEmpty() && len(list) == 0 && in.IsEnt == false {
 		hasNextPage, total, list = model.NewSubscribePush(in.UserType).DefaultDatas(spqp)
 	}
+	start2 := time.Now().Unix()
+	logx.Info("2、查询数据用户", start2-start1)
 	//查询是否收藏
 	model.NewSubscribePush(in.UserType).MakeCollection(in.UserId, list)
+	start3 := time.Now().Unix()
+	logx.Info("3、查询数据用户", start3-start2)
+	logx.Info("总共查询数据用户", start3-start)
 	return &bxsubscribe.SubscribeInfosResp{
 		Data: &bxsubscribe.SubscribeData{
 			List:        list,

+ 67 - 84
jyBXSubscribe/rpc/model/push.go

@@ -1,28 +1,27 @@
 package model
 
 import (
-	"app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/date"
-	"app.yhyue.com/moapp/jybase/encrypt"
-	"app.yhyue.com/moapp/jybase/esv1"
-	"app.yhyue.com/moapp/jybase/mongodb"
-	"app.yhyue.com/moapp/jybase/mysql"
-	"app.yhyue.com/moapp/jybase/redis"
-	"bp.jydev.jianyu360.cn/BaseService/jyCodeService/rpc/codeservice/codeservice"
 	"context"
-	"database/sql"
 	"encoding/json"
 	"fmt"
-	"github.com/zeromicro/go-zero/core/logx"
-	"go.mongodb.org/mongo-driver/bson/primitive"
 	IC "jyBXSubscribe/rpc/init"
 	ms "jyBXSubscribe/rpc/model/service"
 	"jyBXSubscribe/rpc/type/bxsubscribe"
 	"log"
 	"strconv"
 	"strings"
-	"sync"
 	"time"
+
+	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/esv1"
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jybase/mysql"
+	"app.yhyue.com/moapp/jybase/redis"
+	"bp.jydev.jianyu360.cn/BaseService/jyCodeService/rpc/codeservice/codeservice"
+	"github.com/zeromicro/go-zero/core/logx"
+	"go.mongodb.org/mongo-driver/bson/primitive"
 )
 
 const (
@@ -241,7 +240,7 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 			logx.Info(spqp.UserId, "GetTodayCache Error", err)
 		}
 		if err != nil || subPush == nil || subPush.Date != nowFormat || len(subPush.Datas) == 0 {
-			list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, false)
+			list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, true)
 			subPush = &SubPush{
 				Date:  nowFormat,
 				Datas: list,
@@ -462,9 +461,10 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 		}
 		searchSql = fmt.Sprintf(" from %s  a LEFT JOIN %s b ON a.infoid = b.infoid LEFT JOIN %s t on t.infoid = b.infoid and t.labelcode=2  where %s"+
 			" order by a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, BidTags, strings.Join(querys, " and "))
-		fmt.Println("searchSql", searchSql)
+		logx.Info("searchSql", searchSql)
 		//查询总数
-		count = spqp.BaseServiceMysql.CountBySql(fmt.Sprintf("select count(a.id)" + searchSql))
+		logx.Info(fmt.Sprintf("select count(a.id) " + searchSql))
+		count = spqp.BaseServiceMysql.CountBySql(fmt.Sprintf("select count(a.id) " + searchSql))
 		logx.Info("count:", count, "---", s.ModuleFlag)
 		findSql = "select a.id,a.date,a.infoid,a.isvisit,a.matchkeys,a.type,b.isvalidfile as attachment_count"
 	}
@@ -475,9 +475,11 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 	if isLimit {
 		findSql += fmt.Sprintf(" limit %d,%d", (spqp.PageNum-1)*size, size)
 	}
+	logx.Info("findSql", findSql)
 	logx.Info(spqp.NewUserId, "subscribePush query sql:", findSql)
 	list := spqp.BaseServiceMysql.SelectBySql(findSql)
 	if list != nil && len(*list) > 0 {
+		logx.Info("数据库数据", list)
 		pushCas := s.GetJyPushs(*list)
 		if !spqp.Export {
 			result = s.GetInfoByIds(spqp.Mgo_bidding, spqp.Bidding, spqp.Bidding_back, pushCas)
@@ -487,6 +489,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 	} else {
 		result = []*bxsubscribe.SubscribeInfo{}
 	}
+	logx.Info("result", result)
 	return
 }
 
@@ -777,7 +780,7 @@ const (
 	INDEX      = "bidding"
 	TYPE       = "bidding"
 	bidField   = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","buyerclass","budget","bidamount","filetext","spidercode","site"`
-	bidTime    = `{"":{"publishtime":{"gt":%d}}}`
+	bidTime    = `{"range":{"publishtime":{"gt":%d}}}`
 	bidSort    = `{"publishtime":"desc"}`
 	findfields = `"title"`
 )
@@ -803,16 +806,10 @@ func (s *subscribePush) DefaultDatas(spqp *SubPushQueryParam) (hasNextPage bool,
 		//logx.Info(time.Since(t1), "count:", len(*list))
 		if list != nil && len(*list) > 0 {
 			total = int64(len(*list))
-			//超过50条先处理50条 返回前50条
-			listOne := *list
-			if len(*list) > pageSize {
-				listOne = (*list)[:pageSize]
-			}
-			result = s.listManager(spqp, listOne, bsp.Keyword, (len(listOne)+pageSize)/pageSize)
-			if len(*list) > pageSize {
+			result = s.listManager(spqp, *list, bsp.Keyword)
+			if len(result) > pageSize {
+				result = result[:pageSize]
 				hasNextPage = true
-				listOther := (*list)[pageSize:]
-				go s.listManager(spqp, listOther, bsp.Keyword, (len(listOther)+pageSize)/pageSize)
 			}
 		}
 	}
@@ -821,65 +818,53 @@ func (s *subscribePush) DefaultDatas(spqp *SubPushQueryParam) (hasNextPage bool,
 }
 
 // 保存推送表
-func (s *subscribePush) listManager(spqp *SubPushQueryParam, list []map[string]interface{}, keyword []ViewKeyWord, ccount int) (resultList []*bxsubscribe.SubscribeInfo) {
+func (s *subscribePush) listManager(spqp *SubPushQueryParam, list []map[string]interface{}, keyword []ViewKeyWord) (resultList []*bxsubscribe.SubscribeInfo) {
 	t2 := time.Now()
 	now := time.Now().Unix()
-	var (
-		wg = &sync.WaitGroup{}
-		wc = make(chan bool, ccount)
-	)
-	for _, v := range list {
-		wg.Add(1)
-		wc <- true
-		go func(v map[string]interface{}) {
-			defer func() {
-				wg.Done()
-				<-wc
-			}()
-			redisKey := fmt.Sprintf("pushinfo_%s_%s", spqp.UserId, common.ObjToString(v["_id"]))
-			title := strings.Replace(common.ObjToString(v["title"]), "\n", "", -1)
-			var pushInsert = []interface{}{}
-			infoid := common.InterfaceToStr(v["_id"])
-			log.Println("infoid", infoid)
-			spqp.BaseServiceMysql.ExecTx("推送记录保存", func(tx *sql.Tx) bool {
-				//推送记录
-				matchkeys := getKeys(title, keyword)
-				matchkey := strings.Join(matchkeys, " ")
-				entid := spqp.EntId
-				entUserId := spqp.EntUserId
-				deptid := spqp.DeptId
-				id := int64(0)
-				switch s.ModuleFlag {
-				case "eType":
-					pushInsert = append(pushInsert, entid, deptid, entUserId, common.InterfaceToStr(infoid), matchkey, now)
-					id, _ = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, ennicheInsertCollKey, pushInsert)
-				case "mType":
-					pushInsert = append(pushInsert, common.InterfaceToStr(spqp.NewUserId), common.InterfaceToStr(infoid), matchkey, now)
-					id, _ = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, memberInsertCollKey, pushInsert)
-				case "vType":
-					pushInsert = append(pushInsert, common.InterfaceToStr(spqp.NewUserId), common.InterfaceToStr(infoid), matchkey, now, 1)
-					id, _ = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, subscribeInsertCollKey, pushInsert)
-				case "fType":
-					pushInsert = append(pushInsert, common.InterfaceToStr(spqp.NewUserId), common.InterfaceToStr(infoid), matchkey, now, 0)
-					id, _ = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, subscribeInsertCollKey, pushInsert)
-
-				}
-				if id > 0 {
-					redis.Put("pushcache_2_a", redisKey, 1, 86400)
-					resultList = append(resultList, s.InfoFormat(&PushCa{
-						InfoId:     infoid,
-						Date:       time.Now().Unix(),
-						Index:      id,
-						Keys:       matchkeys,
-						FileExists: v["filetext"] != nil,
-					}, &v))
-					return true
-				}
-				return false
-			})
-		}(v)
+	length := len(list)
+	resultList = make([]*bxsubscribe.SubscribeInfo, length)
+	pushInsert := []interface{}{}
+	for i := length - 1; i >= 0; i-- {
+		v := list[i]
+		title := strings.Replace(common.ObjToString(v["title"]), "\n", "", -1)
+		infoid := common.InterfaceToStr(v["_id"])
+		matchkeys := getKeys(title, keyword)
+		matchkey := strings.Join(matchkeys, " ")
+		redisKey := fmt.Sprintf("pushinfo_%s_%s", spqp.UserId, common.ObjToString(v["_id"]))
+		entid := spqp.EntId
+		entUserId := spqp.EntUserId
+		deptid := spqp.DeptId
+		switch s.ModuleFlag {
+		case "eType":
+			pushInsert = append(pushInsert, entid, deptid, entUserId, common.InterfaceToStr(infoid), matchkey, now)
+		case "mType":
+			pushInsert = append(pushInsert, common.InterfaceToStr(spqp.NewUserId), common.InterfaceToStr(infoid), matchkey, now)
+		case "vType":
+			pushInsert = append(pushInsert, common.InterfaceToStr(spqp.NewUserId), common.InterfaceToStr(infoid), matchkey, now, 1)
+		case "fType":
+			pushInsert = append(pushInsert, common.InterfaceToStr(spqp.NewUserId), common.InterfaceToStr(infoid), matchkey, now, 0)
+		}
+		redis.Put("pushcache_2_a", redisKey, 1, 86400)
+		resultList[i] = s.InfoFormat(&PushCa{
+			InfoId:     infoid,
+			Date:       time.Now().Unix(),
+			Keys:       matchkeys,
+			FileExists: v["filetext"] != nil,
+		}, &v)
+	}
+	id := int64(0)
+	switch s.ModuleFlag {
+	case "eType":
+		_, id = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, ennicheInsertCollKey, pushInsert)
+	case "mType":
+		_, id = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, memberInsertCollKey, pushInsert)
+	default:
+		_, id = spqp.BaseServiceMysql.InsertIgnoreBatch(aboutDbMsg[s.ModuleFlag].MysqlTable, subscribeInsertCollKey, pushInsert)
+	}
+	for i := length - 1; i >= 0; i-- {
+		resultList[i].CaIndex = id
+		id++
 	}
-	wg.Wait()
 	log.Println("数据处理耗时:", time.Since(t2))
 	return
 }
@@ -915,7 +900,7 @@ func (s *subscribePush) getDefaultDatasSQL(bsp *ViewCondition) (str string) {
 
 	bools := []string{}
 	musts := []string{}
-	//发布时间最新7天
+	//发布时间最新7天(正式环境需要修改)
 	musts = append(musts, fmt.Sprintf(bidTime, time.Now().AddDate(0, 0, -7).Unix()))
 	//省份
 	areaCity := []string{}
@@ -1126,8 +1111,6 @@ func (s *subscribePush) getUserInfo(spqp *SubPushQueryParam) (vc *ViewCondition)
 		vc.Keyword = getKeyWordArrFromDbResultByFree(tmpInfo.Items, "", -1)
 		//vc.Keyword = getKeyWordArrFromDbResult(tmpInfo.Items, "", -1)
 	}
-	vc.Size = 10
-
 	return
 }