Procházet zdrojové kódy

wip:订阅列表提示信息调整

wangshan před 8 měsíci
rodič
revize
bd4118d579

+ 1 - 0
jyBXSubscribe/rpc/bxsubscribe.proto

@@ -49,6 +49,7 @@ message subscribeData{
   bool hasNextPage = 2;
   repeated subscribeInfo list = 3;
   string isRecommend = 4;
+  string subListTip = 5;//订阅列表顶部提示信息
 }
 
 message subscribeInfo {

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

@@ -21,4 +21,5 @@ EntManageApplication: "entmanageapplication.rpc" #企业管理中台
 AppUrl: "/front/downloadJyApp/qr?page=%&source=%s"
 Nsq: 192.168.3.240:4260
 NsqTopic: jy_event
-Registedate: 1705556502
+Registedate: 1705556502
+SubListTip: 为您预加载最近15天发布的%s商机

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

@@ -22,6 +22,7 @@ type Config struct {
 	Nsq                  string
 	NsqTopic             string
 	Registedate          int64
+	SubListTip           string
 }
 
 type Db struct {

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

@@ -123,6 +123,7 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 	 *免费用户默认推送50条
 	 *大会员、新版商机管理、超级订阅用户 默认推送1000条记录
 	 */
+	var tip string
 	isRecommend := "1" //1:老数据 2:历史(clickhouse) 3:新数据
 	if in.PageNum == 1 && spqp.IsEmpty() && (len(list) == 0 || (in.PositionType == 0 && spqp.SubPushInactive == -1)) && in.IsEnt == false {
 		hasNextPage, total, list = model.NewSubscribePush(in.UserType).DefaultDatas(spqp, bsp, in.UserType)
@@ -136,6 +137,10 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 				hasNextPage, total, list = model.NewSubscribePush(in.UserType).GetRecListByEs()
 			}
 		}
+		//P618 增加预加载数据提示:为您预加载最近15天发布的【X】商机
+		if tipBool := len(list) == bsp.Size; tipBool && len(list) > 0 {
+			tip = fmt.Sprintf(IC.C.SubListTip, fmt.Sprintf("%d条", bsp.Size))
+		}
 	}
 
 	start2 := time.Now().Unix()
@@ -151,6 +156,7 @@ func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubs
 			Count:       total,
 			HasNextPage: hasNextPage,
 			IsRecommend: isRecommend,
+			SubListTip:  tip,
 		},
 	}, nil
 }

+ 1 - 1
jyBXSubscribe/rpc/internal/logic/updatesubscribeinfologic.go

@@ -49,7 +49,7 @@ func (l *UpdateSubScribeInfoLogic) UpdateSubScribeInfo(inc *bxsubscribe.UpdateSu
 	status, err := subService.Update()
 	//P618:移动端,招标采购搜索列表页 根据搜索关键词和地区信息 完成订阅
 	if subService.Area != nil && len(subService.Items) > 0 {
-
+		go subService.UpdateGuide()
 	}
 	if err != nil || status == 0 {
 		l.Error(fmt.Sprintf("%+v", in), err.Error())

+ 7 - 2
jyBXSubscribe/rpc/model/push.go

@@ -392,6 +392,9 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam, bsp *ViewCondition) (hasN
 		if err != nil || subPush == nil || subPush.Date != nowFormat || len(subPush.Datas) == 0 {
 			list, countSearch := s.getDatasFromMysql(spqp, starttime, endtime, spqp.PageSize, false,
 				common.If(strings.Contains(strings.Join(bsp.SelectType, ","), "detail"), true, false).(bool))
+			if len(list) == 0 {
+				return
+			}
 			subPush = &SubPush{
 				Date:  nowFormat,
 				Datas: list,
@@ -438,7 +441,9 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam, bsp *ViewCondition) (hasN
 			} else {
 				spqp.PageNum = 1
 				list, countSearch = s.getDatasFromMysql(spqp, starttime, endtime, AllSubPushCacheSize, true, common.If(strings.Contains(strings.Join(bsp.SelectType, ","), "detail"), true, false).(bool))
-
+			}
+			if len(list) == 0 {
+				return
 			}
 			allCache = &SubPush{
 				Date:  nowFormat,
@@ -1317,7 +1322,7 @@ const (
 )
 
 // 首次访问推送页面 默认生成推送数据
-// 默认匹配es 7天内数据
+// 默认匹配es 15天内数据
 func (s *subscribePush) DefaultDatas(spqp *SubPushQueryParam, bsp *ViewCondition, userType string) (hasNextPage bool, total int64, result []*bxsubscribe.SubscribeInfo) {
 	if spqp.UserId == "" {
 		return false, 0, nil

+ 7 - 2
jyBXSubscribe/rpc/model/service/subscribe.go

@@ -11,6 +11,7 @@ import (
 	"fmt"
 	"github.com/gogf/gf/v2/util/gconv"
 	"github.com/zeromicro/go-zero/core/logx"
+	"log"
 	"strconv"
 	"strings"
 	"time"
@@ -187,7 +188,11 @@ func GetKeyWordLen(a_items []map[string]interface{}) (count int) {
 }
 
 // 更新订阅向导标识
-func (this *SubseribeService) UpdateGuide() {
-	if this.UserId != "" {
+func (s *SubseribeService) UpdateGuide() {
+	if s.UserId != "" {
+		ok := IC.Compatible.Update(s.UserId, map[string]interface{}{"$set": map[string]interface{}{"i_ts_guide": 1}})
+		if !ok {
+			log.Println("update guide false", s.UserId)
+		}
 	}
 }

+ 12 - 2
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go

@@ -389,6 +389,7 @@ type SubscribeData struct {
 	HasNextPage bool             `protobuf:"varint,2,opt,name=hasNextPage,proto3" json:"hasNextPage,omitempty"`
 	List        []*SubscribeInfo `protobuf:"bytes,3,rep,name=list,proto3" json:"list,omitempty"`
 	IsRecommend string           `protobuf:"bytes,4,opt,name=isRecommend,proto3" json:"isRecommend,omitempty"`
+	SubListTip  string           `protobuf:"bytes,5,opt,name=subListTip,proto3" json:"subListTip,omitempty"` //订阅列表顶部提示信息
 }
 
 func (x *SubscribeData) Reset() {
@@ -451,6 +452,13 @@ func (x *SubscribeData) GetIsRecommend() string {
 	return ""
 }
 
+func (x *SubscribeData) GetSubListTip() string {
+	if x != nil {
+		return x.SubListTip
+	}
+	return ""
+}
+
 type SubscribeInfo struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -4261,7 +4269,7 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x73, 0x67, 0x12, 0x2e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
 	0x32, 0x1a, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x73,
 	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61,
-	0x74, 0x61, 0x22, 0x99, 0x01, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
+	0x74, 0x61, 0x22, 0xb9, 0x01, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
 	0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20,
 	0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x68, 0x61,
 	0x73, 0x4e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
@@ -4270,7 +4278,9 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
 	0x62, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b,
 	0x69, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x0b, 0x69, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x22, 0xfe,
+	0x09, 0x52, 0x0b, 0x69, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x12, 0x1e,
+	0x0a, 0x0a, 0x73, 0x75, 0x62, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x69, 0x70, 0x22, 0xfe,
 	0x08, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66, 0x6f,
 	0x12, 0x0f, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49,
 	0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,