فهرست منبع

Merge remote-tracking branch 'origin/feature/v1.1.30' into 1.1.30_ws

# Conflicts:
#	jyBXBase/rpc/internal/logic/newestbiddinglogic.go
wangshan 1 سال پیش
والد
کامیت
ce1a29ebaa

+ 4 - 0
jyBXBase/api/internal/logic/newestBiddingLogic.go

@@ -6,7 +6,9 @@ import (
 	"jyBXBase/api/internal/svc"
 	"jyBXBase/api/internal/types"
 	"jyBXBase/rpc/bxbase"
+	"log"
 	"net/http"
+	"time"
 
 	"github.com/zeromicro/go-zero/core/logx"
 )
@@ -28,6 +30,7 @@ func NewNewestBiddingLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *h
 }
 
 func (l *NewestBiddingLogic) NewestBidding(req *types.NewestReq) (resp *types.CommonRes, err error) {
+	t := time.Now()
 	res, err0 := l.svcCtx.Bxbase.NewestBidding(l.ctx, &bxbase.NewestBiddingReq{
 		City:         req.City,
 		IsSearch:     req.IsSearch,
@@ -43,6 +46,7 @@ func (l *NewestBiddingLogic) NewestBidding(req *types.NewestReq) (resp *types.Co
 		EntAccountId: req.EntAccountId,
 		Phone:        req.Phone,
 	})
+	log.Println(req.PositionId, "----", req.Phone, "-查询耗时:-", time.Since(t).Seconds())
 	if err0 != nil {
 		return &types.CommonRes{
 			Err_code: -1,

+ 1 - 1
jyBXBase/rpc/etc/bxbase.yaml

@@ -2,7 +2,7 @@ Name: bxbase.rpc
 ListenOn: 127.0.0.1:8005
 Etcd:
   Hosts:
-  - 192.168.3.206:2379
+  - 127.0.0.1:2379
   Key: bxbase.rpc
 UserCenterKey: "usercenter.rpc" #用户中台rpc
 PowerCheckCenterKey: "powercheck.rpc" #权益校验中台

+ 3 - 3
jyBXBase/rpc/internal/logic/newestbiddinglogic.go

@@ -80,7 +80,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 			//  查推送
 			subscribeTime := time.Now()
 			list = roleNewestInfo.GetPushHistory()
-			log.Println("获取订阅数据耗时:", time.Since(subscribeTime).Seconds())
+			log.Println(in.PositionId, "---获取订阅数据耗时:", time.Since(subscribeTime).Seconds())
 			if list != nil && len(list) > 0 {
 				res.Data.List = list
 				res.Data.Count = int64(len(list))
@@ -101,7 +101,7 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 		}
 		esTime := time.Now()
 		list = model.NewestES(query)
-		log.Println("获取es数据耗时:", time.Since(esTime).Seconds())
+		log.Println(in.PositionId, "---获取es数据耗时:", time.Since(esTime).Seconds())
 		res.Data.List = list
 		res.Data.Count = int64(len(list))
 		return res, &model.NewSet{Status: model.StatusLogin, RedisKeyModel: redisKeyModel, RedisStatus: model.StatusLogin, Query: query}
@@ -115,6 +115,6 @@ func (l *NewestBiddingLogic) NewestBidding(in *bxbase.NewestBiddingReq) (*bxbase
 		go model.ExtendNewListCache(n, in, r.Data.List)
 	}
 	model.MakeCollection(in.UserId, r.Data.List)
-	log.Println("接口耗时:", time.Since(t).Seconds())
+	log.Println(in.PositionId, "--接口耗时:", time.Since(t).Seconds())
 	return r, nil
 }

+ 18 - 0
jyBXSubscribe/rpc/internal/logic/getsubsomeinfologic.go

@@ -28,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{
@@ -56,6 +63,17 @@ func (l *GetSubSomeInfoLogic) GetSubSomeInfo(in *bxsubscribe.SomeInfoReq) (*bxsu
 	//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 user.Vip.Status == 1 || common.IntAll(user.Vip.Status) == 2 {
 			var threeRemind = int64(3 * 24 * 60 * 60)