瀏覽代碼

订阅查询接口新增

WH01243 2 年之前
父節點
當前提交
7fd70f4252

+ 83 - 1
jyBXSubscribe/go.mod

@@ -1,6 +1,6 @@
 module jyBXSubscribe
 
-go 1.16
+go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20220617085837-48c1bf245c2f
@@ -12,3 +12,85 @@ require (
 	google.golang.org/grpc v1.48.0
 	google.golang.org/protobuf v1.28.1
 )
+
+require (
+	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
+	github.com/beorn7/perks v1.0.1 // indirect
+	github.com/cespare/xxhash/v2 v2.1.2 // indirect
+	github.com/coreos/go-semver v0.3.0 // indirect
+	github.com/coreos/go-systemd/v22 v22.3.2 // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f // indirect
+	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
+	github.com/fatih/color v1.13.0 // indirect
+	github.com/garyburd/redigo v1.6.2 // indirect
+	github.com/go-logr/logr v1.2.3 // indirect
+	github.com/go-logr/stdr v1.2.2 // indirect
+	github.com/go-redis/redis/v8 v8.11.5 // indirect
+	github.com/gogo/protobuf v1.3.2 // indirect
+	github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
+	github.com/golang/mock v1.6.0 // indirect
+	github.com/golang/protobuf v1.5.2 // indirect
+	github.com/golang/snappy v0.0.4 // indirect
+	github.com/google/go-cmp v0.5.8 // indirect
+	github.com/google/gofuzz v1.2.0 // indirect
+	github.com/google/uuid v1.3.0 // indirect
+	github.com/googleapis/gnostic v0.5.5 // indirect
+	github.com/jinzhu/inflection v1.0.0 // indirect
+	github.com/jinzhu/now v1.1.1 // indirect
+	github.com/json-iterator/go v1.1.12 // indirect
+	github.com/klauspost/compress v1.13.6 // indirect
+	github.com/mattn/go-colorable v0.1.13 // indirect
+	github.com/mattn/go-isatty v0.0.16 // indirect
+	github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+	github.com/modern-go/reflect2 v1.0.2 // indirect
+	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
+	github.com/olivere/elastic v6.2.37+incompatible // indirect
+	github.com/openzipkin/zipkin-go v0.4.0 // indirect
+	github.com/pelletier/go-toml/v2 v2.0.2 // indirect
+	github.com/pkg/errors v0.9.1 // indirect
+	github.com/prometheus/client_golang v1.12.2 // indirect
+	github.com/prometheus/client_model v0.2.0 // indirect
+	github.com/prometheus/common v0.32.1 // indirect
+	github.com/prometheus/procfs v0.7.3 // indirect
+	github.com/spaolacci/murmur3 v1.1.0 // indirect
+	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
+	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.4 // indirect
+	go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect
+	go.etcd.io/etcd/client/v3 v3.5.4 // indirect
+	go.opentelemetry.io/otel v1.9.0 // indirect
+	go.opentelemetry.io/otel/exporters/jaeger v1.9.0 // indirect
+	go.opentelemetry.io/otel/exporters/zipkin v1.9.0 // indirect
+	go.opentelemetry.io/otel/sdk v1.9.0 // indirect
+	go.opentelemetry.io/otel/trace v1.9.0 // indirect
+	go.uber.org/atomic v1.9.0 // indirect
+	go.uber.org/automaxprocs v1.5.1 // indirect
+	go.uber.org/multierr v1.8.0 // indirect
+	go.uber.org/zap v1.21.0 // indirect
+	golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
+	golang.org/x/net v0.0.0-20220531201128-c960675eff93 // indirect
+	golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
+	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
+	golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect
+	golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
+	golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2 // indirect
+	golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
+	google.golang.org/appengine v1.6.7 // indirect
+	google.golang.org/genproto v0.0.0-20220602131408-e326c6e8e9c8 // indirect
+	gopkg.in/inf.v0 v0.9.1 // indirect
+	gopkg.in/yaml.v2 v2.4.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+	gorm.io/driver/mysql v1.0.5 // indirect
+	gorm.io/gorm v1.21.3 // indirect
+	k8s.io/api v0.22.9 // indirect
+	k8s.io/apimachinery v0.22.9 // indirect
+	k8s.io/client-go v0.22.9 // indirect
+	k8s.io/klog/v2 v2.40.1 // indirect
+	k8s.io/utils v0.0.0-20220706174534-f6158b442e7c // indirect
+	sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
+	sigs.k8s.io/yaml v1.2.0 // indirect
+)

+ 0 - 1
jyBXSubscribe/go.sum

@@ -472,7 +472,6 @@ github.com/openzipkin/zipkin-go v0.4.0 h1:CtfRrOVZtbDj8rt1WXjklw0kqqJQwICrCKmlfU
 github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ=
 github.com/paulmach/orb v0.7.1/go.mod h1:FWRlTgl88VI1RBx/MkrwWDRhQ96ctqMCh8boXhmqB/A=
 github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY=
-github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI=
 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
 github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw=
 github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI=

+ 29 - 2
jyBXSubscribe/rpc/bxsubscribe.proto

@@ -180,8 +180,33 @@ message KeyResp {
   string err_msg = 2;
   repeated KeyItems items = 3;//关键词
 }
-
-
+message List{
+  repeated string value = 1;
+}
+//订阅设置
+message Subscribe{
+  map<string, List> area = 1;//地区
+  repeated string buyerclass = 2;//采购单位类型
+  repeated string infotype = 3;//信息类型
+  repeated Items items = 4;//关键词
+  int64 matchway = 5;//匹配方式 1标题 2正文
+  int64 projectmatch = 6;//项目匹配
+  bool  keytip = 7;
+}
+message UserReq{
+  string appId = 1;
+  int64 entUserId = 2;
+  string types = 3;//类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
+  int64 positionType = 4;//职位类型 0个人 1企业
+  string userId = 5;
+  int64 entId = 6;
+}
+//用户权益
+message UserResq{
+  Subscribe data = 1;
+  string error_msg = 2;
+  int64 error_code = 3;
+}
 
 service Bxsubscribe {
   //获取订阅推送列表
@@ -196,4 +221,6 @@ service Bxsubscribe {
   rpc SetRead(SetReadReq)returns(StatusResp);
   //关键词获取
   rpc GetKey(GetKeyReq)returns(KeyResp);
+  //订阅设置获取
+  rpc GetSubScribeInfo(UserReq)returns(UserResq);
 }

+ 14 - 2
jyBXSubscribe/rpc/bxsubscribe/bxsubscribe.go

@@ -1,7 +1,7 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: bxsubscribe.proto
 
-package bxsubscribe
+package bxsubscribeclient
 
 import (
 	"context"
@@ -21,16 +21,20 @@ type (
 	KeyItems               = bxsubscribe.KeyItems
 	KeyResp                = bxsubscribe.KeyResp
 	Keys                   = bxsubscribe.Keys
+	List                   = bxsubscribe.List
 	SetReadReq             = bxsubscribe.SetReadReq
 	SomeInfo               = bxsubscribe.SomeInfo
 	SomeInfoReq            = bxsubscribe.SomeInfoReq
 	SomeInfoResp           = bxsubscribe.SomeInfoResp
 	StatusResp             = bxsubscribe.StatusResp
+	Subscribe              = bxsubscribe.Subscribe
 	SubscribeData          = bxsubscribe.SubscribeData
 	SubscribeInfo          = bxsubscribe.SubscribeInfo
 	SubscribeInfosReq      = bxsubscribe.SubscribeInfosReq
 	SubscribeInfosResp     = bxsubscribe.SubscribeInfosResp
 	UpdateSubScribeInfoReq = bxsubscribe.UpdateSubScribeInfoReq
+	UserReq                = bxsubscribe.UserReq
+	UserResq               = bxsubscribe.UserResq
 
 	Bxsubscribe interface {
 		// 获取订阅推送列表
@@ -45,6 +49,8 @@ type (
 		SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
 		// 关键词获取
 		GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
+		// 订阅设置获取
+		GetSubScribeInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResq, error)
 	}
 
 	defaultBxsubscribe struct {
@@ -93,3 +99,9 @@ func (m *defaultBxsubscribe) GetKey(ctx context.Context, in *GetKeyReq, opts ...
 	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
 	return client.GetKey(ctx, in, opts...)
 }
+
+// 订阅设置获取
+func (m *defaultBxsubscribe) GetSubScribeInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResq, error) {
+	client := bxsubscribe.NewBxsubscribeClient(m.cli.Conn())
+	return client.GetSubScribeInfo(ctx, in, opts...)
+}

+ 5 - 5
jyBXSubscribe/rpc/internal/logic/getkeylogic_test.go

@@ -30,15 +30,15 @@ func TestGetKeyLogic_GetKey(t *testing.T) {
 			name: "超级订阅获取",
 			args: args{
 				in: &bxsubscribe.GetKeyReq{
-					UserType:    "eType",
-					UserId:      "63537f6928a125cdb8a36071",
+					UserType:    "mType",
+					UserId:      "5e8eb60ae138234b4f91aacf",
 					EntId:       "14640",
 					AppId:       "10000",
 					EntUserId:   "4962",
 					NewUserId:   185483,
-					UserPower:   1,
-					MemberPower: 1,
-					IsEnt:       true,
+					UserPower:   0,
+					MemberPower: 0,
+					IsEnt:       false,
 				},
 			},
 		},

+ 9 - 9
jyBXSubscribe/rpc/internal/logic/getsublistlogic_test.go

@@ -123,23 +123,23 @@ func TestGetSubListLogic_GetSubList(t *testing.T) {
 				in: &bxsubscribe.SubscribeInfosReq{
 					PageNum:    1,
 					PageSize:   50,
-					SelectTime: "",
+					SelectTime: "all",
 					Area:       "",
 					City:       "",
 					BuyerClass: "",
-					Subtype:    "",
+					Subtype:    "合同",
 					KeyWords:   "",
 					Industry:   "",
-					UserType:   "fType",
-					UserId:     "5fd1bc2447da52d4c953f10a",
-					EntId:      "0",
+					UserType:   "vType",
+					UserId:     "638af5cbb5b8a4e7edf5c8dc",
+					EntId:      "15186",
 					AppId:      "10000",
 					Price:      "",
 					FileExists: "",
-					EntUserId:  "0",
-					DeptId:     "1111",
-					NewUserId:  69146,
-					IsEnt: false,
+					EntUserId:  "4852",
+					DeptId:     "",
+					NewUserId:  335887,
+					IsEnt:      false,
 				},
 			},
 			want:    nil,

+ 7 - 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
@@ -57,3 +57,9 @@ func (s *BxsubscribeServer) GetKey(ctx context.Context, in *bxsubscribe.GetKeyRe
 	l := logic.NewGetKeyLogic(ctx, s.svcCtx)
 	return l.GetKey(in)
 }
+
+// 订阅设置获取
+func (s *BxsubscribeServer) GetSubScribeInfo(ctx context.Context, in *bxsubscribe.UserReq) (*bxsubscribe.UserResq, error) {
+	l := logic.NewGetSubScribeInfoLogic(ctx, s.svcCtx)
+	return l.GetSubScribeInfo(in)
+}

+ 196 - 24
jyBXSubscribe/rpc/model/push.go

@@ -1,9 +1,19 @@
 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"
 	"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"
@@ -12,17 +22,6 @@ import (
 	"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 (
@@ -364,6 +363,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 		findSql = "select a.id,a.date,a.infoid,a.isvisit,a.matchkeys,a.type,b.isvalidfile as attachment_count"
 	} else {
 		if spqp.IsEnt {
+
 			isNew := 0
 			if spqp.UserType == EntnicheFlag {
 				//商机管理判断
@@ -379,6 +379,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 			} else {
 				userStr = fmt.Sprintf("   a.entid='%s' ", spqp.EntId)
 			}
+
 		} else {
 			if spqp.BuySubject == 1 {
 				//企业主体是企业的个人查询
@@ -1381,15 +1382,29 @@ func (s *subscribePush) IsInTsGuide(userid string) bool {
 func (s *subscribePush) Keys(spqp *KeyParam) (result []*bxsubscribe.KeyItems) {
 	keyData := map[string][]interface{}{}
 	if !spqp.IsEnt {
+		query := map[string]interface{}{
+			"i_userid": spqp.EntUserId,
+			"i_entid":  spqp.EntId,
+		}
 		//个人关键词查找
 		//fType:普通用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户
 		mData, ok := IC.Mgo.FindById("user", spqp.UserId, `{"o_jy":1,"o_vipjy":1,"o_member_jy":1,""i_member_sub_status":1,"s_member_mainid":1}`)
 		if s.ModuleFlag == SubVipFlag {
-			//从user表中取 o_vipjy.a_items
-			if mData == nil || len(*mData) == 0 || !ok {
-				return nil
+			o_vipjy := &map[string]interface{}{}
+			if spqp.VipPower == 1 {
+				query["i_type"] = 1
+				mData, ok := IC.Mgo.FindOne("entniche_rule", query)
+				if mData == nil || len(*mData) == 0 || !ok {
+					return nil
+				}
+				o_vipjy = common.ObjToMap((*mData)["o_entniche"])
+			} else {
+				//从user表中取 o_vipjy.a_items
+				if mData == nil || len(*mData) == 0 || !ok {
+					return nil
+				}
+				o_vipjy = common.ObjToMap((*mData)["o_vipjy"])
 			}
-			o_vipjy := common.ObjToMap((*mData)["o_vipjy"])
 			if (*o_vipjy)["a_items"] != nil {
 				a_items := common.ObjArrToMapArr((*o_vipjy)["a_items"].([]interface{}))
 				for _, v := range a_items {
@@ -1399,20 +1414,32 @@ func (s *subscribePush) Keys(spqp *KeyParam) (result []*bxsubscribe.KeyItems) {
 					}
 				}
 			}
+
 		} else if s.ModuleFlag == MemberFlag {
-			//从user表中取 o_member_jy.a_items
-			if mData == nil || len(*mData) == 0 || !ok {
-				return nil
-			}
-			sub_status := common.Int64All((*mData)["i_member_sub_status"])
-			if sub_status == 1 {
-				//大会员子账号处理
-				mData, ok = IC.Mgo.FindById("user", common.InterfaceToStr((*mData)["s_member_mainid"]), `{"o_jy":1,"o_vipjy":1,"o_member_jy":1,""i_member_sub_status":1,"s_member_mainid":1}`)
+			o_memeberjy := &map[string]interface{}{}
+			if spqp.MemberPower == 1 {
+				query["i_type"] = 1
+				mData, ok := IC.Mgo.FindOne("entniche_rule", query)
+				if mData == nil || len(*mData) == 0 || !ok {
+					return nil
+				}
+				o_memeberjy = common.ObjToMap((*mData)["o_entniche"])
+			} else {
+				//从user表中取 o_member_jy.a_items
 				if mData == nil || len(*mData) == 0 || !ok {
 					return nil
 				}
+				sub_status := common.Int64All((*mData)["i_member_sub_status"])
+				if sub_status == 1 {
+					//大会员子账号处理
+					mData, ok = IC.Mgo.FindById("user", common.InterfaceToStr((*mData)["s_member_mainid"]), `{"o_jy":1,"o_vipjy":1,"o_member_jy":1,""i_member_sub_status":1,"s_member_mainid":1}`)
+					if mData == nil || len(*mData) == 0 || !ok {
+						return nil
+					}
+				}
+				o_memeberjy = common.ObjToMap((*mData)["o_member_jy"])
 			}
-			o_memeberjy := common.ObjToMap((*mData)["o_member_jy"])
+
 			if (*o_memeberjy)["a_items"] != nil {
 				a_items := common.ObjArrToMapArr((*o_memeberjy)["a_items"].([]interface{}))
 				for _, v := range a_items {
@@ -1677,3 +1704,148 @@ func MergeArray(dest []interface{}, src []interface{}) (result []interface{}) {
 	}
 	return
 }
+func (s *subscribePush) GetSubScribeInfo(in *bxsubscribe.UserReq) *map[string]interface{} {
+	data := &map[string]interface{}{}
+	if in.PositionType == 0 {
+		ok := false
+		query := map[string]interface{}{
+			"_id": mongodb.StringTOBsonId(in.UserId),
+		}
+		data, ok = IC.Mgo.FindOneByField("user", query, `{"i_vip_status":1,"l_vip_starttime":1,"l_vip_endtime":1,"i_member_status":1,"i_member_starttime":1,"i_member_endtime":1,"o_jy":1,"o_vipjy":1,"o_member_jy":1,"s_phone":1,"s_m_phone":1,"s_nickname":1,"s_jyname":1,"s_headimageurl":1,"s_headimage":1}`)
+		if !ok || data == nil || len(*data) <= 0 {
+			return nil
+		}
+	}
+	object := &map[string]interface{}{}
+	jyData := &map[string]interface{}{}
+	switch in.Types {
+	case MemberFlag:
+		//大会员
+		if in.PositionType == 0 {
+			//个人
+			if (*data)["o_member_jy"] != nil {
+				jyData = common.ObjToMap((*data)["o_member_jy"])
+			}
+		} else {
+			jyData = EntnicheSub(in.EntUserId, in.EntId, 1)
+		}
+
+	case EntnicheFlag:
+		//商机管理
+		jyData = EntnicheSub(in.EntUserId, in.EntId, 0)
+		log.Println("~~~", jyData)
+
+	case SubVipFlag:
+		//超级订阅
+		if in.PositionType == 0 {
+			if (*data)["o_vipjy"] != nil {
+				//个人
+				jyData = common.ObjToMap((*data)["o_vipjy"])
+			}
+		} else {
+			jyData = EntnicheSub(in.EntUserId, in.EntId, 1)
+		}
+
+	case SubFreeFlag:
+		if in.PositionType == 0 {
+			//个人
+			if (*data)["o_jy"] != nil {
+				ojy := common.ObjToMap((*data)["o_jy"])
+				if (*ojy)["a_key"] != nil {
+					akey := common.ObjArrToMapArr((*ojy)["a_key"].([]interface{}))
+					(*object)["a_items"] = []map[string]interface{}{ //转换至和其它结构一致
+						map[string]interface{}{
+							"a_key": akey,
+						},
+					}
+				}
+				if (*ojy)["o_area"] == nil {
+					(*object)["o_area"] = map[string]interface{}{}
+				} else {
+					(*object)["o_area"] = (*ojy)["o_area"]
+				}
+			}
+		} else {
+			jyData = EntnicheSub(in.EntUserId, in.EntId, 2)
+		}
+	}
+	if jyData != nil {
+		object = format(jyData)
+	}
+	return object
+}
+
+//商机管理订阅设置
+func EntnicheSub(entUserId, entId int64, types int64) *map[string]interface{} {
+	object := &map[string]interface{}{}
+	entnicheJy := &map[string]interface{}{}
+	res, _ := IC.Mgo.FindOne("entniche_rule", map[string]interface{}{
+		"i_userid": entUserId,
+		"i_entid":  entId,
+		"types":    types,
+	})
+	if types == 2 {
+		if (*res)["o_entniche"] != nil {
+			ojy := common.ObjToMap((*res)["o_jy"])
+			if (*ojy)["a_key"] != nil {
+				akey := common.ObjArrToMapArr((*ojy)["a_key"].([]interface{}))
+				(*object)["a_items"] = []map[string]interface{}{ //转换至和其它结构一致
+					map[string]interface{}{
+						"a_key": akey,
+					},
+				}
+			}
+			if (*ojy)["o_area"] == nil {
+				(*object)["o_area"] = map[string]interface{}{}
+			} else {
+				(*object)["o_area"] = (*ojy)["o_area"]
+			}
+		}
+	} else {
+		entnicheJy = common.ObjToMap((*res)["o_entniche"])
+	}
+	//获取商机管理的订阅设置
+	return entnicheJy
+}
+
+//格式化数据 大会员/超级订阅/商机管理 结构一致 关键词格式化
+func format(data *map[string]interface{}) *map[string]interface{} {
+	if data == nil {
+		return nil
+	}
+	//关键词
+	if (*data)["a_items"] != nil {
+		a_items := common.ObjArrToMapArr((*data)["a_items"].([]interface{}))
+		for k, v := range a_items {
+			if v["a_key"] != nil {
+				a_keys := []map[string]interface{}{}
+				ak, ok := v["a_key"].([]interface{})
+				if !ok {
+					a_keys, _ = v["a_key"].([]map[string]interface{})
+				} else {
+					a_keys = common.ObjArrToMapArr(ak)
+
+				}
+				for kk, vv := range a_keys {
+					if vv["key"] != nil {
+						keyArr, ok1 := vv["key"].([]interface{})
+						if ok1 {
+							if vv["appendkey"] != nil {
+								appendkeyArr, ok2 := vv["appendkey"].([]interface{})
+								if ok2 {
+									key := common.ObjArrToStringArr(keyArr)
+									appendkey := common.ObjArrToStringArr(appendkeyArr)
+									a_keys[kk]["key"] = append(key, appendkey...)
+								}
+							}
+						}
+					}
+					delete(a_keys[kk], "appendkey")
+				}
+				a_items[k]["a_key"] = a_keys
+			}
+		}
+		(*data)["a_items"] = a_items
+	}
+	return data
+}

+ 452 - 55
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.20.0--rc2
+// 	protoc-gen-go v1.28.1
+// 	protoc        v3.15.1
 // source: bxsubscribe.proto
 
 package bxsubscribe
@@ -1720,6 +1720,300 @@ func (x *KeyResp) GetItems() []*KeyItems {
 	return nil
 }
 
+type List struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
+}
+
+func (x *List) Reset() {
+	*x = List{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxsubscribe_proto_msgTypes[18]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *List) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*List) ProtoMessage() {}
+
+func (x *List) ProtoReflect() protoreflect.Message {
+	mi := &file_bxsubscribe_proto_msgTypes[18]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use List.ProtoReflect.Descriptor instead.
+func (*List) Descriptor() ([]byte, []int) {
+	return file_bxsubscribe_proto_rawDescGZIP(), []int{18}
+}
+
+func (x *List) GetValue() []string {
+	if x != nil {
+		return x.Value
+	}
+	return nil
+}
+
+//订阅设置
+type Subscribe struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Area         map[string]*List `protobuf:"bytes,1,rep,name=area,proto3" json:"area,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //地区
+	Buyerclass   []string         `protobuf:"bytes,2,rep,name=buyerclass,proto3" json:"buyerclass,omitempty"`                                                                             //采购单位类型
+	Infotype     []string         `protobuf:"bytes,3,rep,name=infotype,proto3" json:"infotype,omitempty"`                                                                                 //信息类型
+	Items        []*Items         `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"`                                                                                       //关键词
+	Matchway     int64            `protobuf:"varint,5,opt,name=matchway,proto3" json:"matchway,omitempty"`                                                                                //匹配方式 1标题 2正文
+	Projectmatch int64            `protobuf:"varint,6,opt,name=projectmatch,proto3" json:"projectmatch,omitempty"`                                                                        //项目匹配
+	Keytip       bool             `protobuf:"varint,7,opt,name=keytip,proto3" json:"keytip,omitempty"`
+}
+
+func (x *Subscribe) Reset() {
+	*x = Subscribe{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxsubscribe_proto_msgTypes[19]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Subscribe) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Subscribe) ProtoMessage() {}
+
+func (x *Subscribe) ProtoReflect() protoreflect.Message {
+	mi := &file_bxsubscribe_proto_msgTypes[19]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Subscribe.ProtoReflect.Descriptor instead.
+func (*Subscribe) Descriptor() ([]byte, []int) {
+	return file_bxsubscribe_proto_rawDescGZIP(), []int{19}
+}
+
+func (x *Subscribe) GetArea() map[string]*List {
+	if x != nil {
+		return x.Area
+	}
+	return nil
+}
+
+func (x *Subscribe) GetBuyerclass() []string {
+	if x != nil {
+		return x.Buyerclass
+	}
+	return nil
+}
+
+func (x *Subscribe) GetInfotype() []string {
+	if x != nil {
+		return x.Infotype
+	}
+	return nil
+}
+
+func (x *Subscribe) GetItems() []*Items {
+	if x != nil {
+		return x.Items
+	}
+	return nil
+}
+
+func (x *Subscribe) GetMatchway() int64 {
+	if x != nil {
+		return x.Matchway
+	}
+	return 0
+}
+
+func (x *Subscribe) GetProjectmatch() int64 {
+	if x != nil {
+		return x.Projectmatch
+	}
+	return 0
+}
+
+func (x *Subscribe) GetKeytip() bool {
+	if x != nil {
+		return x.Keytip
+	}
+	return false
+}
+
+type UserReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	AppId        string `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
+	EntUserId    int64  `protobuf:"varint,2,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
+	Types        string `protobuf:"bytes,3,opt,name=types,proto3" json:"types,omitempty"`                //类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
+	PositionType int64  `protobuf:"varint,4,opt,name=positionType,proto3" json:"positionType,omitempty"` //职位类型 0个人 1企业
+	UserId       string `protobuf:"bytes,5,opt,name=userId,proto3" json:"userId,omitempty"`
+	EntId        int64  `protobuf:"varint,6,opt,name=entId,proto3" json:"entId,omitempty"`
+}
+
+func (x *UserReq) Reset() {
+	*x = UserReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxsubscribe_proto_msgTypes[20]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *UserReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UserReq) ProtoMessage() {}
+
+func (x *UserReq) ProtoReflect() protoreflect.Message {
+	mi := &file_bxsubscribe_proto_msgTypes[20]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use UserReq.ProtoReflect.Descriptor instead.
+func (*UserReq) Descriptor() ([]byte, []int) {
+	return file_bxsubscribe_proto_rawDescGZIP(), []int{20}
+}
+
+func (x *UserReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *UserReq) GetEntUserId() int64 {
+	if x != nil {
+		return x.EntUserId
+	}
+	return 0
+}
+
+func (x *UserReq) GetTypes() string {
+	if x != nil {
+		return x.Types
+	}
+	return ""
+}
+
+func (x *UserReq) GetPositionType() int64 {
+	if x != nil {
+		return x.PositionType
+	}
+	return 0
+}
+
+func (x *UserReq) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
+func (x *UserReq) GetEntId() int64 {
+	if x != nil {
+		return x.EntId
+	}
+	return 0
+}
+
+//用户权益
+type UserResq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Data      *Subscribe `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
+	ErrorMsg  string     `protobuf:"bytes,2,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
+	ErrorCode int64      `protobuf:"varint,3,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
+}
+
+func (x *UserResq) Reset() {
+	*x = UserResq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_bxsubscribe_proto_msgTypes[21]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *UserResq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UserResq) ProtoMessage() {}
+
+func (x *UserResq) ProtoReflect() protoreflect.Message {
+	mi := &file_bxsubscribe_proto_msgTypes[21]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use UserResq.ProtoReflect.Descriptor instead.
+func (*UserResq) Descriptor() ([]byte, []int) {
+	return file_bxsubscribe_proto_rawDescGZIP(), []int{21}
+}
+
+func (x *UserResq) GetData() *Subscribe {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
+func (x *UserResq) GetErrorMsg() string {
+	if x != nil {
+		return x.ErrorMsg
+	}
+	return ""
+}
+
+func (x *UserResq) GetErrorCode() int64 {
+	if x != nil {
+		return x.ErrorCode
+	}
+	return 0
+}
+
 var File_bxsubscribe_proto protoreflect.FileDescriptor
 
 var file_bxsubscribe_proto_rawDesc = []byte{
@@ -1965,37 +2259,81 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74,
 	0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x78, 0x73, 0x75,
 	0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x73,
-	0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x32, 0xbe, 0x03, 0x0a, 0x0b, 0x42, 0x78, 0x73, 0x75,
-	0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x75,
-	0x62, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72,
-	0x69, 0x62, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66,
-	0x6f, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72,
-	0x69, 0x62, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66,
-	0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62,
-	0x53, 0x6f, 0x6d, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62,
-	0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x6f, 0x6d, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52,
-	0x65, 0x71, 0x1a, 0x19, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
-	0x2e, 0x53, 0x6f, 0x6d, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x53, 0x0a,
-	0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x53, 0x63, 0x72, 0x69, 0x62, 0x65,
-	0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
-	0x62, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x53, 0x63, 0x72, 0x69,
-	0x62, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x62, 0x78, 0x73, 0x75,
-	0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x4f, 0x0a, 0x0d, 0x42, 0x79, 0x50, 0x75, 0x73, 0x68, 0x48, 0x69, 0x73, 0x74,
-	0x6f, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
-	0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73,
-	0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
-	0x65, 0x2e, 0x42, 0x79, 0x50, 0x75, 0x73, 0x68, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52,
-	0x65, 0x73, 0x70, 0x12, 0x3b, 0x0a, 0x07, 0x53, 0x65, 0x74, 0x52, 0x65, 0x61, 0x64, 0x12, 0x17,
-	0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x65, 0x74,
-	0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73,
-	0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x2e, 0x62, 0x78, 0x73,
-	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52,
-	0x65, 0x71, 0x1a, 0x14, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
-	0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x62, 0x78,
-	0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
-	0x33,
+	0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x1c, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12,
+	0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05,
+	0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xcb, 0x02, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
+	0x69, 0x62, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28,
+	0x0b, 0x32, 0x20, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e,
+	0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x41, 0x72, 0x65, 0x61, 0x45, 0x6e,
+	0x74, 0x72, 0x79, 0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x79,
+	0x65, 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x62,
+	0x75, 0x79, 0x65, 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x66,
+	0x6f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x66,
+	0x6f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04,
+	0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
+	0x62, 0x65, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12,
+	0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x77, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x77, 0x61, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x70,
+	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12,
+	0x16, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x69, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52,
+	0x06, 0x6b, 0x65, 0x79, 0x74, 0x69, 0x70, 0x1a, 0x4a, 0x0a, 0x09, 0x41, 0x72, 0x65, 0x61, 0x45,
+	0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72,
+	0x69, 0x62, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
+	0x02, 0x38, 0x01, 0x22, 0xa5, 0x01, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12,
+	0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
+	0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72,
+	0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65,
+	0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x6f, 0x73,
+	0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0c, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
+	0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75,
+	0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x06,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x72, 0x0a, 0x08, 0x55,
+	0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x71, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72,
+	0x69, 0x62, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x04, 0x64,
+	0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67,
+	0x18, 0x02, 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, 0x03,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x32,
+	0xff, 0x03, 0x0a, 0x0b, 0x42, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12,
+	0x4d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e,
+	0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73,
+	0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e,
+	0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73,
+	0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45,
+	0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x53, 0x6f, 0x6d, 0x65, 0x49, 0x6e, 0x66, 0x6f,
+	0x12, 0x18, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53,
+	0x6f, 0x6d, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x62, 0x78, 0x73,
+	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x6f, 0x6d, 0x65, 0x49, 0x6e, 0x66,
+	0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x53, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
+	0x75, 0x62, 0x53, 0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x2e, 0x62,
+	0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
+	0x65, 0x53, 0x75, 0x62, 0x53, 0x63, 0x72, 0x69, 0x62, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
+	0x71, 0x1a, 0x17, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e,
+	0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4f, 0x0a, 0x0d, 0x42, 0x79,
+	0x50, 0x75, 0x73, 0x68, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x62, 0x78,
+	0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72,
+	0x69, 0x62, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x62, 0x78,
+	0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x42, 0x79, 0x50, 0x75, 0x73, 0x68,
+	0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3b, 0x0a, 0x07, 0x53,
+	0x65, 0x74, 0x52, 0x65, 0x61, 0x64, 0x12, 0x17, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63,
+	0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x1a,
+	0x17, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x53, 0x74,
+	0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4b,
+	0x65, 0x79, 0x12, 0x16, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
+	0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x62, 0x78, 0x73,
+	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x3f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x53, 0x63, 0x72, 0x69, 0x62, 0x65,
+	0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
+	0x62, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x62, 0x78, 0x73,
+	0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73,
+	0x71, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x62, 0x78, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
+	0x62, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -2010,7 +2348,7 @@ func file_bxsubscribe_proto_rawDescGZIP() []byte {
 	return file_bxsubscribe_proto_rawDescData
 }
 
-var file_bxsubscribe_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
+var file_bxsubscribe_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
 var file_bxsubscribe_proto_goTypes = []interface{}{
 	(*SubscribeInfosReq)(nil),      // 0: bxsubscribe.SubscribeInfosReq
 	(*SubscribeInfosResp)(nil),     // 1: bxsubscribe.SubscribeInfosResp
@@ -2030,35 +2368,46 @@ var file_bxsubscribe_proto_goTypes = []interface{}{
 	(*SetReadReq)(nil),             // 15: bxsubscribe.SetReadReq
 	(*GetKeyReq)(nil),              // 16: bxsubscribe.GetKeyReq
 	(*KeyResp)(nil),                // 17: bxsubscribe.KeyResp
-	nil,                            // 18: bxsubscribe.UpdateSubScribeInfoReq.AreaEntry
+	(*List)(nil),                   // 18: bxsubscribe.List
+	(*Subscribe)(nil),              // 19: bxsubscribe.Subscribe
+	(*UserReq)(nil),                // 20: bxsubscribe.UserReq
+	(*UserResq)(nil),               // 21: bxsubscribe.UserResq
+	nil,                            // 22: bxsubscribe.UpdateSubScribeInfoReq.AreaEntry
+	nil,                            // 23: bxsubscribe.Subscribe.AreaEntry
 }
 var file_bxsubscribe_proto_depIdxs = []int32{
 	2,  // 0: bxsubscribe.SubscribeInfosResp.data:type_name -> bxsubscribe.subscribeData
 	3,  // 1: bxsubscribe.subscribeData.list:type_name -> bxsubscribe.subscribeInfo
 	6,  // 2: bxsubscribe.SomeInfoResp.data:type_name -> bxsubscribe.SomeInfo
-	18, // 3: bxsubscribe.UpdateSubScribeInfoReq.area:type_name -> bxsubscribe.UpdateSubScribeInfoReq.AreaEntry
+	22, // 3: bxsubscribe.UpdateSubScribeInfoReq.area:type_name -> bxsubscribe.UpdateSubScribeInfoReq.AreaEntry
 	11, // 4: bxsubscribe.UpdateSubScribeInfoReq.items:type_name -> bxsubscribe.Items
 	12, // 5: bxsubscribe.Items.a_key:type_name -> bxsubscribe.Keys
 	14, // 6: bxsubscribe.KeyItems.a_key:type_name -> bxsubscribe.Key
 	13, // 7: bxsubscribe.KeyResp.items:type_name -> bxsubscribe.KeyItems
-	10, // 8: bxsubscribe.UpdateSubScribeInfoReq.AreaEntry.value:type_name -> bxsubscribe.CityList
-	0,  // 9: bxsubscribe.Bxsubscribe.GetSubList:input_type -> bxsubscribe.SubscribeInfosReq
-	4,  // 10: bxsubscribe.Bxsubscribe.GetSubSomeInfo:input_type -> bxsubscribe.SomeInfoReq
-	9,  // 11: bxsubscribe.Bxsubscribe.UpdateSubScribeInfo:input_type -> bxsubscribe.UpdateSubScribeInfoReq
-	0,  // 12: bxsubscribe.Bxsubscribe.ByPushHistory:input_type -> bxsubscribe.SubscribeInfosReq
-	15, // 13: bxsubscribe.Bxsubscribe.SetRead:input_type -> bxsubscribe.SetReadReq
-	16, // 14: bxsubscribe.Bxsubscribe.GetKey:input_type -> bxsubscribe.GetKeyReq
-	1,  // 15: bxsubscribe.Bxsubscribe.GetSubList:output_type -> bxsubscribe.SubscribeInfosResp
-	5,  // 16: bxsubscribe.Bxsubscribe.GetSubSomeInfo:output_type -> bxsubscribe.SomeInfoResp
-	7,  // 17: bxsubscribe.Bxsubscribe.UpdateSubScribeInfo:output_type -> bxsubscribe.StatusResp
-	8,  // 18: bxsubscribe.Bxsubscribe.ByPushHistory:output_type -> bxsubscribe.ByPushHistoryResp
-	7,  // 19: bxsubscribe.Bxsubscribe.SetRead:output_type -> bxsubscribe.StatusResp
-	17, // 20: bxsubscribe.Bxsubscribe.GetKey:output_type -> bxsubscribe.KeyResp
-	15, // [15:21] is the sub-list for method output_type
-	9,  // [9:15] is the sub-list for method input_type
-	9,  // [9:9] is the sub-list for extension type_name
-	9,  // [9:9] is the sub-list for extension extendee
-	0,  // [0:9] is the sub-list for field type_name
+	23, // 8: bxsubscribe.Subscribe.area:type_name -> bxsubscribe.Subscribe.AreaEntry
+	11, // 9: bxsubscribe.Subscribe.items:type_name -> bxsubscribe.Items
+	19, // 10: bxsubscribe.UserResq.data:type_name -> bxsubscribe.Subscribe
+	10, // 11: bxsubscribe.UpdateSubScribeInfoReq.AreaEntry.value:type_name -> bxsubscribe.CityList
+	18, // 12: bxsubscribe.Subscribe.AreaEntry.value:type_name -> bxsubscribe.List
+	0,  // 13: bxsubscribe.Bxsubscribe.GetSubList:input_type -> bxsubscribe.SubscribeInfosReq
+	4,  // 14: bxsubscribe.Bxsubscribe.GetSubSomeInfo:input_type -> bxsubscribe.SomeInfoReq
+	9,  // 15: bxsubscribe.Bxsubscribe.UpdateSubScribeInfo:input_type -> bxsubscribe.UpdateSubScribeInfoReq
+	0,  // 16: bxsubscribe.Bxsubscribe.ByPushHistory:input_type -> bxsubscribe.SubscribeInfosReq
+	15, // 17: bxsubscribe.Bxsubscribe.SetRead:input_type -> bxsubscribe.SetReadReq
+	16, // 18: bxsubscribe.Bxsubscribe.GetKey:input_type -> bxsubscribe.GetKeyReq
+	20, // 19: bxsubscribe.Bxsubscribe.GetSubScribeInfo:input_type -> bxsubscribe.UserReq
+	1,  // 20: bxsubscribe.Bxsubscribe.GetSubList:output_type -> bxsubscribe.SubscribeInfosResp
+	5,  // 21: bxsubscribe.Bxsubscribe.GetSubSomeInfo:output_type -> bxsubscribe.SomeInfoResp
+	7,  // 22: bxsubscribe.Bxsubscribe.UpdateSubScribeInfo:output_type -> bxsubscribe.StatusResp
+	8,  // 23: bxsubscribe.Bxsubscribe.ByPushHistory:output_type -> bxsubscribe.ByPushHistoryResp
+	7,  // 24: bxsubscribe.Bxsubscribe.SetRead:output_type -> bxsubscribe.StatusResp
+	17, // 25: bxsubscribe.Bxsubscribe.GetKey:output_type -> bxsubscribe.KeyResp
+	21, // 26: bxsubscribe.Bxsubscribe.GetSubScribeInfo:output_type -> bxsubscribe.UserResq
+	20, // [20:27] is the sub-list for method output_type
+	13, // [13:20] is the sub-list for method input_type
+	13, // [13:13] is the sub-list for extension type_name
+	13, // [13:13] is the sub-list for extension extendee
+	0,  // [0:13] is the sub-list for field type_name
 }
 
 func init() { file_bxsubscribe_proto_init() }
@@ -2283,6 +2632,54 @@ func file_bxsubscribe_proto_init() {
 				return nil
 			}
 		}
+		file_bxsubscribe_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*List); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_bxsubscribe_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Subscribe); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_bxsubscribe_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*UserReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_bxsubscribe_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*UserResq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -2290,7 +2687,7 @@ func file_bxsubscribe_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_bxsubscribe_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   19,
+			NumMessages:   24,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 39 - 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.20.0--rc2
+// - protoc             v3.15.1
 // source: bxsubscribe.proto
 
 package bxsubscribe
@@ -34,6 +34,8 @@ type BxsubscribeClient interface {
 	SetRead(ctx context.Context, in *SetReadReq, opts ...grpc.CallOption) (*StatusResp, error)
 	//关键词获取
 	GetKey(ctx context.Context, in *GetKeyReq, opts ...grpc.CallOption) (*KeyResp, error)
+	//订阅设置获取
+	GetSubScribeInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResq, error)
 }
 
 type bxsubscribeClient struct {
@@ -98,6 +100,15 @@ func (c *bxsubscribeClient) GetKey(ctx context.Context, in *GetKeyReq, opts ...g
 	return out, nil
 }
 
+func (c *bxsubscribeClient) GetSubScribeInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserResq, error) {
+	out := new(UserResq)
+	err := c.cc.Invoke(ctx, "/bxsubscribe.Bxsubscribe/GetSubScribeInfo", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // BxsubscribeServer is the server API for Bxsubscribe service.
 // All implementations must embed UnimplementedBxsubscribeServer
 // for forward compatibility
@@ -114,6 +125,8 @@ type BxsubscribeServer interface {
 	SetRead(context.Context, *SetReadReq) (*StatusResp, error)
 	//关键词获取
 	GetKey(context.Context, *GetKeyReq) (*KeyResp, error)
+	//订阅设置获取
+	GetSubScribeInfo(context.Context, *UserReq) (*UserResq, error)
 	mustEmbedUnimplementedBxsubscribeServer()
 }
 
@@ -139,6 +152,9 @@ func (UnimplementedBxsubscribeServer) SetRead(context.Context, *SetReadReq) (*St
 func (UnimplementedBxsubscribeServer) GetKey(context.Context, *GetKeyReq) (*KeyResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetKey not implemented")
 }
+func (UnimplementedBxsubscribeServer) GetSubScribeInfo(context.Context, *UserReq) (*UserResq, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetSubScribeInfo not implemented")
+}
 func (UnimplementedBxsubscribeServer) mustEmbedUnimplementedBxsubscribeServer() {}
 
 // UnsafeBxsubscribeServer may be embedded to opt out of forward compatibility for this service.
@@ -260,6 +276,24 @@ func _Bxsubscribe_GetKey_Handler(srv interface{}, ctx context.Context, dec func(
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Bxsubscribe_GetSubScribeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(UserReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(BxsubscribeServer).GetSubScribeInfo(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/bxsubscribe.Bxsubscribe/GetSubScribeInfo",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(BxsubscribeServer).GetSubScribeInfo(ctx, req.(*UserReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // Bxsubscribe_ServiceDesc is the grpc.ServiceDesc for Bxsubscribe service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -291,6 +325,10 @@ var Bxsubscribe_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "GetKey",
 			Handler:    _Bxsubscribe_GetKey_Handler,
 		},
+		{
+			MethodName: "GetSubScribeInfo",
+			Handler:    _Bxsubscribe_GetSubScribeInfo_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "bxsubscribe.proto",