فهرست منبع

Merge branch 'master' into feature/v1.1.31

lianbingjie 1 سال پیش
والد
کامیت
41bdbb4924

+ 6 - 0
jyBXBase/rpc/etc/bxbase.yaml

@@ -18,12 +18,18 @@ NewsCache: # 下面timeout 单位是秒
   NoLogin: # 未登录用户缓存使用的key
     Key: p1_indexMessage_new_noLogin_%d_%d_%d
     Timeout: 86400  #
+    CacheUpdateKey: noLogin
+    CacheUpdateTimeout: 900  #
   LoginUser: # 登录用户有推送数据缓存使用的key
     Key: p1_indexMessage_new_%d_%d_%d_%d
     Timeout: 86400
+    CacheUpdateKey: subscribe
+    CacheUpdateTimeout: 900  #
   Login: # 登录用户没有推送数据最新标讯缓存使用的key
     Key: p1_indexMessage_new_login_%d_%d_%d
     Timeout: 86400
+    CacheUpdateKey: login
+    CacheUpdateTimeout: 900  #
   Count: # 用户有没有推送数据缓存使用的key
     Key: push_count_%s_%s
     Timeout: 7200

+ 9 - 7
jyBXBase/rpc/internal/config/config.go

@@ -18,15 +18,17 @@ type Config struct {
 	NewsLimitNum          int64    // 移动端首页最新标讯数量限制
 	NewsTimeOut           int64    //更新数据时间
 	NewsCache             struct { // 最新标讯缓存配置
-		NoLogin   cacheConfig // 未登录用户缓存key
-		LoginUser cacheConfig // 登录用户有推送数据使用的key
-		Login     cacheConfig // 登录用户没有推送数据最新标讯使用的key
-		Count     cacheConfig // 查询用户有没有推送数据使用的key
+		NoLogin   CacheConfig // 未登录用户缓存key
+		LoginUser CacheConfig // 登录用户有推送数据使用的key
+		Login     CacheConfig // 登录用户没有推送数据最新标讯使用的key
+		Count     CacheConfig // 查询用户有没有推送数据使用的key
 	}
 }
-type cacheConfig struct {
-	Key     string // 缓存key
-	Timeout int    // 缓存时间
+type CacheConfig struct {
+	Key                string `json:"Key,optional"`                // 缓存key
+	Timeout            int    `json:"Timeout,optional"`            // 缓存时间
+	CacheUpdateKey     string `json:"CacheUpdateKey,optional"`     //
+	CacheUpdateTimeout int    `json:"CacheUpdateTimeout,optional"` //
 
 }
 type Db struct {

+ 17 - 61
jyBXBase/rpc/internal/logic/newestbiddinglogic.go

@@ -1,12 +1,9 @@
 package logic
 
 import (
-	"app.yhyue.com/moapp/jybase/redis"
 	"context"
-	IC "jyBXBase/rpc/init"
 	"jyBXBase/rpc/model"
 	"log"
-	"sort"
 	"time"
 
 	"jyBXBase/rpc/internal/svc"
@@ -29,18 +26,11 @@ func NewNewestBiddingLogic(ctx context.Context, svcCtx *svc.ServiceContext) *New
 	}
 }
 
-type newSet struct {
-	status      int
-	redisKey    string
-	redisStatus int
-	query       string
-}
-
 // 首页最新招标信息
 func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase.NewsetBiddingResp, error) {
 	t := time.Now()
 	//  status : 0 -不存缓存 1-未登录用户 2-用户自己的key 3-登录用户最新标讯
-	r, n := func(in *bxbase.NewestBiddingReq) (*bxbase.NewsetBiddingResp, *newSet) {
+	r, n := func(in *bxbase.NewestBiddingReq) (*bxbase.NewsetBiddingResp, *model.NewSet) {
 		var res = &bxbase.NewsetBiddingResp{
 			Data: &bxbase.NewsetBidding{
 				List: []*bxbase.NewestList{},
@@ -57,35 +47,35 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 			subtype := `"预告","公告","结果","其它"`
 			query := model.NewestQuery("", "", subtype)
 			res.Data.ShowTip = 1
-			redisKey, _ := model.GetRedisKeyTimeout(model.StatusNoLogin, in.PositionId)
-			list, err := model.GetNewsCache(redisKey)
+			redisKeyModel := model.GetRedisKeyTimeout(model.StatusNoLogin, in.PositionId)
+			list, err := model.GetNewsCache(redisKeyModel)
 			if err == nil && list != nil && len(list) > 0 { // 缓存有数据可以直接返回
 				res.Data.List = list
 				res.Data.Count = int64(len(list))
-				return res, &newSet{model.StatusCache, redisKey, model.StatusNoLogin, query}
+				return res, &model.NewSet{Status: model.StatusCache, RedisKeyModel: redisKeyModel, RedisStatus: model.StatusNoLogin, Query: query}
 			}
 			noLoginTime := time.Now()
 			list = model.NewestES(query)
 			res.Data.List = list
 			res.Data.Count = int64(len(list))
 			log.Println("未登录获es取数据耗时:", time.Since(noLoginTime).Seconds())
-			return res, &newSet{model.StatusNoLogin, redisKey, model.StatusNoLogin, query}
+			return res, &model.NewSet{Status: model.StatusNoLogin, RedisKeyModel: redisKeyModel, RedisStatus: model.StatusNoLogin, Query: query}
 		}
-
 		// 登录用户
 		roleNewestInfo, flag := model.GetRoleNewestInfoService(in.AppId, in.MgoUserId, in.NewUserId, in.AccountId, in.EntId, in.EntUserId, in.PositionType, in.PositionId)
+		roleNewestInfo.IsEnt = in.PositionType > 0 //是否是企业
 		res.Data.SubFlag = flag
 		// 查count判断
 		existData := roleNewestInfo.GetPushHistoryCount()
 		if existData > 0 { // 存在推送 查推送缓存  缓存没有数据则查 推送数据
 			res.Data.ShowTip = 1 // count>0说明存在数据不用显示引导用户设置关键词
 			// 查缓存
-			redisKey, _ := model.GetRedisKeyTimeout(model.StatusLoginUser, in.PositionId)
-			list, err := model.GetNewsCache(redisKey)
+			redisKeyModel := model.GetRedisKeyTimeout(model.StatusLoginUser, in.PositionId)
+			list, err := model.GetNewsCache(redisKeyModel)
 			if err == nil && list != nil && len(list) > 0 {
 				res.Data.List = list
 				res.Data.Count = int64(len(list))
-				return res, &newSet{model.StatusCache, redisKey, model.StatusLoginUser, ""}
+				return res, &model.NewSet{Status: model.StatusCache, RedisKeyModel: redisKeyModel, RedisStatus: model.StatusLoginUser}
 			}
 			//  查推送
 			subscribeTime := time.Now()
@@ -94,7 +84,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 			if list != nil && len(list) > 0 {
 				res.Data.List = list
 				res.Data.Count = int64(len(list))
-				return res, &newSet{model.StatusLoginUser, redisKey, model.StatusLoginUser, ""}
+				return res, &model.NewSet{Status: model.StatusLoginUser, RedisKeyModel: redisKeyModel, RedisStatus: model.StatusLoginUser}
 			}
 		}
 		// 等0则说明推送里面没有数据 所以去查最新标讯信息缓存 返回  缓存没有则查最新标讯信息 存到缓存里面
@@ -102,62 +92,28 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 		//  查最新标讯
 		query := model.NewestQuery("", "", "")
 		// 查缓存
-		redisKey, _ := model.GetRedisKeyTimeout(model.StatusLogin, in.PositionId)
-		list, err := model.GetNewsCache(redisKey)
+		redisKeyModel := model.GetRedisKeyTimeout(model.StatusLogin, in.PositionId)
+		list, err := model.GetNewsCache(redisKeyModel)
 		if err == nil && list != nil && len(list) > 0 {
 			res.Data.List = list
 			res.Data.Count = int64(len(list))
-			return res, &newSet{model.StatusCache, redisKey, model.StatusLogin, query}
+			return res, &model.NewSet{Status: model.StatusCache, RedisKeyModel: redisKeyModel, RedisStatus: model.StatusLogin, Query: query}
 		}
 		esTime := time.Now()
 		list = model.NewestES(query)
 		log.Println(in.PositionId, "---获取es数据耗时:", time.Since(esTime).Seconds())
 		res.Data.List = list
 		res.Data.Count = int64(len(list))
-		return res, &newSet{model.StatusLogin, redisKey, model.StatusLogin, query}
+		return res, &model.NewSet{Status: model.StatusLogin, RedisKeyModel: redisKeyModel, RedisStatus: model.StatusLogin, Query: query}
 	}(in)
 	if r.Data.Count == 0 {
 		return r, nil
 	}
-	// status : 0 -拿到的是缓存 不用再处理也不用存缓存 1-存到未登录用户 2-存到用户自己的key 3-存到登录用户最新标讯
-	var sortRedis = func(r *bxbase.NewsetBiddingResp, status int, positionId int64) {
-		//排序
-		sort.Slice(r.Data.List, func(i, j int) bool {
-			return r.Data.List[i].PublishTime > r.Data.List[j].PublishTime
-		})
-		redisKey, timeout := model.GetRedisKeyTimeout(status, positionId)
-		go model.PutNewsCache(redisKey, timeout, r.Data.List)
-	}
-	if n.status != model.StatusCache {
-		go sortRedis(r, n.status, in.PositionId)
+	if n.Status != model.StatusCache {
+		model.DataSortInRedis(r, n.Status, in.PositionId)
 	} else {
-		//获取最新数据 --  延长缓存时间
-		go func(n *newSet, in *bxbase.NewestBiddingReq) {
-			if n.redisKey != "" {
-				//剩余时间 在 IC.C.NewsTimeOut 之内
-				ttl := redis.GetTTL("new", n.redisKey)
-				log.Println(in.PositionId, "---缓存剩余时间:", ttl)
-				if ttl-IC.C.NewsTimeOut < 0 {
-					var res = &bxbase.NewsetBiddingResp{
-						Data: &bxbase.NewsetBidding{
-							List: []*bxbase.NewestList{},
-						},
-					}
-					switch n.redisStatus {
-					case model.StatusLoginUser:
-						// 登录用户
-						roleNewestInfo, _ := model.GetRoleNewestInfoService(in.AppId, in.MgoUserId, in.NewUserId, in.AccountId, in.EntId, in.EntUserId, in.PositionType, in.PositionId)
-						//  查推送
-						res.Data.List = roleNewestInfo.GetPushHistory()
-					default:
-						res.Data.List = model.NewestES(n.query)
-					}
-					go sortRedis(res, n.redisStatus, in.PositionId)
-				}
-			}
-		}(n, in)
+		go model.ExtendNewListCache(n, in, r.Data.List)
 	}
-
 	model.MakeCollection(in.UserId, r.Data.List)
 	log.Println(in.PositionId, "--接口耗时:", time.Since(t).Seconds())
 	return r, nil

+ 106 - 13
jyBXBase/rpc/model/newestBidding.go

@@ -6,7 +6,9 @@ import (
 	"fmt"
 	"jyBXBase/rpc/bxbase"
 	IC "jyBXBase/rpc/init"
+	"jyBXBase/rpc/internal/config"
 	"log"
+	"sort"
 	"strings"
 	"time"
 
@@ -31,10 +33,10 @@ const (
 	query_city_hkeys    = `{"query":{"bool":{"must":[%s],"should":[%s],"minimum_should_match":%d}},"highlight": {"pre_tags": ["<a>"],"post_tags": ["</a>"],"fields": {"title": {"fragment_size": 0,"number_of_fragments": 1}}},"_source":[` + search_field + `],"sort":[{"publishtime":"desc"},{"budget":"desc"}],"from":0,"size":%d}`
 	Pushbidding         = "global_common_data.dws_f_bid_baseinfo"
 	Province            = "province"
-	StatusNoLogin       = 1 // 1-未登录用户
-	StatusLoginUser     = 2 // 2-用户自己的key
-	StatusLogin         = 3 // 3-登录用户最新标讯
-	StatusCache         = 0 //   0 -不存缓存 本来查的就是缓存的数据
+	StatusCache         = iota //   0 -不存缓存 本来查的就是缓存的数据
+	StatusNoLogin              // 1-未登录用户
+	StatusLoginUser            // 2-用户自己的key
+	StatusLogin                // 3-登录用户最新标讯
 )
 
 type NewestInfo struct {
@@ -44,6 +46,7 @@ type NewestInfo struct {
 	NewUserId    int64
 	PushMysql    *mysql.Mysql
 	NewsLimitNum int64 // 最新标讯数量条数限制
+	IsEnt        bool
 }
 
 var mysqlTables = map[string]string{
@@ -97,15 +100,22 @@ func (n *NewestInfo) GetPushHistoryCount() int64 {
 	timeOut := IC.C.NewsCache.Count.Timeout
 	c := n.MysqlDb.CountBySql(countSql)
 	if c > 0 {
-		timeOut = timeOut * 4
+		timeOut = timeOut * 7
 	} else {
 		c = -1
 	}
-	redis.Put("new", countKey, c, IC.C.NewsCache.Count.Timeout) //过期时间走配置,比最新标讯列表缓存时间 要短1/10 尽量不超过两分钟
+	redis.Put("new", countKey, c, timeOut) //过期时间走配置,比最新标讯列表缓存时间 要短1/10 尽量不超过两分钟
 	return c
 }
 
+// 判断当前用户是否有最新推送信息
+func (n *NewestInfo) IsHasNewPushData(time int64) bool {
+	return n.MysqlDb.CountBySql(fmt.Sprintf("SELECT COUNT(1) FROM (SELECT 1 FROM %s WHERE userid = %d AND date > %d LIMIT 1) AS ph", n.TableName, n.NewUserId, time)) > 0
+}
+
+// GetPushHistory
 func (n *NewestInfo) GetPushHistory() (res []*bxbase.NewestList) {
+	//
 	findSQL := "select a.infoid,REPLACE(a.matchkeys,'+',' ') as matchkeys,a.attachment_count,a.budget,a.bidamount from %s  a  where a.userid=%d   order by a.id desc limit ?"
 	findSQL = fmt.Sprintf(findSQL, n.TableName, n.NewUserId)
 	logx.Info(n.TableName, "-------", n.NewUserId, ",findSQL:", findSQL)
@@ -264,22 +274,37 @@ func NewestES(doSearchStr string) (res []*bxbase.NewestList) {
 }
 
 // GetRedisKeyTimeout 获取缓存的key 和超时时间
-func GetRedisKeyTimeout(status int, positionId int64) (redisKey string, timeout int) {
+func GetRedisKeyTimeout(status int, positionId int64) config.CacheConfig {
+	var (
+		redisKey, cuKey    string
+		timeOut, cuTimeOut int
+	)
 	switch status {
 	case StatusNoLogin:
 		redisKey = IC.C.NewsCache.NoLogin.Key
 		redisKey = fmt.Sprintf(redisKey, time.Now().Year(), time.Now().Month(), time.Now().Day())
-		timeout = IC.C.NewsCache.NoLogin.Timeout
+		timeOut = IC.C.NewsCache.NoLogin.Timeout
+		cuKey = fmt.Sprintf("%s_%s", redisKey, IC.C.NewsCache.NoLogin.CacheUpdateKey)
+		cuTimeOut = IC.C.NewsCache.NoLogin.CacheUpdateTimeout
 	case StatusLoginUser:
 		redisKey = IC.C.NewsCache.LoginUser.Key // 登录用户使用的缓存key
 		redisKey = fmt.Sprintf(redisKey, positionId, time.Now().Year(), time.Now().Month(), time.Now().Day())
-		timeout = IC.C.NewsCache.LoginUser.Timeout
+		timeOut = IC.C.NewsCache.LoginUser.Timeout
+		cuKey = fmt.Sprintf("%s_%s", redisKey, IC.C.NewsCache.LoginUser.CacheUpdateKey)
+		cuTimeOut = IC.C.NewsCache.LoginUser.CacheUpdateTimeout
 	case StatusLogin:
 		redisKey = IC.C.NewsCache.Login.Key // 登录用户使用的最新标讯缓存key
 		redisKey = fmt.Sprintf(redisKey, time.Now().Year(), time.Now().Month(), time.Now().Day())
-		timeout = IC.C.NewsCache.Login.Timeout
+		timeOut = IC.C.NewsCache.Login.Timeout
+		cuKey = fmt.Sprintf("%s_%s", redisKey, IC.C.NewsCache.Login.CacheUpdateKey)
+		cuTimeOut = IC.C.NewsCache.Login.CacheUpdateTimeout
+	}
+	return config.CacheConfig{
+		Key:                redisKey,
+		Timeout:            timeOut,
+		CacheUpdateKey:     cuKey,
+		CacheUpdateTimeout: cuTimeOut,
 	}
-	return
 }
 
 // PutNewsCache 存缓存
@@ -296,8 +321,8 @@ func PutNewsCache(redisKey string, redisTimeout int, list []*bxbase.NewestList)
 }
 
 // GetNewsCache 取缓存
-func GetNewsCache(redisKey string) (list []*bxbase.NewestList, err error) {
-	redisByte, err := redis.GetBytes("new", redisKey)
+func GetNewsCache(cc config.CacheConfig) (list []*bxbase.NewestList, err error) {
+	redisByte, err := redis.GetBytes("new", cc.Key)
 	if err != nil || redisByte == nil || len(*redisByte) == 0 {
 		return list, err
 	}
@@ -308,3 +333,71 @@ func GetNewsCache(redisKey string) (list []*bxbase.NewestList, err error) {
 	}
 	return list, nil
 }
+
+type NewSet struct {
+	Status        int
+	RedisKeyModel config.CacheConfig
+	RedisStatus   int
+	Query         string
+}
+
+// 排序 入缓存
+// status : 0 -拿到的是缓存 不用再处理也不用存缓存 1-存到未登录用户 2-存到用户自己的key 3-存到登录用户最新标讯
+func DataSortInRedis(r *bxbase.NewsetBiddingResp, status int, positionId int64) {
+	//排序
+	sort.Slice(r.Data.List, func(i, j int) bool {
+		return r.Data.List[i].PublishTime > r.Data.List[j].PublishTime
+	})
+	redisKeyModel := GetRedisKeyTimeout(status, positionId)
+	go PutNewsCache(redisKeyModel.Key, redisKeyModel.Timeout, r.Data.List)
+}
+
+// 延长缓存
+// 获取最新数据 --  延长缓存时间7天---待调整: 1、判断是否需要更新;2、判断订阅信息是否存在,如果存在是否是最新推送,3、订阅信息查推送缓存(只有个人版有缓存:pushcache_2_a )
+func ExtendNewListCache(n *NewSet, in *bxbase.NewestBiddingReq, list []*bxbase.NewestList) {
+	if n.RedisKeyModel.Key != "" {
+		now := time.Now()
+		if n.RedisKeyModel.CacheUpdateKey != "" {
+			var (
+				res = &bxbase.NewsetBiddingResp{
+					Data: &bxbase.NewsetBidding{
+						List: []*bxbase.NewestList{},
+					},
+				}
+				updateTime = redis.GetInt("new", n.RedisKeyModel.CacheUpdateKey)
+			)
+			switch n.RedisStatus {
+			case StatusLoginUser:
+				//十五分钟内 更新过一次 不再更新
+				if int(now.Unix())-updateTime > n.RedisKeyModel.CacheUpdateTimeout {
+					// 登录用户
+					roleNewestInfo, _ := GetRoleNewestInfoService(in.AppId, in.MgoUserId, in.NewUserId, in.AccountId, in.EntId, in.EntUserId, in.PositionType, in.PositionId)
+					//当前用户有最新推送信息
+					lastPublishTime := list[len(list)-1].PublishTime
+					if roleNewestInfo.IsHasNewPushData(lastPublishTime) {
+						//  查推送
+						subscribeTime := time.Now()
+						res.Data.List = roleNewestInfo.GetPushHistory()
+						log.Println(in.PositionId, "获取订阅数据 存缓存 耗时:", time.Since(subscribeTime).Seconds())
+					} else {
+						res.Data.List = list
+					}
+				}
+			default:
+				//十五分钟内 更新过一次 不再更新
+				if int(now.Unix())-updateTime > n.RedisKeyModel.CacheUpdateTimeout {
+					res.Data.List = NewestES(n.Query)
+				}
+			}
+			if len(res.Data.List) > 0 {
+				//更新update time
+				redis.Put("new", n.RedisKeyModel.CacheUpdateKey, now.Unix(), n.RedisKeyModel.CacheUpdateTimeout)
+				go DataSortInRedis(res, n.RedisStatus, in.PositionId)
+			}
+		}
+		////剩余时间 在 IC.C.NewsTimeOut 之内
+		//if ttl := redis.GetTTL("new", n.RedisKeyModel.Key); ttl-IC.C.NewsTimeOut < 0 {
+		//
+		//}
+	}
+}

+ 14 - 0
jyBXCore/api/bxcore.api

@@ -165,6 +165,18 @@ type (
 		StartTime    int64    `json:"startTime,optional"`
 		EndTime      int64    `json:"endTime,optional"`
 	}
+	polymerizeSearchReq {
+		SearchCode   string `json:"searchCode"`
+		EntId        int64  `header:"entId,optional"`        // 企业id
+		PositionType int64  `header:"positionType,optional"` // 职位类型 0个人 1企业
+		PositionId   int64  `header:"positionId,optional"`   //职位id
+		AccountId    int64  `header:"accountId,optional"`    //账户id
+		AppId        string `header:"appId,optional"`        //剑鱼10000
+		UserId       string `header:"userId,optional"`       //用户id
+		NewUserId    int64  `header:"newUserId,optional"`    //base_user_id
+		EntAccountId int64  `header:"entAccountId,optional"` //企业账户id
+		EntUserId    int64  `header:"newUserId,optional"`
+	}
 )
 service bxcore-api {
 	@handler searchList
@@ -193,5 +205,7 @@ service bxcore-api {
 	post /jybx/core/statistics/pushStatistics(ptatisticsListReq) returns (commonResp)
 	@handler projectStatistics//参标项目统计
 	post /jybx/core/statistics/projectStatistics(ptatisticsListReq) returns (commonResp)
+	@handler polymerizeSearch//参标项目统计
+	post /jybx/core/polymerizeSearch(polymerizeSearchReq) returns (commonResp)
 	
 }

+ 28 - 0
jyBXCore/api/internal/handler/polymerizeSearchHandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+	"jyBXCore/api/internal/logic"
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+)
+
+func polymerizeSearchHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.PolymerizeSearchReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := logic.NewPolymerizeSearchLogic(r.Context(), svcCtx)
+		resp, err := l.PolymerizeSearch(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 5 - 0
jyBXCore/api/internal/handler/routes.go

@@ -77,6 +77,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/jybx/core/statistics/projectStatistics",
 				Handler: projectStatisticsHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/jybx/core/polymerizeSearch",
+				Handler: polymerizeSearchHandler(serverCtx),
+			},
 		},
 	)
 }

+ 47 - 0
jyBXCore/api/internal/logic/polymerizeSearchLogic.go

@@ -0,0 +1,47 @@
+package logic
+
+import (
+	"context"
+	"jyBXCore/rpc/type/bxcore"
+
+	"jyBXCore/api/internal/svc"
+	"jyBXCore/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type PolymerizeSearchLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewPolymerizeSearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PolymerizeSearchLogic {
+	return &PolymerizeSearchLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *PolymerizeSearchLogic) PolymerizeSearch(req *types.PolymerizeSearchReq) (resp *types.CommonResp, err error) {
+	// todo: add your logic here and delete this line
+	res, err := l.svcCtx.BxCore.PolymerizeSearch(l.ctx, &bxcore.PolymerizeSearchReq{
+		EntId:        req.EntId,
+		PositionId:   req.PositionId,
+		AccountId:    req.AccountId,
+		AppId:        req.AppId,
+		SearchCode:   req.SearchCode,
+		PositionType: req.PositionType,
+		UserId:       req.UserId,
+		NewUserId:    req.NewUserId,
+		EntAccountId: req.EntAccountId,
+		EntUserId:    req.EntUserId,
+	})
+	if err != nil {
+		return nil, err
+	}
+	return &types.CommonResp{
+		Data: res.Data,
+	}, nil
+}

+ 13 - 0
jyBXCore/api/internal/types/types.go

@@ -158,3 +158,16 @@ type PtatisticsListReq struct {
 	StartTime    int64    `json:"startTime,optional"`
 	EndTime      int64    `json:"endTime,optional"`
 }
+
+type PolymerizeSearchReq struct {
+	SearchCode   string `json:"searchCode"`
+	EntId        int64  `header:"entId,optional"`        // 企业id
+	PositionType int64  `header:"positionType,optional"` // 职位类型 0个人 1企业
+	PositionId   int64  `header:"positionId,optional"`   //职位id
+	AccountId    int64  `header:"accountId,optional"`    //账户id
+	AppId        string `header:"appId,optional"`        //剑鱼10000
+	UserId       string `header:"userId,optional"`       //用户id
+	NewUserId    int64  `header:"newUserId,optional"`    //base_user_id
+	EntAccountId int64  `header:"entAccountId,optional"` //企业账户id
+	EntUserId    int64  `header:"newUserId,optional"`
+}

+ 19 - 19
jyBXCore/go.mod

@@ -5,14 +5,15 @@ go 1.19
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230727083622-4dfc804ea6cf
 	app.yhyue.com/moapp/jylogx v0.0.0-20230522075659-ae6fbedb92bc
-	app.yhyue.com/moapp/jypkg v0.0.0-20230621114846-e9533ffc8ba0
+	app.yhyue.com/moapp/jypkg v0.0.0-20230726073749-b08ff9ef154f
 	bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4
 	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230225125145-431a4f70093a
-	github.com/go-sql-driver/mysql v1.7.0
+	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.13
+	github.com/go-sql-driver/mysql v1.7.1
 	github.com/gogf/gf/v2 v2.3.1
-	github.com/zeromicro/go-zero v1.5.2
-	google.golang.org/grpc v1.54.0
-	google.golang.org/protobuf v1.30.0
+	github.com/zeromicro/go-zero v1.5.3
+	google.golang.org/grpc v1.56.1
+	google.golang.org/protobuf v1.31.0
 )
 
 exclude bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220424062752-50170a93c431
@@ -24,7 +25,6 @@ require (
 	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
 	bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e // indirect
 	bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.7 // indirect
-	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.13 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect
 	github.com/cenkalti/backoff/v4 v4.2.1 // indirect
 	github.com/cespare/xxhash/v2 v2.2.0 // indirect
@@ -34,7 +34,6 @@ require (
 	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
 	github.com/emicklei/go-restful/v3 v3.9.0 // indirect
 	github.com/fatih/color v1.15.0 // indirect
-	github.com/felixge/fgprof v0.9.3 // indirect
 	github.com/fsnotify/fsnotify v1.6.0 // indirect
 	github.com/garyburd/redigo v1.6.2 // indirect
 	github.com/go-logr/logr v1.2.4 // indirect
@@ -52,7 +51,6 @@ require (
 	github.com/google/gnostic v0.5.7-v3refs // indirect
 	github.com/google/go-cmp v0.5.9 // indirect
 	github.com/google/gofuzz v1.2.0 // indirect
-	github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect
 	github.com/google/uuid v1.3.0 // indirect
 	github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
@@ -75,9 +73,9 @@ require (
 	github.com/olivere/elastic v6.2.37+incompatible // indirect
 	github.com/olivere/elastic/v7 v7.0.22 // indirect
 	github.com/openzipkin/zipkin-go v0.4.1 // indirect
-	github.com/pelletier/go-toml/v2 v2.0.7 // indirect
+	github.com/pelletier/go-toml/v2 v2.0.8 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
-	github.com/prometheus/client_golang v1.15.0 // indirect
+	github.com/prometheus/client_golang v1.15.1 // indirect
 	github.com/prometheus/client_model v0.3.0 // indirect
 	github.com/prometheus/common v0.42.0 // indirect
 	github.com/prometheus/procfs v0.9.0 // indirect
@@ -93,16 +91,17 @@ require (
 	github.com/xdg-go/scram v1.1.1 // indirect
 	github.com/xdg-go/stringprep v1.0.3 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
-	go.etcd.io/etcd/api/v3 v3.5.8 // indirect
-	go.etcd.io/etcd/client/pkg/v3 v3.5.8 // indirect
-	go.etcd.io/etcd/client/v3 v3.5.8 // indirect
-	go.mongodb.org/mongo-driver v1.11.4 // indirect
+	go.etcd.io/etcd/api/v3 v3.5.9 // indirect
+	go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
+	go.etcd.io/etcd/client/v3 v3.5.9 // indirect
+	go.mongodb.org/mongo-driver v1.11.6 // indirect
 	go.opentelemetry.io/otel v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/jaeger v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.15.1 // indirect
+	go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 // indirect
 	go.opentelemetry.io/otel/exporters/zipkin v1.15.1 // indirect
 	go.opentelemetry.io/otel/sdk v1.15.1 // indirect
 	go.opentelemetry.io/otel/trace v1.15.1 // indirect
@@ -112,15 +111,15 @@ require (
 	go.uber.org/multierr v1.9.0 // indirect
 	go.uber.org/zap v1.24.0 // indirect
 	golang.org/x/crypto v0.6.0 // indirect
-	golang.org/x/net v0.9.0 // indirect
-	golang.org/x/oauth2 v0.5.0 // indirect
+	golang.org/x/net v0.10.0 // indirect
+	golang.org/x/oauth2 v0.7.0 // indirect
 	golang.org/x/sync v0.1.0 // indirect
-	golang.org/x/sys v0.7.0 // indirect
-	golang.org/x/term v0.7.0 // indirect
+	golang.org/x/sys v0.8.0 // indirect
+	golang.org/x/term v0.8.0 // indirect
 	golang.org/x/text v0.9.0 // indirect
 	golang.org/x/time v0.3.0 // indirect
 	google.golang.org/appengine v1.6.7 // indirect
-	google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 // indirect
+	google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/ini.v1 v1.67.0 // indirect
@@ -129,6 +128,7 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
+	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 // indirect
 	k8s.io/api v0.26.3 // indirect
 	k8s.io/apimachinery v0.27.0-alpha.3 // indirect
 	k8s.io/client-go v0.26.3 // indirect

+ 40 - 41
jyBXCore/go.sum

@@ -15,8 +15,8 @@ app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloO
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
 app.yhyue.com/moapp/jylogx v0.0.0-20230522075659-ae6fbedb92bc h1:QEwc+V6ZTvk3VMFiMgPYJpsAVqRvTeIMupVfpO5PQYk=
 app.yhyue.com/moapp/jylogx v0.0.0-20230522075659-ae6fbedb92bc/go.mod h1:5xAagkwCYnqG5VEHnOV2AqD6DiR169qvOjYKaHMHecU=
-app.yhyue.com/moapp/jypkg v0.0.0-20230621114846-e9533ffc8ba0 h1:sKWgJriRTdxEuNkzAooMAjs+2bPu1mq9Q493aMA98oI=
-app.yhyue.com/moapp/jypkg v0.0.0-20230621114846-e9533ffc8ba0/go.mod h1:Ize93SJEPkBR0Tz8PM2KTJK3bpzlD/qp1JwJ4kdmlss=
+app.yhyue.com/moapp/jypkg v0.0.0-20230726073749-b08ff9ef154f h1:PnGIljFreVAZwAeSLzG8sX9zOJ9guheW6mLZ18RtS3A=
+app.yhyue.com/moapp/jypkg v0.0.0-20230726073749-b08ff9ef154f/go.mod h1:VaHDi3twSg4G84k2+UFOe7ZCw5EqUZVAkW2N2dHeMbU=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
@@ -117,7 +117,7 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn
 github.com/alicebob/miniredis/v2 v2.14.1/go.mod h1:uS970Sw5Gs9/iK3yBg0l9Uj9s25wXxSpQUE9EaJ/Blg=
 github.com/alicebob/miniredis/v2 v2.17.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I=
 github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88=
-github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I=
+github.com/alicebob/miniredis/v2 v2.30.3 h1:hrqDB4cHFSHQf4gO3xu6YKQg8PqJpNjLYsQAFYHstqw=
 github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
 github.com/antlr/antlr4 v0.0.0-20210105212045-464bcbc32de2/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y=
@@ -221,8 +221,6 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF
 github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
 github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
 github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
-github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=
-github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
 github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
 github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
 github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
@@ -292,8 +290,8 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG
 github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
 github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
-github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
-github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
+github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
+github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
 github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8=
@@ -342,8 +340,8 @@ github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w
 github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
 github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
-github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
 github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
+github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
 github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -422,8 +420,6 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
 github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y=
-github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -472,7 +468,6 @@ github.com/iancoleman/strcase v0.1.2/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5N
 github.com/iancoleman/strcase v0.1.3/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
-github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
 github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
@@ -697,8 +692,8 @@ github.com/paulmach/orb v0.7.1/go.mod h1:FWRlTgl88VI1RBx/MkrwWDRhQ96ctqMCh8boXhm
 github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY=
 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
 github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI=
-github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us=
-github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
+github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
+github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
 github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
 github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
 github.com/pierrec/lz4 v2.5.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
@@ -721,8 +716,8 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP
 github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
 github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
 github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
-github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM=
-github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
+github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI=
+github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -823,7 +818,8 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
 github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
 github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
 github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
 github.com/tal-tech/go-zero v1.1.5/go.mod h1:LbN0C7/rbl2+LUWTSUYx5leXmgedeMWjt1jc3/8/zFA=
@@ -867,28 +863,28 @@ github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ
 github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
 github.com/zeromicro/go-zero v1.3.2/go.mod h1:DEj3Fwj1Ui1ltsgf6YqwTL9nD4+tYzIRX0c1pWtQo1E=
 github.com/zeromicro/go-zero v1.3.5/go.mod h1:wh4o794b7Ul3W0k35Pw9nc3iB4O0OpaQTMQz/PJc1bc=
-github.com/zeromicro/go-zero v1.5.2 h1:vpMlZacCMtgdtYzKI3OMyhS6mZ9UQctiAh0J7gIq31I=
-github.com/zeromicro/go-zero v1.5.2/go.mod h1:ndCd1nMMAdEMZgPfdm1fpavHUdBW0ykB6ckCRaSG10w=
+github.com/zeromicro/go-zero v1.5.3 h1:9poyd+raeL7gSMUu6P19N7bssTppieR2j7Oos2j1yFQ=
+github.com/zeromicro/go-zero v1.5.3/go.mod h1:dmoBpgJTxt9KWmgrNGpv06XxZRPXMakrxUVgROFAR3g=
 github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
 go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
 go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM=
 go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
 go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
-go.etcd.io/etcd/api/v3 v3.5.8 h1:Zf44zJszoU7zRV0X/nStPenegNXoFDWcB/MwrJbA+L4=
-go.etcd.io/etcd/api/v3 v3.5.8/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k=
+go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs=
+go.etcd.io/etcd/api/v3 v3.5.9/go.mod h1:uyAal843mC8uUVSLWz6eHa/d971iDGnCRpmKd2Z+X8k=
 go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
 go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
-go.etcd.io/etcd/client/pkg/v3 v3.5.8 h1:tPp9YRn/UBFAHdhOQUII9eUs7aOK35eulpMhX4YBd+M=
-go.etcd.io/etcd/client/pkg/v3 v3.5.8/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4=
+go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE=
+go.etcd.io/etcd/client/pkg/v3 v3.5.9/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4=
 go.etcd.io/etcd/client/v3 v3.5.2/go.mod h1:kOOaWFFgHygyT0WlSmL8TJiXmMysO/nNUlEsSsN6W4o=
 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY=
-go.etcd.io/etcd/client/v3 v3.5.8 h1:B6ngTKZSWWowHEoaucOKHQR/AtZKaoHLiUpWxOLG4l4=
-go.etcd.io/etcd/client/v3 v3.5.8/go.mod h1:idZYIPVkttBJBiRigkB5EM0MmEyx8jcl18zCV3F5noc=
+go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E=
+go.etcd.io/etcd/client/v3 v3.5.9/go.mod h1:i/Eo5LrZ5IKqpbtpPDuaUnDOUv471oDg8cjQaUr2MbA=
 go.mongodb.org/mongo-driver v1.5.0/go.mod h1:boiGPFqyBs5R0R5qf2ErokGRekMfwn+MqKaUyHs7wy0=
 go.mongodb.org/mongo-driver v1.9.0/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY=
 go.mongodb.org/mongo-driver v1.9.1/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY=
-go.mongodb.org/mongo-driver v1.11.4 h1:4ayjakA013OdpGyL2K3ZqylTac/rMjrJOMZ1EHizXas=
-go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
+go.mongodb.org/mongo-driver v1.11.6 h1:XM7G6PjiGAO5betLF13BIa5TlLUUE3uJ/2Ox3Lz1K+o=
+go.mongodb.org/mongo-driver v1.11.6/go.mod h1:G9TgswdsWjX4tmDA5zfs2+6AEPpYJwqblyjsfuh8oXY=
 go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
 go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
 go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
@@ -914,6 +910,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 h1:pIfoG
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1/go.mod h1:poNKBqF5+nR/6ke2oGTDjHfksrsHDOHXAl2g4+9ONsY=
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.15.1 h1:pnJfHmVcCEBcH5lkM+npJF8cTAjV/d+9cXVNCs5P/ao=
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.15.1/go.mod h1:cC3Eu2V56zXY09YlijmqDhOUnL2jVL6KKJg4PGh++dU=
+go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 h1:sEL90JjOO/4yhquXl5zTAkLLsZ5+MycAgX99SDsxGc8=
+go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0/go.mod h1:oCslUcizYdpKYyS9e8srZEqM6BB8fq41VJBjLAE6z1w=
 go.opentelemetry.io/otel/exporters/zipkin v1.3.0/go.mod h1:LxGGfHIYbvsFnrJtBcazb0yG24xHdDGrT/H6RB9r3+8=
 go.opentelemetry.io/otel/exporters/zipkin v1.8.0/go.mod h1:0uYAyCuGT67MFV9Z/Mmx93wGuugHw0FbxMc74fs3LNo=
 go.opentelemetry.io/otel/exporters/zipkin v1.15.1 h1:B6s/o48bx00ayJu7F+jIMJfhPTyxW+S8vthjTZMNBj0=
@@ -1073,8 +1071,8 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx
 golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
-golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
-golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
+golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
+golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -1087,8 +1085,8 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ
 golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s=
-golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
+golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g=
+golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -1174,7 +1172,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1186,14 +1183,14 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
-golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
+golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=
-golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
+golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
+golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1362,8 +1359,8 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH
 google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
 google.golang.org/genproto v0.0.0-20220228195345-15d65a4533f7/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
 google.golang.org/genproto v0.0.0-20220602131408-e326c6e8e9c8/go.mod h1:yKyY4AMRwFiC8yMMNaMi+RkCnjZJt9LoWuvhXjMs+To=
-google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 h1:BwjeHhu4HS48EZmu1nS7flldBIDPC3qn+HqaSQ1K4x8=
-google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
+google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
+google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
 google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
@@ -1392,8 +1389,8 @@ google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5
 google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
 google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
 google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
-google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag=
-google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g=
+google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ=
+google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
 google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
 google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
 google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -1408,8 +1405,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
-google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
+google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
 gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
 gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
@@ -1470,6 +1467,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 h1:BItxi1gkQUs3sjxaBk6tc34fZWSO4hUSXcTM3PcnY4I=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
 k8s.io/api v0.20.12/go.mod h1:A2brwyEkVLM3wQGNnzoAa5JsQRzHK0uoOQ+bsnv7V68=
 k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A=
 k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=

+ 59 - 2
jyBXCore/rpc/bxcore.proto

@@ -464,7 +464,7 @@ message PushStatisticsData{
   int64   bidNumb = 5;//投标数量
   int64   winNumb = 6;//中标数量
   int64   browseNumb = 7;//浏览数量
-  string  entUserId=8;
+  string  entUserId = 8;
 }
 message ProjectStatisticsDataRes{
   int64 err_code = 1;
@@ -482,8 +482,63 @@ message ProjectStatisticsData{
   int64   channelWinNumb = 8; //渠道中标数
   int64   notBidNumber = 9; //未中标数量
   int64   endNumb = 10; //终止数量
-  string  entUserId=11;
+  string  entUserId = 11;
 }
+message  PolymerizeSearchReq{
+  int64  entId = 1; //企业id
+  string searchCode = 2;
+  int64  positionId = 3; // 职位id
+  int64  positionType = 4;// 职位类型 0个人 1企业
+  string appId = 6;//剑鱼默认10000
+  string  userId = 7;//用户id
+  int64  newUserId = 8;//base_user_id 新用户id
+  int64 accountId = 9; //账户id
+  int64 entUserId = 10; // 企业下用户id
+  int64 entAccountId = 11;//企业账户id
+}
+message  PolymerizeSearchResp{
+  int64 err_code = 1;
+  string err_msg = 2;
+  SearchReturn data = 3;
+}
+message SearchReturn{
+  SearchMap entList = 1;
+  SearchMap procureList = 2;
+  repeated MenuList menuList = 3;
+  SearchMap subscribeList = 4;
+}
+message SearchMap{
+  repeated Search data = 1;
+  int64  count=2;
+}
+message Search{
+  string title = 1;
+  string url = 2;
+  int64  dataTime = 3;
+}
+message MenuList{
+  string name = 1;
+  string icon = 2;
+  string url = 3;
+  bool usable = 4;
+  string  id = 5;
+  string appType = 6;
+  string openType = 7;
+  TipInfo tipInfo = 8;
+  repeated  string match = 10;
+  string  path=11;
+}
+
+message TipInfo {
+  string title = 1;
+  string content = 2;
+  string confirmUrl = 3;
+  string confirmText = 4;
+  bool isShowCancel = 5;
+  string appType = 6;
+  string openType = 7;
+}
+
 //
 service BxCore {
   //标讯搜索结果列表数据
@@ -512,4 +567,6 @@ service BxCore {
   rpc PushStatistics(StatisticsListReq) returns (PushStatisticsDataRes);
   //参标项目统计
   rpc ProjectStatistics(StatisticsListReq) returns (ProjectStatisticsDataRes);
+  //聚合搜索
+  rpc PolymerizeSearch(PolymerizeSearchReq) returns (PolymerizeSearchResp);
 }

+ 14 - 0
jyBXCore/rpc/bxcore/bxcore.go

@@ -14,6 +14,7 @@ import (
 
 type (
 	BidTypeReq               = bxcore.BidTypeReq
+	MenuList                 = bxcore.MenuList
 	PInfo                    = bxcore.PInfo
 	ParticipateActionReq     = bxcore.ParticipateActionReq
 	ParticipateActionRes     = bxcore.ParticipateActionRes
@@ -39,19 +40,24 @@ type (
 	ParticipateSetUpInfoRes  = bxcore.ParticipateSetUpInfoRes
 	ParticipateShowReq       = bxcore.ParticipateShowReq
 	ParticipateShowRes       = bxcore.ParticipateShowRes
+	PolymerizeSearchReq      = bxcore.PolymerizeSearchReq
+	PolymerizeSearchResp     = bxcore.PolymerizeSearchResp
 	ProjectStatisticsData    = bxcore.ProjectStatisticsData
 	ProjectStatisticsDataRes = bxcore.ProjectStatisticsDataRes
 	PushStatisticsData       = bxcore.PushStatisticsData
 	PushStatisticsDataRes    = bxcore.PushStatisticsDataRes
 	RemindRuleReq            = bxcore.RemindRuleReq
+	Search                   = bxcore.Search
 	SearchData               = bxcore.SearchData
 	SearchLimitReq           = bxcore.SearchLimitReq
 	SearchLimitResp          = bxcore.SearchLimitResp
 	SearchList               = bxcore.SearchList
 	SearchReq                = bxcore.SearchReq
 	SearchResp               = bxcore.SearchResp
+	SearchReturn             = bxcore.SearchReturn
 	ShowInfo                 = bxcore.ShowInfo
 	StatisticsListReq        = bxcore.StatisticsListReq
+	TipInfo                  = bxcore.TipInfo
 	UpdateBidStatusReq       = bxcore.UpdateBidStatusReq
 	UpdateBidStatusRes       = bxcore.UpdateBidStatusRes
 	WinnerInfo               = bxcore.WinnerInfo
@@ -83,6 +89,8 @@ type (
 		PushStatistics(ctx context.Context, in *StatisticsListReq, opts ...grpc.CallOption) (*PushStatisticsDataRes, error)
 		// 参标项目统计
 		ProjectStatistics(ctx context.Context, in *StatisticsListReq, opts ...grpc.CallOption) (*ProjectStatisticsDataRes, error)
+		// 聚合搜索
+		PolymerizeSearch(ctx context.Context, in *PolymerizeSearchReq, opts ...grpc.CallOption) (*PolymerizeSearchResp, error)
 	}
 
 	defaultBxCore struct {
@@ -173,3 +181,9 @@ func (m *defaultBxCore) ProjectStatistics(ctx context.Context, in *StatisticsLis
 	client := bxcore.NewBxCoreClient(m.cli.Conn())
 	return client.ProjectStatistics(ctx, in, opts...)
 }
+
+// 聚合搜索
+func (m *defaultBxCore) PolymerizeSearch(ctx context.Context, in *PolymerizeSearchReq, opts ...grpc.CallOption) (*PolymerizeSearchResp, error) {
+	client := bxcore.NewBxCoreClient(m.cli.Conn())
+	return client.PolymerizeSearch(ctx, in, opts...)
+}

+ 49 - 9
jyBXCore/rpc/entity/search.go

@@ -4,6 +4,7 @@ import (
 	MC "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/redis"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/powercheck"
 	"encoding/json"
 	"fmt"
 	IC "jyBXCore/rpc/init"
@@ -158,19 +159,26 @@ func (kws *KeyWordsSearch) GetSearchKeyWordsQueryStr(in *bxcore.SearchReq) (sear
 
 // SearchParamsHandle 搜索条件 处理
 func (kws *KeyWordsSearch) SearchParamsHandle(in *bxcore.SearchReq) []string {
-	baseUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
-	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
-	positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
-	positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
 	//判断用户身份
-	userInfo := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.MgoUserId, baseUserId, accountId, in.EntId, positionType, positionId)
-	//是否是付费用户
-	in.IsPay = !userInfo.Free.IsFree
+	var (
+		userInfo     powercheck.CheckResp
+		registerDate int64 = 0
+	)
+	if in.UserId != "" {
+		baseUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
+		accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
+		positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
+		positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
+		userInfo = *IC.Middleground.PowerCheckCenter.Check(in.AppId, in.MgoUserId, baseUserId, accountId, in.EntId, positionType, positionId)
+		//是否是付费用户
+		in.IsPay = !userInfo.Free.IsFree
+		registerDate = userInfo.Free.Registedate
+	}
 	//默认搜索范围
 	if in.SelectType == "" {
 		in.SelectType = "title,content"
 	}
-	queryItems := util.GetQueryItems(in.SelectType, IC.C.BidSearchOldUserLimit, userInfo.Free.Registedate, in.IsPay)
+	queryItems := util.GetQueryItems(in.SelectType, IC.C.BidSearchOldUserLimit, registerDate, in.IsPay)
 	in.SelectType = strings.Join(queryItems, ",")
 	// in.SearchGroup 搜索分组 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
 	//	详情页判断是否能使用超前项目  老版超级订阅、大会员、商机管理有权限
@@ -220,7 +228,7 @@ func (kws *KeyWordsSearch) SearchParamsHandle(in *bxcore.SearchReq) []string {
 		in.Industry = strings.TrimSpace(in.Industry)
 	}
 	//免费用户:高级筛选 采购单位类型、采购单位联系方式、中标企业联系方式、排除词、城市
-	if userInfo.Free.IsFree {
+	if !in.IsPay {
 		in.BuyerClass = ""
 		in.BuyerTel = ""
 		in.WinnerTel = ""
@@ -275,3 +283,35 @@ func (kws *KeyWordsSearch) GetBidSearchList(in *bxcore.SearchReq) (count, total
 	}
 	return
 }
+
+// 聚合搜索
+func (kws *KeyWordsSearch) PolymerizeSearch(in *bxcore.PolymerizeSearchReq) *bxcore.SearchReturn {
+	data := &bxcore.SearchReturn{}
+
+	//powerCheck := IC.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, in.NewUserId, in.AccountId, in.EntId, in.PositionType, in.PositionId)
+	//企业搜索
+	now1 := time.Now().Unix()
+	entList := &bxcore.SearchMap{}
+	entList.Data, entList.Count = service.EntSearch(in.SearchCode)
+	data.EntList = entList
+	now2 := time.Now().Unix()
+	//采购单位搜搜索
+	procureList := &bxcore.SearchMap{}
+	procureList.Data, procureList.Count = service.ProcureSearch(in.SearchCode)
+	data.ProcureList = procureList
+	now3 := time.Now().Unix()
+	log.Println("企业查询耗时", now2-now1)
+	log.Println("采购单位搜搜索", now3-now2)
+	/*if in.AccountId > 0 {
+		//菜单搜索
+		data.MenuList = service.MenuSearch(in)
+		//标讯搜索
+		now4 := time.Now().Unix()
+		subscribeList := &bxcore.SearchMap{}
+		subscribeList.Data = service.SubscribeSearch(in.SearchCode, powerCheck)
+		data.SubscribeList = subscribeList
+		now4 := time.Now().Unix()
+		log.Println("菜单搜索", now4-now3)
+	}*/
+	return data
+}

+ 3 - 2
jyBXCore/rpc/etc/bxcore.yaml

@@ -45,8 +45,9 @@ ContextOldVipLimit: 1664553600
 Middleground:
   Etcd:
     Hosts:
-      - 192.168.3.149:2379
+      - 192.168.3.206:2379
   PowerCheckCenterKey: powercheck.rpc #权益校验中台
   UserCenterKey: usercenter.rpc #用户中台rpc
   ResourceCenterKey: resource.rpc #资源中台rpc
-ResourceCode: "cb_zy_code"
+ResourceCode: "cb_zy_code"
+SearchConcurrency: 20

+ 1 - 1
jyBXCore/rpc/etc/db.yaml

@@ -18,7 +18,7 @@ redis:
         - other=192.168.3.149:1712
         - newother=192.168.3.149:1712
 es:
-    addr: http://192.168.3.242:9100
+    addr: http://192.168.3.241:9205,http://192.168.3.149:9200
     size: 50
     version: v7
     userName: ""

+ 2 - 1
jyBXCore/rpc/init/init.go

@@ -20,6 +20,7 @@ var (
 	logc           entity.Logc
 	SearchLimitKey = "jy_limitSearchText_new" // 全文或附件搜索限制
 	Middleground   *middleground.Middleground
+	Search_Thread  chan bool
 )
 
 func init() {
@@ -35,7 +36,7 @@ func init() {
 	RedisInit(&DB.Redis)
 	//初始es
 	EsInit(&DB.Es)
-
+	Search_Thread = make(chan bool, C.SearchConcurrency)
 	//初始化标签
 	LabelInit()
 	//

+ 2 - 1
jyBXCore/rpc/internal/config/config.go

@@ -52,7 +52,8 @@ type Config struct {
 		UserCenterKey       string
 		ResourceCenterKey   string
 	}
-	ResourceCode string
+	ResourceCode      string
+	SearchConcurrency int64
 }
 
 type Db struct {

+ 44 - 0
jyBXCore/rpc/internal/logic/polymerizesearchlogic.go

@@ -0,0 +1,44 @@
+package logic
+
+import (
+	"context"
+	"github.com/zeromicro/go-zero/core/logx"
+	"jyBXCore/rpc/entity"
+	IC "jyBXCore/rpc/init"
+	"jyBXCore/rpc/internal/svc"
+	"jyBXCore/rpc/type/bxcore"
+)
+
+type PolymerizeSearchLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewPolymerizeSearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PolymerizeSearchLogic {
+	return &PolymerizeSearchLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 聚合搜索
+func (l *PolymerizeSearchLogic) PolymerizeSearch(in *bxcore.PolymerizeSearchReq) (*bxcore.PolymerizeSearchResp, error) {
+	// todo: add your logic here and delete this line
+	if in.SearchCode == "" {
+		return &bxcore.PolymerizeSearchResp{}, nil
+	}
+	data := &bxcore.SearchReturn{}
+	IC.Search_Thread <- true
+	ks := entity.NewKeyWordsSearch()
+	defer func() {
+		<-IC.Search_Thread
+	}()
+	data = ks.PolymerizeSearch(in)
+	return &bxcore.PolymerizeSearchResp{
+		ErrCode: 0,
+		ErrMsg:  "",
+		Data:    data,
+	}, nil
+}

+ 6 - 0
jyBXCore/rpc/internal/server/bxcoreserver.go

@@ -99,3 +99,9 @@ func (s *BxCoreServer) ProjectStatistics(ctx context.Context, in *bxcore.Statist
 	l := logic.NewProjectStatisticsLogic(ctx, s.svcCtx)
 	return l.ProjectStatistics(in)
 }
+
+// 聚合搜索
+func (s *BxCoreServer) PolymerizeSearch(ctx context.Context, in *bxcore.PolymerizeSearchReq) (*bxcore.PolymerizeSearchResp, error) {
+	l := logic.NewPolymerizeSearchLogic(ctx, s.svcCtx)
+	return l.PolymerizeSearch(in)
+}

+ 141 - 0
jyBXCore/rpc/service/search.go

@@ -2,6 +2,11 @@ package service
 
 import (
 	MC "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	elastic "app.yhyue.com/moapp/jybase/es"
+	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/pb"
+	userPb "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
+	"fmt"
 	IC "jyBXCore/rpc/init"
 	"jyBXCore/rpc/model/es"
 	"jyBXCore/rpc/type/bxcore"
@@ -11,6 +16,15 @@ import (
 	"time"
 )
 
+const (
+	entQuery      = `{"query":{"bool":{"must":[%s],"must_not":[%s]}},"_source":["_id","company_name","company_status","legal_person","capital","company_address","company_shortname","company_phone","establish_date"],"sort":[{"capital":{"order":"desc"}}]}`
+	entQueryCount = `{"query":{"bool":{"must":[%s],"must_not":[%s]}}}`
+	index, itype  = "qyxy", "qyxy"
+	query         = `{%s "query":{"bool":{"must":[%s],"must_not": [{"term": {"buyer_name": ""}}]}}}`
+	BuyerIndex    = "buyer" // 采购单位index
+	BuyerType     = "buyer"
+)
+
 // GetBidSearchData  默认查询缓存数据 只查标题
 // 登录用户默认搜索500条数据,付费用户字段和免费用户字段不同,未登录用户查询5000条。
 // 标信息搜索 isCache:是否是获取缓存信息
@@ -51,3 +65,130 @@ func GetBidSearchData(in *bxcore.SearchReq, isCache bool) (count int64, list []*
 	}
 	return
 }
+
+func EntSearch(searchCode string) ([]*bxcore.Search, int64) {
+	data := make([]*bxcore.Search, 0, 0)
+	count := int64(0)
+	musts := make([]string, 0, 0)
+	musts = append(musts, `{"range":{"company_type_int":{"to":"22"}}}`)
+	thisQuery := []string{}
+	//查询指定内容
+	thisQuery = append(thisQuery, fmt.Sprintf(`{"match_phrase":{"name":"%s"}}`, searchCode))
+	musts = append(musts, fmt.Sprintf(`{"bool":{"should":[%s],"minimum_should_match": 1}}`, strings.Join(thisQuery, ",")))
+	sql := fmt.Sprintf(entQuery, strings.Join(musts, ","), "")
+	sql = sql[:len(sql)-1] + fmt.Sprintf(`,"from":%d,"size":%d}`, 0, 5)
+	log.Println("企业搜索sql:", sql)
+	count, list := elastic.GetWithCount(index, itype, "", sql)
+	if list != nil {
+		for _, value := range *list {
+			data = append(data, &bxcore.Search{
+				Title: MC.InterfaceToStr(value["company_name"]),
+				Url:   encrypt.EncodeArticleId2ByCheck(MC.ObjToString(value["_id"])),
+			})
+		}
+	}
+	return data, count
+}
+func ProcureSearch(searchCode string) ([]*bxcore.Search, int64) {
+	data := []*bxcore.Search{}
+	count := int64(0)
+	//数据查询处理
+	entNameQuery := fmt.Sprintf(`{"multi_match": {"query": "%s","type": "phrase", "fields": ["name"]}}`, searchCode)
+	qstr := fmt.Sprintf(query, fmt.Sprintf(`"from":%d,"size": %d,`, 0, 5), entNameQuery)
+	log.Println("采购单位搜索sql:", qstr)
+	count, rs := elastic.GetWithCount(BuyerIndex, BuyerType, "", qstr)
+	//rs := elastic.Get(BuyerIndex, BuyerType, qstr) // 采购单位列表
+	if rs == nil || len(*rs) == 0 {
+		return data, count
+	}
+	for i := 0; i < len(*rs); i++ {
+		data = append(data, &bxcore.Search{
+			Title: MC.ObjToString((*rs)[i]["name"]),
+		})
+	}
+	return data, count
+}
+
+// 菜单搜索
+func MenuSearch(in *bxcore.PolymerizeSearchReq) []*bxcore.MenuList {
+	data := []*bxcore.MenuList{}
+	workData := IC.Middleground.UserCenter.WorkDesktopMenuInfo(userPb.WorkDesktopMenuInfoReq{
+		UserId:       in.UserId,
+		AppId:        in.AppId,
+		Platform:     "PC",
+		NewUserId:    MC.InterfaceToStr(in.NewUserId),
+		EntId:        MC.InterfaceToStr(in.EntId),
+		EntUserId:    MC.InterfaceToStr(in.EntUserId),
+		AccountId:    MC.InterfaceToStr(in.AccountId),
+		PositionType: MC.InterfaceToStr(in.PositionType),
+		PositionId:   MC.InterfaceToStr(in.PositionId),
+		EntAccountId: MC.InterfaceToStr(in.EntAccountId),
+	})
+	if workData != nil && len(workData.Data.MenuList) > 0 {
+		for _, value1 := range workData.Data.MenuList {
+			for _, value2 := range value1.Child {
+				for _, value3 := range value2.Child {
+					if strings.Contains(value3.Name, in.SearchCode) {
+						tipInfo := &bxcore.TipInfo{}
+						if value3.TipInfo != nil {
+							tipInfo = &bxcore.TipInfo{
+								Title:        value3.TipInfo.Title,
+								Content:      value3.TipInfo.Content,
+								ConfirmUrl:   value3.TipInfo.ConfirmUrl,
+								ConfirmText:  value3.TipInfo.ConfirmText,
+								IsShowCancel: value3.TipInfo.IsShowCancel,
+								AppType:      value3.TipInfo.AppType,
+								OpenType:     value3.TipInfo.OpenType,
+							}
+						}
+						data = append(data, &bxcore.MenuList{
+							Name:     value3.Name,
+							Icon:     value3.Icon,
+							Url:      value3.Url,
+							Usable:   value3.Usable,
+							AppType:  value3.AppType,
+							OpenType: value3.OpenType,
+							TipInfo:  tipInfo,
+							Match:    value3.Match,
+							Path:     fmt.Sprintf("%s>%s>%s", value1.Name, value2.Name, value3.Name),
+						})
+					}
+				}
+			}
+		}
+	}
+	return data
+}
+func SubscribeSearch(searchCode string, powerCheck *pb.CheckResp) []*bxcore.Search {
+	data := []*bxcore.Search{}
+	in := &bxcore.SearchReq{
+		PageNum:     int64(1),
+		PageSize:    int64(10),
+		IsPay:       false,
+		SelectType:  "title",
+		KeyWords:    searchCode,
+		PublishTime: fmt.Sprintf("%v_%v", time.Now().AddDate(-1, 0, 0).Unix(), time.Now().Unix()),
+	}
+	isLimit := int64(0)
+	isLimit = util.IsLimited(in.LimitFlag, in.UserId, powerCheck.Vip.Status > 0 || powerCheck.Member.Status > 0, in.IsNew)
+	if isLimit == 1 { //没有被限制
+		defer util.Limit()
+	}
+	list := []*bxcore.SearchList{}
+	if isLimit == 1 {
+		//付费用户搜索优化--默认搜索5年数据,数据量太多,接口反应太慢,前两页数据 时间范围根据配置缩小查询以达到快速查询的目的。
+		t1 := time.Now()
+		_, list = GetBidSearchData(in, false)
+		log.Println("1查询耗时:", time.Since(t1))
+	}
+	if list != nil && len(list) > 0 {
+		for _, value := range list {
+			data = append(data, &bxcore.Search{
+				Title:    value.Title,
+				Url:      value.Id,
+				DataTime: value.PublishTime,
+			})
+		}
+	}
+	return data
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 865 - 95
jyBXCore/rpc/type/bxcore/bxcore.pb.go


+ 38 - 0
jyBXCore/rpc/type/bxcore/bxcore_grpc.pb.go

@@ -48,6 +48,8 @@ type BxCoreClient interface {
 	PushStatistics(ctx context.Context, in *StatisticsListReq, opts ...grpc.CallOption) (*PushStatisticsDataRes, error)
 	//参标项目统计
 	ProjectStatistics(ctx context.Context, in *StatisticsListReq, opts ...grpc.CallOption) (*ProjectStatisticsDataRes, error)
+	//聚合搜索
+	PolymerizeSearch(ctx context.Context, in *PolymerizeSearchReq, opts ...grpc.CallOption) (*PolymerizeSearchResp, error)
 }
 
 type bxCoreClient struct {
@@ -175,6 +177,15 @@ func (c *bxCoreClient) ProjectStatistics(ctx context.Context, in *StatisticsList
 	return out, nil
 }
 
+func (c *bxCoreClient) PolymerizeSearch(ctx context.Context, in *PolymerizeSearchReq, opts ...grpc.CallOption) (*PolymerizeSearchResp, error) {
+	out := new(PolymerizeSearchResp)
+	err := c.cc.Invoke(ctx, "/bxcore.BxCore/PolymerizeSearch", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // BxCoreServer is the server API for BxCore service.
 // All implementations must embed UnimplementedBxCoreServer
 // for forward compatibility
@@ -205,6 +216,8 @@ type BxCoreServer interface {
 	PushStatistics(context.Context, *StatisticsListReq) (*PushStatisticsDataRes, error)
 	//参标项目统计
 	ProjectStatistics(context.Context, *StatisticsListReq) (*ProjectStatisticsDataRes, error)
+	//聚合搜索
+	PolymerizeSearch(context.Context, *PolymerizeSearchReq) (*PolymerizeSearchResp, error)
 	mustEmbedUnimplementedBxCoreServer()
 }
 
@@ -251,6 +264,9 @@ func (UnimplementedBxCoreServer) PushStatistics(context.Context, *StatisticsList
 func (UnimplementedBxCoreServer) ProjectStatistics(context.Context, *StatisticsListReq) (*ProjectStatisticsDataRes, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ProjectStatistics not implemented")
 }
+func (UnimplementedBxCoreServer) PolymerizeSearch(context.Context, *PolymerizeSearchReq) (*PolymerizeSearchResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method PolymerizeSearch not implemented")
+}
 func (UnimplementedBxCoreServer) mustEmbedUnimplementedBxCoreServer() {}
 
 // UnsafeBxCoreServer may be embedded to opt out of forward compatibility for this service.
@@ -498,6 +514,24 @@ func _BxCore_ProjectStatistics_Handler(srv interface{}, ctx context.Context, dec
 	return interceptor(ctx, in, info, handler)
 }
 
+func _BxCore_PolymerizeSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(PolymerizeSearchReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxCoreServer).PolymerizeSearch(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxcore.BxCore/PolymerizeSearch",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxCoreServer).PolymerizeSearch(ctx, req.(*PolymerizeSearchReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // BxCore_ServiceDesc is the grpc.ServiceDesc for BxCore service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -557,6 +591,10 @@ var BxCore_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "ProjectStatistics",
 			Handler:    _BxCore_ProjectStatistics_Handler,
 		},
+		{
+			MethodName: "PolymerizeSearch",
+			Handler:    _BxCore_PolymerizeSearch_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "bxcore.proto",

+ 0 - 11
jyBXSubscribe/api/etc/db.yaml

@@ -1,11 +0,0 @@
-mongo:
-    main:
-        dbName: qfw
-        size: 5
-        address: 192.168.3.206:27080
-    mgoLog:
-        address: 192.168.3.206:27090
-        size: 5
-        dbName: qfw
-        userName: admin
-        password: "123456"

+ 34 - 19
jyBXSubscribe/rpc/internal/logic/getsubsomeinfologic.go

@@ -5,7 +5,6 @@ import (
 	"app.yhyue.com/moapp/jybase/redis"
 	"context"
 	IC "jyBXSubscribe/rpc/init"
-	"jyBXSubscribe/rpc/model"
 	"strconv"
 	"time"
 
@@ -29,6 +28,13 @@ func NewGetSubSomeInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge
 	}
 }
 
+const (
+	SubFreeFlag  = "fType"
+	SubVipFlag   = "vType"
+	MemberFlag   = "mType"
+	EntnicheFlag = "eType"
+)
+
 // 获取订阅推送相关信息
 func (l *GetSubSomeInfoLogic) GetSubSomeInfo(in *bxsubscribe.SomeInfoReq) (*bxsubscribe.SomeInfoResp, error) {
 	resp := &bxsubscribe.SomeInfoResp{
@@ -45,29 +51,40 @@ func (l *GetSubSomeInfoLogic) GetSubSomeInfo(in *bxsubscribe.SomeInfoReq) (*bxsu
 		},
 	}
 	baseUserId, _ := strconv.ParseInt(in.NewUserId, 10, 64)
-	//accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
-	//positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
-	//positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
-	//entId, _ := strconv.ParseInt(in.EntId, 10, 64)
-	//userInfo := IC.Compatible.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, baseUserId, accountId, entId, positionType, positionId)
+	accountId, _ := strconv.ParseInt(in.AccountId, 10, 64)
+	positionType, _ := strconv.ParseInt(in.PositionType, 10, 64)
+	positionId, _ := strconv.ParseInt(in.PositionId, 10, 64)
+	entId, _ := strconv.ParseInt(in.EntId, 10, 64)
+	user := IC.Compatible.Middleground.PowerCheckCenter.Check(in.AppId, in.UserId, baseUserId, accountId, entId, positionType, positionId)
 	//logx.Info("userInfo:", userInfo)
 	//P278 身份切换,切换企业 userId从代理header 获取的值是 职位id,所以改成用base_user_id 进行查user表信息
-	user, _ := model.NewSubscribePush(in.UserType).UserInfo(baseUserId)
+	//user, _ := model.NewSubscribePush(in.UserType).UserInfo(in.UserId)
 	//
-	resp.Data.HasKey, resp.Data.Industry = model.GetKeySet(in.UserType, user, []string{})
+	//resp.Data.HasKey, resp.Data.Industry = model.GetKeySet(in.UserType, user, []string{})
 	todayNum := time.Unix(time.Now().Unix(), 1).Format("20060102")
 	if user != nil {
+		resp.Data.HasKey = user.Vip.GetHasKey()
+		switch in.UserType {
+		case SubFreeFlag:
+			resp.Data.HasKey = user.Free.FreeHasKey
+		case SubVipFlag:
+			resp.Data.HasKey = user.Vip.HasKey
+		case MemberFlag:
+			resp.Data.HasKey = user.Member.HasKey
+		case EntnicheFlag:
+			resp.Data.HasKey = user.Entniche.HasKey
+		}
 		//超级订阅
-		if common.IntAll((*user)["i_vip_status"]) == 1 || common.IntAll((*user)["i_vip_status"]) == 2 {
+		if user.Vip.Status == 1 || common.IntAll(user.Vip.Status) == 2 {
 			var threeRemind = int64(3 * 24 * 60 * 60)
 			var twoRemind = int64(2 * 24 * 60 * 60)
 			var oneRemind = int64(1 * 24 * 60 * 60)
-			if (*user)["isread"] != nil {
+			/*if (*user)["isread"] != nil {
 				resp.Data.IsRead = (*user)["isread"].(bool)
-			}
+			}*/
 			resp.Data.IsPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+todayNum+"_"+in.UserId) >= 2000
-			resp.Data.IsOnTail = common.Int64All((*user)["i_vip_status"])
-			_endtime := (*user)["l_vip_endtime"]
+			resp.Data.IsOnTail = user.Vip.Status
+			_endtime := user.Vip.EndTime
 			//是否到期
 			if common.Int64All(_endtime)-time.Now().Unix() < threeRemind && common.Int64All(_endtime)-time.Now().Unix() >= twoRemind {
 				resp.Data.IsExpire = 3 //即将到期
@@ -85,22 +102,20 @@ func (l *GetSubSomeInfoLogic) GetSubSomeInfo(in *bxsubscribe.SomeInfoReq) (*bxsu
 				resp.Data.OtherFlag = true
 			}
 		} else {
-			if (*user)["i_vip_status"] == nil {
+			if user.Vip.Status <= 0 {
 				resp.Data.IsExpire = 0
 			} else {
-				resp.Data.IsOnTail = common.Int64All((*user)["i_vip_status"])
+				resp.Data.IsOnTail = user.Vip.Status
 			}
 			resp.Data.IsPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+todayNum+"_"+in.UserId) >= 150
 		}
 		//是否进入向导查询
 		resp.Data.IsInTSguide = func() bool {
 			//付费用户无免费订阅,不进入订阅向导页面
-			if common.IntAll((*user)["i_member_status"]) > 0 || common.IntAll((*user)["i_vip_status"]) > 0 {
+			if user.Member.Status > 0 || user.Vip.Status > 0 {
 				return false
 			}
-			o_jy, _ := (*user)["o_jy"].(map[string]interface{})
-			iTsGuide := common.IntAll((*user)["i_ts_guide"])
-			if iTsGuide == 2 || (iTsGuide == 0 && len(o_jy) == 0) {
+			if !user.Vip.HasKey {
 				return true
 			}
 			return false

+ 1 - 1
jyBXSubscribe/rpc/internal/server/bxsubscribeserver.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: bxsubscribe.proto
 
 package server

+ 8 - 11
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.27.1
-// 	protoc        v3.19.4
+// 	protoc-gen-go v1.28.1
+// 	protoc        v3.15.1
 // source: bxsubscribe.proto
 
 package bxsubscribe
@@ -745,7 +745,6 @@ func (x *SubscribeInfo) GetSourceAll() string {
 	return ""
 }
 
-//
 type WinnerInfo struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -817,7 +816,6 @@ func (x *WinnerInfo) GetWinnerId() string {
 	return ""
 }
 
-//
 type SomeInfoReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1095,7 +1093,6 @@ func (x *SomeInfo) GetUserId() string {
 	return ""
 }
 
-//
 type StatusResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1285,7 +1282,7 @@ func (x *UpdateSubScribeInfoReq) GetPositionType() int64 {
 	return 0
 }
 
-//城市
+// 城市
 type CityList struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1333,7 +1330,7 @@ func (x *CityList) GetCity() []string {
 	return nil
 }
 
-//分类
+// 分类
 type Items struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1397,7 +1394,7 @@ func (x *Items) GetAKey() []*Keys {
 	return nil
 }
 
-//关键词
+// 关键词
 type Keys struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1540,7 +1537,7 @@ func (x *KeyItems) GetAKey() []*Key {
 	return nil
 }
 
-//关键词
+// 关键词
 type Key struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -2150,7 +2147,7 @@ func (x *List) GetValue() []string {
 	return nil
 }
 
-//订阅设置
+// 订阅设置
 type Subscribe struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -2333,7 +2330,7 @@ func (x *UserReq) GetEntId() int64 {
 	return 0
 }
 
-//用户权益
+// 用户权益
 type UserResq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache

+ 1 - 1
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.19.4
+// - protoc             v3.15.1
 // source: bxsubscribe.proto
 
 package bxsubscribe

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است