Эх сурвалжийг харах

feat:获取用户订阅设置

zhangxinlei1996 3 жил өмнө
parent
commit
977edaea62

+ 1 - 1
api/etc/usercenter-api.yaml

@@ -9,7 +9,7 @@ UserCenterRpcConf:
 GatewayRpcConf:
   Etcd:
     Hosts:
-      -  192.168.3.240:2379
+      -  192.168.3.206:2379
     Key: gatewayDemo.rpc
 Timeout:  5000
 Logx:

+ 28 - 0
api/internal/handler/getuserinfohandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func GetUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.UserReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGetUserInfoLogic(r.Context(), svcCtx)
+		resp, err := l.GetUserInfo(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 7 - 2
api/internal/handler/routes.go

@@ -9,8 +9,8 @@ import (
 	"github.com/zeromicro/go-zero/rest"
 )
 
-func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
-	engine.AddRoutes(
+func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
+	server.AddRoutes(
 		[]rest.Route{
 			{
 				Method:  http.MethodPost,
@@ -57,6 +57,11 @@ func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/userCenter/ent/getStatusByCode",
 				Handler: GetStatusByCodeHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/userCenter/user/getUserInfo",
+				Handler: GetUserInfoHandler(serverCtx),
+			},
 		},
 	)
 }

+ 48 - 0
api/internal/logic/getuserinfologic.go

@@ -0,0 +1,48 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/types"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/entity"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetUserInfoLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserInfoLogic {
+	return &GetUserInfoLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GetUserInfoLogic) GetUserInfo(req *types.UserReq) (resp *types.Resp, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Resp{}
+	res, err := entity.UserCenterRpc.GetUserInfo(l.ctx, &pb.UserReq{
+		AppId:      req.AppId,
+		UserId:     req.UserId,
+		BaseUserId: req.BaseUserId,
+		Types:      req.Types,
+		EntId:      req.EntId,
+		EntUserId:  req.EntUserId,
+	})
+	if res.ErrorMsg != "" {
+		resp.Error_msg = res.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), res.ErrorMsg)
+	}
+	resp.Data = res.Data
+	return
+}

+ 9 - 0
api/internal/types/types.go

@@ -185,3 +185,12 @@ type GetStatus struct {
 	AuthStatus int64 `json:"authStatus"`
 	IsInEnt    bool  `json:"isInEnt"`
 }
+
+type UserReq struct {
+	AppId      string `header:"appId,default=10000"`
+	UserId     string `header:"userId"`
+	EntId      int64  `header:"entId,optional"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	BaseUserId int64  `json:"baseUserId,optional"`
+	Types      string `json:"types,optional"` //类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
+}

+ 11 - 0
api/userCenter.api

@@ -198,6 +198,15 @@ type (
 		AuthStatus int64 `json:"authStatus"`
 		IsInEnt    bool  `json:"isInEnt"`
 	}
+
+	UserReq {
+		AppId      string `header:"appId,default=10000"`
+		UserId     string `header:"userId"`
+		EntId      int64  `header:"entId,optional"`
+		EntUserId  int64  `header:"entUserId,optional"`
+		BaseUserId int64  `json:"baseUserId,optional"`
+		Types      string `json:"types,optional"` //类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
+	}
 )
 
 service userCenter-api {
@@ -219,4 +228,6 @@ service userCenter-api {
 	post /userCenter/ent/update(UpdateEntReq)returns(resp)
 	@handler GetStatusByCode
 	post /userCenter/ent/getStatusByCode(GetStatusByCodeReq)returns(GetStatusByCodeResp)
+	@handler GetUserInfo
+	post /userCenter/user/getUserInfo(UserReq)returns(resp)
 }

+ 2 - 0
entity/db.go

@@ -1,9 +1,11 @@
 package entity
 
 import (
+	"app.yhyue.com/moapp/jybase/mongodb"
 	"app.yhyue.com/moapp/jybase/mysql"
 )
 
 var (
 	Mysql *mysql.Mysql
+	Mgo   mongodb.MongodbSim
 )

+ 10 - 0
entity/ent.go

@@ -725,3 +725,13 @@ func (this *GetStatusByCodeStruct) GetStatusByCode() (int, bool, string) {
 	}
 	return authStatus, isin, ""
 }
+
+//根据id获取企业信息
+func (e *EntInfo) GetById(id int) *EntInfo {
+	r := e.Mysql.FindOne(Entniche_info, map[string]interface{}{"id": id}, "*", "")
+	entInfo, _ := common.JsonUnmarshal(r, &EntInfo{}).(*EntInfo)
+	if entInfo == nil {
+		return &EntInfo{}
+	}
+	return entInfo
+}

+ 84 - 0
entity/entniche.go

@@ -0,0 +1,84 @@
+package entity
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/mysql"
+)
+
+var VarCurrentUser = &CurrentUser{}
+
+//当前登录用户
+type CurrentUser struct {
+	Role_admin_department bool        //是否是部门管理员
+	Role_admin_system     bool        //是否是系统管理员
+	Ent                   *EntInfo    //企业信息
+	Dept                  *Department //部门信息
+	BondPhone             string      //手机号
+	NickName              string      //昵称
+	HeadImageUrl          string      //头像
+	PersonalAuth          int         //个人认证
+	PersonalAuthReason    string      //个人认证不通过原因
+	User_power            int         //是否分配权限
+	User_name             string      //用户姓名
+	Mysql                 *mysql.Mysql
+}
+
+type Department struct {
+	Id         int
+	Name       string //公司名
+	Pid        int    //上级部门id
+	Pname      string //上级部门名称
+	Nodiff     int    //全员无差别接收 0:关闭 1:打开
+	Subdis     int    //订阅分发 0:关闭 1:打开
+	Aid        int    //管理员id
+	Aname      string //管理员姓名
+	User_count int    //该部门下员工的总数
+	Dept_count int    //该部门下子部门总数
+}
+
+//当前登录用户的信息
+func (this *CurrentUser) EntInfo(entId, entUserId int) *CurrentUser {
+	currentUser := &CurrentUser{
+		Ent:  &EntInfo{},
+		Dept: &Department{},
+	}
+	varentinfo := &EntInfo{
+		Mysql: this.Mysql,
+	}
+	currentUser.Ent = varentinfo.GetById(entId)
+	user := this.Mysql.SelectBySql(`SELECT a.name as user_name from entniche_user a INNER JOIN entniche_user_role b on (a.id=b.user_id) where a.id=? and b.role_id=? limit 1`, entUserId, Role_admin_system)
+	if user != nil && len(*user) > 0 {
+		currentUser.Role_admin_system = true
+		currentUser.User_name, _ = (*user)[0]["user_name"].(string)
+		currentUser.User_power = 1
+		r := this.Mysql.SelectBySql(`SELECT id,name,subdis,nodiff from entniche_department where ent_id=? and pid=0 limit 1`, entId)
+		if r != nil && len(*r) == 1 {
+			department := common.JsonUnmarshal((*r)[0], &Department{}).(*Department)
+			if department != nil {
+				department.Pid = department.Id
+				currentUser.Dept = department
+			}
+		}
+	} else {
+		//角色、权限
+		r := this.Mysql.SelectBySql(`SELECT a.name as user_name,a.power as user_power,b.role_id,d.id as dept_id,d.name as dept_name,d.subdis as dept_subdis,d.nodiff as dept_nodiff,e.id as dept_pid from entniche_user a 
+			LEFT JOIN entniche_user_role b on (b.user_id=?) 
+			INNER JOIN entniche_department_user c on (a.id=? and a.id=c.user_id) 
+			INNER JOIN entniche_department d on (c.dept_id=d.id) 
+			INNER JOIN entniche_department e on (e.ent_id=? and e.pid=0) 
+			order by a.id desc limit 1`, entUserId, entUserId, entId)
+		if r != nil && len(*r) == 1 {
+			currentUser.User_name, _ = (*r)[0]["user_name"].(string)
+			currentUser.User_power = common.IntAll((*r)[0]["user_power"])
+			if common.IntAll((*r)[0]["role_id"]) == Role_admin_department {
+				currentUser.Role_admin_department = true
+			}
+			currentUser.Dept.Id = common.IntAll((*r)[0]["dept_id"])
+			currentUser.Dept.Pid = common.IntAll((*r)[0]["dept_pid"])
+			currentUser.Dept.Name = common.ObjToString((*r)[0]["dept_name"])
+			currentUser.Dept.Subdis = common.IntAll((*r)[0]["dept_subdis"])
+			currentUser.Dept.Nodiff = common.IntAll((*r)[0]["dept_nodiff"])
+		}
+	}
+	return currentUser
+}

+ 196 - 0
entity/subscribe.go

@@ -0,0 +1,196 @@
+package entity
+
+import (
+	"log"
+
+	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jybase/mysql"
+)
+
+//获取用户状态
+type UserInfoReq struct {
+	Mysql      *mysql.Mysql
+	Mgo        mongodb.MongodbSim
+	UserId     string
+	BaseUserId int64  //暂未使用
+	Types      string //不传取默认规则
+	EntId      int64
+	EntUserId  int64
+}
+
+//默认规则:优先大会员、商机管理、超级订阅、免费订阅
+func (this *UserInfoReq) GetUserInfo() (ret map[string]interface{}, msg string) {
+	data := this.userInfo()
+	ret = map[string]interface{}{}
+	if data == nil {
+		return nil, "未查询到用户信息"
+	}
+	//获取用户权益
+	vip_status := common.IntAll((*data)["i_vip_status"])       //超级订阅
+	member_status := common.IntAll((*data)["i_member_status"]) //大会员
+	varentinfo := &EntInfo{Mysql: this.Mysql}                  //商机管理
+	entinfo := varentinfo.GetById(int(this.EntId))
+	entniche_status := entinfo.Status
+	//用户相关订阅设置
+	object := &map[string]interface{}{}
+	if this.Types == "" {
+		if member_status > 0 {
+			this.Types = "m"
+		} else if entniche_status > 0 {
+			this.Types = "e"
+		} else if vip_status > 0 {
+			this.Types = "v"
+		} else {
+			this.Types = "f"
+		}
+	}
+	switch this.Types {
+	case "m":
+		//大会员
+		if (*data)["o_member_jy"] == nil || member_status <= 0 {
+			return nil, "未查询到用户信息"
+		}
+		memberJy := common.ObjToMap((*data)["o_member_jy"])
+		object = this.format(memberJy)
+		(*object)["starttime"] = (*data)["i_member_starttime"]
+		(*object)["endtime"] = (*data)["i_member_endtime"]
+	case "e":
+		//商机管理
+		entnicheJy := this.EntnicheSub()
+		power := common.Int64All((*entnicheJy)["power"])
+		if entnicheJy == nil || power != 1 {
+			entniche_status = -1
+			return nil, "未查询到用户信息"
+		}
+		object = this.format(entnicheJy)
+	case "v":
+		//超级订阅
+		if (*data)["o_vipjy"] == nil || vip_status <= 0 {
+			return nil, "未查询到用户信息"
+		}
+		vipJy := common.ObjToMap((*data)["o_vipjy"])
+		object = this.format(vipJy)
+		(*object)["starttime"] = (*data)["l_vip_starttime"]
+		(*object)["endtime"] = (*data)["l_vip_endtime"]
+	case "f":
+		if (*data)["o_jy"] == nil {
+			return nil, "未查询到用户信息"
+		}
+		ojy := common.ObjToMap((*data)["o_jy"])
+		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"]
+		}
+	}
+	//
+	ret["area"] = (*object)["o_area"]
+	ret["items"] = (*object)["a_items"]
+	ret["matchway"] = common.If((*object)["i_matchway"] == nil, 1, (*object)["i_matchway"]) //没有则,默认1
+	ret["buyerclass"] = common.If((*object)["a_buyerclass"] == nil, []string{}, (*object)["a_buyerclass"])
+	ret["infotype"] = common.If((*object)["a_infotype"] == nil, []string{}, (*object)["a_infotype"])
+	ret["projectmatch"] = common.If((*object)["i_projectmatch"] == nil, 0, (*object)["i_projectmatch"])
+	ret["starttime"] = (*object)["starttime"]
+	ret["endtime"] = (*object)["endtime"]
+	phone := (*data)["s_phone"]
+	if phone == nil {
+		phone = (*data)["s_m_phone"]
+	}
+	ret["phone"] = phone
+	ret["vipStatus"] = vip_status
+	ret["memberStatus"] = member_status
+	ret["entnicheStatus"] = entniche_status
+	ret["subscribeType"] = this.Types
+	log.Println(ret)
+	return ret, ""
+}
+
+//获取mongodb user表相关数据
+func (this *UserInfoReq) userInfo() *map[string]interface{} {
+	data, ok := this.Mgo.FindById("user", this.UserId, `{"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}`)
+	if ok && data != nil && len(*data) > 0 {
+		return data
+	}
+	return nil
+}
+
+//格式化数据 大会员/超级订阅/商机管理 结构一致 关键词格式化
+func (this *UserInfoReq) 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 := common.ObjArrToMapArr(v["a_key"].([]interface{}))
+				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
+}
+
+//商机管理订阅设置
+func (this *UserInfoReq) EntnicheSub() *map[string]interface{} {
+	currentUser := &CurrentUser{
+		Mysql: this.Mysql,
+	}
+	entInfo := currentUser.EntInfo(int(this.EntId), int(this.EntUserId))
+	model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
+	if entInfo.User_power != 1 {
+		//用户暂无权限
+		return nil
+	}
+	res := &map[string]interface{}{}
+	switch model {
+	case 1:
+		res, _ = this.Mgo.FindOne("entniche_rule", map[string]interface{}{
+			"i_deptid": entInfo.Dept.Id,
+			"i_entid":  this.EntId,
+		})
+	case 2:
+		res, _ = this.Mgo.FindOne("entniche_rule", map[string]interface{}{
+			"i_userid": this.EntUserId,
+			"i_entid":  this.EntId,
+		})
+	}
+	if len(*res) == 0 {
+		return nil
+	}
+	if (*res)["o_entniche"] == nil {
+		return nil
+	}
+	entnicheJy := common.ObjToMap((*res)["o_entniche"])
+	(*entnicheJy)["starttime"] = entInfo.Ent.Startdate
+	(*entnicheJy)["endtime"] = entInfo.Ent.Enddate
+	(*entnicheJy)["power"] = entInfo.User_power //用户权益
+	//获取商机管理的订阅设置
+	return entnicheJy
+}

+ 12 - 0
go.sum

@@ -86,6 +86,7 @@ github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9Pq
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
 github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
 github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
+github.com/aws/aws-sdk-go v1.35.20 h1:Hs7x9Czh+MMPnZLQqHhsuZKeNFA3Vuf7pdy2r5QlVb0=
 github.com/aws/aws-sdk-go v1.35.20/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k=
 github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
 github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
@@ -191,6 +192,7 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG
 github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
 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=
@@ -259,6 +261,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
 github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
 github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
 github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
 github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
 github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -330,7 +333,9 @@ github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkr
 github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jinzhu/now v1.1.1 h1:g39TucaRWyV3dwDO++eEc6qf8TVIQ/Da48WmqjZ3i7E=
 github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
+github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
 github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
+github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
 github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
 github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
 github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
@@ -352,6 +357,7 @@ github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0Lh
 github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
 github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
+github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
 github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -500,13 +506,17 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
 github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
 github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
 github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
 github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs=
 github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=
+github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk=
 github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
+github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc h1:n+nNi93yXLkJvKwXNP9d55HC7lGK4H/SRcwB5IaUZLo=
 github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
+github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
 github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
 github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -524,6 +534,7 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.2 h1:4hzqQ6hIb3blLyQ8usCU4h3NghkqcsohEQ3o3Vet
 go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
 go.etcd.io/etcd/client/v3 v3.5.2 h1:WdnejrUtQC4nCxK0/dLTMqKOB+U5TP/2Ya0BJL+1otA=
 go.etcd.io/etcd/client/v3 v3.5.2/go.mod h1:kOOaWFFgHygyT0WlSmL8TJiXmMysO/nNUlEsSsN6W4o=
+go.mongodb.org/mongo-driver v1.5.0 h1:REddm85e1Nl0JPXGGhgZkgJdG/yOe6xvpXUcYK5WLt0=
 go.mongodb.org/mongo-driver v1.5.0/go.mod h1:boiGPFqyBs5R0R5qf2ErokGRekMfwn+MqKaUyHs7wy0=
 go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
 go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
@@ -668,6 +679,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

+ 7 - 3
rpc/etc/usercenter.yaml

@@ -13,7 +13,7 @@ CalleeId: usercenter.rpc
 ResourceEtcdConf:
   Etcd:
     Hosts:
-      - 192.168.3.240:2379
+      - 192.168.3.206:2379
     Key: resource.rpc
 Node: 1
 Mysql:
@@ -24,11 +24,15 @@ Mysql:
   maxOpenConns: 5
   maxIdleConns: 5
 Logx:
-  Mode: console #console|file|volume
+  Mode: file #console|file|volume
   Path: logs
   Level: info #info|error|severe
   KeepDays: 100
 IsRun: true
 CheckEntIsExpire: 00:00
 DoMain: https://jybx-webtest.jydev.jianyu360.com
-Timeout:  5000
+Timeout:  5000
+Mongo:
+  dbName: qfw
+  size: 5
+  address: 192.168.3.206:27080

+ 7 - 0
rpc/internal/config/config.go

@@ -20,12 +20,19 @@ type Config struct {
 	IsRun            bool   //定时任务是否开启
 	CheckEntIsExpire string //
 	DoMain           string
+	Mongo            Mongodb
 }
 
 var (
 	ConfigJson Config
 )
 
+type Mongodb struct {
+	DbName  string `json:"dbName"`
+	Size    int    `json:"size"`
+	Address string `json:"address"`
+}
+
 type Mysql struct {
 	DbName       string `json:"dbName"`
 	Address      string `json:"address"`

+ 8 - 0
rpc/internal/db/db.go

@@ -3,6 +3,7 @@ package db
 import (
 	"log"
 
+	"app.yhyue.com/moapp/jybase/mongodb"
 	"app.yhyue.com/moapp/jybase/mysql"
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/entity"
 	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/internal/config"
@@ -20,4 +21,11 @@ func init() {
 	entity.Mysql.Init()
 	log.Println("初始化 mysql")
 
+	entity.Mgo = mongodb.MongodbSim{
+		MongodbAddr: config.ConfigJson.Mongo.Address,
+		Size:        config.ConfigJson.Mongo.Size,
+		DbName:      config.ConfigJson.Mongo.DbName,
+	}
+	entity.Mgo.InitPool()
+	log.Println("初始化mongodb")
 }

+ 2 - 0
rpc/internal/logic/entservice.go

@@ -8,3 +8,5 @@ import (
 var Entservice = service.EntService{
 	Url: config.ConfigJson.DoMain,
 }
+
+var SubscirbeService = service.SubscribeService{}

+ 115 - 0
rpc/internal/logic/getuserinfologic.go

@@ -0,0 +1,115 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+	"log"
+
+	"app.yhyue.com/moapp/jybase/common"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetUserInfoLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserInfoLogic {
+	return &GetUserInfoLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 获取客户信息
+func (l *GetUserInfoLogic) GetUserInfo(in *pb.UserReq) (*pb.UserInfo, error) {
+	// todo: add your logic here and delete this line
+	resp := &pb.UserInfo{}
+	ret, msg := SubscirbeService.GetSubscribeInfo(in)
+	if msg != "" {
+		l.Error(fmt.Sprintf("%+v", in), msg)
+		resp.ErrorMsg = msg
+		resp.ErrorCode = -1
+	}
+
+	resp.Phone = common.ObjToString(ret["phone"])
+	resp.VipStatus = common.Int64All(ret["vipStatus"])
+	resp.MemberStatus = common.Int64All(ret["memberStatus"])
+	resp.EntnicheStatus = common.Int64All(ret["entnicheStatus"])
+	resp.SubscribeType = common.ObjToString(ret["subscribeType"])
+	items, ok := ret["items"].([]map[string]interface{})
+	if !ok {
+		inter_items, _ := ret["items"].([]interface{})
+		items = common.ObjArrToMapArr(inter_items)
+	}
+	log.Println("items:", items)
+	log.Println("oarea:", ret["o_area"], common.ObjToMap(ret["o_area"]))
+	buyerclass, _ := ret["buyerclass"].([]interface{})
+	infotype, _ := ret["infotype"].([]interface{})
+	resp.Data = &pb.Subscribe{
+		StartTime:    common.Int64All(ret["starttime"]),
+		EndTime:      common.Int64All(ret["endtime"]),
+		Area:         l.formatM(common.ObjToMap(ret["area"])),
+		Buyerclass:   common.ObjArrToStringArr(buyerclass),
+		Infotype:     common.ObjArrToStringArr(infotype),
+		Matchway:     common.Int64All(ret["matchway"]),
+		Projectmatch: common.Int64All(ret["projectmatch"]),
+		Items:        l.formatItems(items),
+	}
+	return resp, nil
+}
+
+//格式转化 map<string,list>转化
+func (l *GetUserInfoLogic) formatM(m *map[string]interface{}) map[string]*pb.List {
+	retM := map[string]*pb.List{}
+	if len(*m) == 0 {
+		return retM
+	}
+	for k, v := range *m {
+		s_v, ok := v.([]string)
+		if !ok {
+			interf, _ := v.([]interface{})
+			s_v = common.ObjArrToStringArr(interf)
+		}
+		retM[k] = &pb.List{
+			Value: s_v,
+		}
+	}
+	return retM
+}
+
+func (l *GetUserInfoLogic) formatItems(m []map[string]interface{}) []*pb.Items {
+	items := make([]*pb.Items, len(m))
+	for k, v := range m {
+		items[k] = &pb.Items{
+			SItem:      common.ObjToString(v["s_item"]),
+			UpdateTime: common.Int64All(v["updatetime"]),
+		}
+		akey, _ := v["a_key"].([]map[string]interface{})
+		pbKey := make([]*pb.Keys, len(akey))
+		for kk, vv := range akey {
+			key, ok := vv["key"].([]string)
+			if !ok {
+				inter_vv, _ := vv["key"].([]interface{})
+				key = common.ObjArrToStringArr(inter_vv)
+			}
+			notkey, ok := vv["notkey"].([]string)
+			if !ok {
+				inter_vv, _ := vv["notkey"].([]interface{})
+				notkey = common.ObjArrToStringArr(inter_vv)
+			}
+			pbKey[kk] = &pb.Keys{
+				Key:        key,
+				Notkey:     notkey,
+				UpdateTime: common.If(vv["updatetime"] == nil, int64(0), common.Int64All(vv["updatetime"])).(int64),
+			}
+		}
+		items[k].AKey = pbKey
+	}
+	return items
+}

+ 6 - 0
rpc/internal/server/usercenterserver.go

@@ -75,3 +75,9 @@ func (s *UserCenterServer) GetStatusByCode(ctx context.Context, in *pb.GetStatus
 	l := logic.NewGetStatusByCodeLogic(ctx, s.svcCtx)
 	return l.GetStatusByCode(in)
 }
+
+// 获取客户信息
+func (s *UserCenterServer) GetUserInfo(ctx context.Context, in *pb.UserReq) (*pb.UserInfo, error) {
+	l := logic.NewGetUserInfoLogic(ctx, s.svcCtx)
+	return l.GetUserInfo(in)
+}

+ 695 - 66
rpc/pb/userCenter.pb.go

@@ -1731,6 +1731,484 @@ func (x *GetStatusByCodeResp) GetData() *GetStatusByCodeResp_GetStatusByCode {
 	return nil
 }
 
+//用户权益
+type UserInfo struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Phone          string     `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"`                    //手机号
+	VipStatus      int64      `protobuf:"varint,2,opt,name=vipStatus,proto3" json:"vipStatus,omitempty"`           //超级订阅状态; >0有权限 <=0无权限
+	MemberStatus   int64      `protobuf:"varint,3,opt,name=memberStatus,proto3" json:"memberStatus,omitempty"`     //大会员状态;  >0:有权限  <=0:无权限
+	EntnicheStatus int64      `protobuf:"varint,4,opt,name=entnicheStatus,proto3" json:"entnicheStatus,omitempty"` //商机管理权限状态; 1:有权限   -1:无权限
+	SubscribeType  string     `protobuf:"bytes,5,opt,name=subscribeType,proto3" json:"subscribeType,omitempty"`    //订阅设置类型 f:免费订阅 v:超级订阅 m:大会员订阅 e:商机管理订阅
+	Data           *Subscribe `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
+	ErrorMsg       string     `protobuf:"bytes,7,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
+	ErrorCode      int64      `protobuf:"varint,8,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
+}
+
+func (x *UserInfo) Reset() {
+	*x = UserInfo{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[21]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *UserInfo) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UserInfo) ProtoMessage() {}
+
+func (x *UserInfo) ProtoReflect() protoreflect.Message {
+	mi := &file_userCenter_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 UserInfo.ProtoReflect.Descriptor instead.
+func (*UserInfo) Descriptor() ([]byte, []int) {
+	return file_userCenter_proto_rawDescGZIP(), []int{21}
+}
+
+func (x *UserInfo) GetPhone() string {
+	if x != nil {
+		return x.Phone
+	}
+	return ""
+}
+
+func (x *UserInfo) GetVipStatus() int64 {
+	if x != nil {
+		return x.VipStatus
+	}
+	return 0
+}
+
+func (x *UserInfo) GetMemberStatus() int64 {
+	if x != nil {
+		return x.MemberStatus
+	}
+	return 0
+}
+
+func (x *UserInfo) GetEntnicheStatus() int64 {
+	if x != nil {
+		return x.EntnicheStatus
+	}
+	return 0
+}
+
+func (x *UserInfo) GetSubscribeType() string {
+	if x != nil {
+		return x.SubscribeType
+	}
+	return ""
+}
+
+func (x *UserInfo) GetData() *Subscribe {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
+func (x *UserInfo) GetErrorMsg() string {
+	if x != nil {
+		return x.ErrorMsg
+	}
+	return ""
+}
+
+func (x *UserInfo) GetErrorCode() int64 {
+	if x != nil {
+		return x.ErrorCode
+	}
+	return 0
+}
+
+//订阅设置
+type Subscribe struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	StartTime    int64            `protobuf:"varint,1,opt,name=startTime,proto3" json:"startTime,omitempty"`                                                                              //开始时间
+	EndTime      int64            `protobuf:"varint,2,opt,name=endTime,proto3" json:"endTime,omitempty"`                                                                                  //结束时间
+	Area         map[string]*List `protobuf:"bytes,3,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,4,rep,name=buyerclass,proto3" json:"buyerclass,omitempty"`                                                                             //采购单位类型
+	Infotype     []string         `protobuf:"bytes,5,rep,name=infotype,proto3" json:"infotype,omitempty"`                                                                                 //信息类型
+	Items        []*Items         `protobuf:"bytes,6,rep,name=items,proto3" json:"items,omitempty"`                                                                                       //关键词
+	Matchway     int64            `protobuf:"varint,7,opt,name=matchway,proto3" json:"matchway,omitempty"`                                                                                //匹配方式 1标题 2正文
+	Projectmatch int64            `protobuf:"varint,8,opt,name=projectmatch,proto3" json:"projectmatch,omitempty"`                                                                        //项目匹配
+}
+
+func (x *Subscribe) Reset() {
+	*x = Subscribe{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[22]
+		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_userCenter_proto_msgTypes[22]
+	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_userCenter_proto_rawDescGZIP(), []int{22}
+}
+
+func (x *Subscribe) GetStartTime() int64 {
+	if x != nil {
+		return x.StartTime
+	}
+	return 0
+}
+
+func (x *Subscribe) GetEndTime() int64 {
+	if x != nil {
+		return x.EndTime
+	}
+	return 0
+}
+
+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
+}
+
+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_userCenter_proto_msgTypes[23]
+		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_userCenter_proto_msgTypes[23]
+	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_userCenter_proto_rawDescGZIP(), []int{23}
+}
+
+func (x *List) GetValue() []string {
+	if x != nil {
+		return x.Value
+	}
+	return nil
+}
+
+//分类
+type Items struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	SItem      string  `protobuf:"bytes,1,opt,name=s_item,json=sItem,proto3" json:"s_item,omitempty"` //分类名称
+	UpdateTime int64   `protobuf:"varint,2,opt,name=updateTime,proto3" json:"updateTime,omitempty"`
+	AKey       []*Keys `protobuf:"bytes,3,rep,name=a_key,json=aKey,proto3" json:"a_key,omitempty"`
+}
+
+func (x *Items) Reset() {
+	*x = Items{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[24]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Items) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Items) ProtoMessage() {}
+
+func (x *Items) ProtoReflect() protoreflect.Message {
+	mi := &file_userCenter_proto_msgTypes[24]
+	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 Items.ProtoReflect.Descriptor instead.
+func (*Items) Descriptor() ([]byte, []int) {
+	return file_userCenter_proto_rawDescGZIP(), []int{24}
+}
+
+func (x *Items) GetSItem() string {
+	if x != nil {
+		return x.SItem
+	}
+	return ""
+}
+
+func (x *Items) GetUpdateTime() int64 {
+	if x != nil {
+		return x.UpdateTime
+	}
+	return 0
+}
+
+func (x *Items) GetAKey() []*Keys {
+	if x != nil {
+		return x.AKey
+	}
+	return nil
+}
+
+//关键词
+type Keys struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Key        []string `protobuf:"bytes,1,rep,name=key,proto3" json:"key,omitempty"`
+	Notkey     []string `protobuf:"bytes,2,rep,name=notkey,proto3" json:"notkey,omitempty"`
+	UpdateTime int64    `protobuf:"varint,3,opt,name=updateTime,proto3" json:"updateTime,omitempty"`
+	Matchway   int64    `protobuf:"varint,4,opt,name=matchway,proto3" json:"matchway,omitempty"`
+}
+
+func (x *Keys) Reset() {
+	*x = Keys{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[25]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Keys) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Keys) ProtoMessage() {}
+
+func (x *Keys) ProtoReflect() protoreflect.Message {
+	mi := &file_userCenter_proto_msgTypes[25]
+	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 Keys.ProtoReflect.Descriptor instead.
+func (*Keys) Descriptor() ([]byte, []int) {
+	return file_userCenter_proto_rawDescGZIP(), []int{25}
+}
+
+func (x *Keys) GetKey() []string {
+	if x != nil {
+		return x.Key
+	}
+	return nil
+}
+
+func (x *Keys) GetNotkey() []string {
+	if x != nil {
+		return x.Notkey
+	}
+	return nil
+}
+
+func (x *Keys) GetUpdateTime() int64 {
+	if x != nil {
+		return x.UpdateTime
+	}
+	return 0
+}
+
+func (x *Keys) GetMatchway() int64 {
+	if x != nil {
+		return x.Matchway
+	}
+	return 0
+}
+
+type UserReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	AppId      string `protobuf:"bytes,1,opt,name=appId,proto3" json:"appId,omitempty"`
+	UserId     string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"`
+	BaseUserId int64  `protobuf:"varint,3,opt,name=baseUserId,proto3" json:"baseUserId,omitempty"`
+	Types      string `protobuf:"bytes,4,opt,name=types,proto3" json:"types,omitempty"` //类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
+	EntId      int64  `protobuf:"varint,5,opt,name=entId,proto3" json:"entId,omitempty"`
+	EntUserId  int64  `protobuf:"varint,6,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
+}
+
+func (x *UserReq) Reset() {
+	*x = UserReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_userCenter_proto_msgTypes[26]
+		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_userCenter_proto_msgTypes[26]
+	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_userCenter_proto_rawDescGZIP(), []int{26}
+}
+
+func (x *UserReq) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *UserReq) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
+func (x *UserReq) GetBaseUserId() int64 {
+	if x != nil {
+		return x.BaseUserId
+	}
+	return 0
+}
+
+func (x *UserReq) GetTypes() string {
+	if x != nil {
+		return x.Types
+	}
+	return ""
+}
+
+func (x *UserReq) GetEntId() int64 {
+	if x != nil {
+		return x.EntId
+	}
+	return 0
+}
+
+func (x *UserReq) GetEntUserId() int64 {
+	if x != nil {
+		return x.EntUserId
+	}
+	return 0
+}
+
 type ExamineResp_ExamineData struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1742,7 +2220,7 @@ type ExamineResp_ExamineData struct {
 func (x *ExamineResp_ExamineData) Reset() {
 	*x = ExamineResp_ExamineData{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_userCenter_proto_msgTypes[21]
+		mi := &file_userCenter_proto_msgTypes[27]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -1755,7 +2233,7 @@ func (x *ExamineResp_ExamineData) String() string {
 func (*ExamineResp_ExamineData) ProtoMessage() {}
 
 func (x *ExamineResp_ExamineData) ProtoReflect() protoreflect.Message {
-	mi := &file_userCenter_proto_msgTypes[21]
+	mi := &file_userCenter_proto_msgTypes[27]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -1790,7 +2268,7 @@ type CheckEntRespCheckData struct {
 func (x *CheckEntRespCheckData) Reset() {
 	*x = CheckEntRespCheckData{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_userCenter_proto_msgTypes[22]
+		mi := &file_userCenter_proto_msgTypes[28]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -1803,7 +2281,7 @@ func (x *CheckEntRespCheckData) String() string {
 func (*CheckEntRespCheckData) ProtoMessage() {}
 
 func (x *CheckEntRespCheckData) ProtoReflect() protoreflect.Message {
-	mi := &file_userCenter_proto_msgTypes[22]
+	mi := &file_userCenter_proto_msgTypes[28]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -1845,7 +2323,7 @@ type GetStatusByCodeResp_GetStatusByCode struct {
 func (x *GetStatusByCodeResp_GetStatusByCode) Reset() {
 	*x = GetStatusByCodeResp_GetStatusByCode{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_userCenter_proto_msgTypes[23]
+		mi := &file_userCenter_proto_msgTypes[29]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -1858,7 +2336,7 @@ func (x *GetStatusByCodeResp_GetStatusByCode) String() string {
 func (*GetStatusByCodeResp_GetStatusByCode) ProtoMessage() {}
 
 func (x *GetStatusByCodeResp_GetStatusByCode) ProtoReflect() protoreflect.Message {
-	mi := &file_userCenter_proto_msgTypes[23]
+	mi := &file_userCenter_proto_msgTypes[29]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -2135,33 +2613,98 @@ var file_userCenter_proto_rawDesc = []byte{
 	0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, 0x75,
 	0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x49, 0x6e,
 	0x45, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x49, 0x6e, 0x45,
-	0x6e, 0x74, 0x32, 0x9a, 0x03, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x43, 0x65, 0x6e, 0x74, 0x65,
-	0x72, 0x12, 0x24, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x12, 0x0b, 0x2e, 0x45,
-	0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x41,
-	0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x0a, 0x45, 0x6e, 0x74, 0x45, 0x78,
-	0x61, 0x6d, 0x69, 0x6e, 0x65, 0x12, 0x0b, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52,
-	0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x24, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0b, 0x2e, 0x45, 0x6e,
-	0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x4c, 0x69,
-	0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e,
-	0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x4c,
-	0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65,
-	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63,
-	0x6b, 0x45, 0x6e, 0x74, 0x12, 0x0c, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x52,
-	0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x52, 0x65, 0x73,
-	0x70, 0x12, 0x25, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0c, 0x2e, 0x43,
-	0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74,
-	0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x09, 0x45, 0x6e, 0x74, 0x55,
-	0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0d, 0x2e, 0x45, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74,
-	0x65, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x49, 0x6e, 0x66,
-	0x6f, 0x12, 0x10, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65,
-	0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
-	0x70, 0x12, 0x3c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x79,
-	0x43, 0x6f, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
-	0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x47, 0x65, 0x74, 0x53,
-	0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42,
-	0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6e, 0x74, 0x22, 0x8c, 0x02, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12,
+	0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
+	0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x69, 0x70, 0x53, 0x74, 0x61, 0x74,
+	0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x76, 0x69, 0x70, 0x53, 0x74, 0x61,
+	0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x74, 0x61,
+	0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x65, 0x6d, 0x62, 0x65,
+	0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x65, 0x6e, 0x74, 0x6e, 0x69,
+	0x63, 0x68, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0e, 0x65, 0x6e, 0x74, 0x6e, 0x69, 0x63, 0x68, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
+	0x24, 0x0a, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x54, 0x79, 0x70, 0x65,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
+	0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20,
+	0x01, 0x28, 0x0b, 0x32, 0x0a, 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, 0x07, 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, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64,
+	0x65, 0x22, 0xc7, 0x02, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12,
+	0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a,
+	0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
+	0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18,
+	0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 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,
+	0x04, 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, 0x05, 0x20,
+	0x03, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x66, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a,
+	0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x06, 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, 0x07, 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, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70,
+	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x3e, 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, 0x1b, 0x0a, 0x05, 0x76, 0x61,
+	0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x4c, 0x69, 0x73, 0x74,
+	0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 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, 0x5a, 0x0a, 0x05, 0x49, 0x74, 0x65,
+	0x6d, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x64,
+	0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x75,
+	0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x05, 0x61, 0x5f, 0x6b,
+	0x65, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x52,
+	0x04, 0x61, 0x4b, 0x65, 0x79, 0x22, 0x6c, 0x0a, 0x04, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x10, 0x0a,
+	0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
+	0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52,
+	0x06, 0x6e, 0x6f, 0x74, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74,
+	0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64,
+	0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68,
+	0x77, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68,
+	0x77, 0x61, 0x79, 0x22, 0xa1, 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, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a,
+	0x0a, 0x62, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a,
+	0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x79,
+	0x70, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74,
+	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e,
+	0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x32, 0xbe, 0x03, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72,
+	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x41, 0x75, 0x74,
+	0x68, 0x12, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0c,
+	0x2e, 0x45, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x0a,
+	0x45, 0x6e, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x12, 0x0b, 0x2e, 0x45, 0x78, 0x61,
+	0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e,
+	0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74,
+	0x12, 0x0b, 0x2e, 0x45, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e,
+	0x45, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b, 0x45,
+	0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f, 0x2e, 0x45, 0x78, 0x61,
+	0x6d, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x45, 0x78,
+	0x61, 0x6d, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a,
+	0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x12, 0x0c, 0x2e, 0x43, 0x68, 0x65, 0x63,
+	0x6b, 0x45, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45,
+	0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x07, 0x45, 0x6e, 0x74, 0x49, 0x6e, 0x66,
+	0x6f, 0x12, 0x0c, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a,
+	0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a,
+	0x09, 0x45, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0d, 0x2e, 0x45, 0x6e, 0x74,
+	0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d,
+	0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x69,
+	0x6e, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x45, 0x78,
+	0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x6e, 0x74, 0x49, 0x6e,
+	0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61,
+	0x74, 0x75, 0x73, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x53,
+	0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x14,
+	0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x22, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49,
+	0x6e, 0x66, 0x6f, 0x12, 0x08, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e,
+	0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
+	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -2176,7 +2719,7 @@ func file_userCenter_proto_rawDescGZIP() []byte {
 	return file_userCenter_proto_rawDescData
 }
 
-var file_userCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
+var file_userCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 31)
 var file_userCenter_proto_goTypes = []interface{}{
 	(*EntAuthReq)(nil),                          // 0: EntAuthReq
 	(*EntAuthResp)(nil),                         // 1: EntAuthResp
@@ -2199,43 +2742,57 @@ var file_userCenter_proto_goTypes = []interface{}{
 	(*CheckExamineReq)(nil),                     // 18: CheckExamineReq
 	(*GetStatusByCodeReq)(nil),                  // 19: GetStatusByCodeReq
 	(*GetStatusByCodeResp)(nil),                 // 20: GetStatusByCodeResp
-	(*ExamineResp_ExamineData)(nil),             // 21: ExamineResp.ExamineData
-	(*CheckEntRespCheckData)(nil),               // 22: CheckEntResp.checkData
-	(*GetStatusByCodeResp_GetStatusByCode)(nil), // 23: GetStatusByCodeResp.GetStatusByCode
+	(*UserInfo)(nil),                            // 21: UserInfo
+	(*Subscribe)(nil),                           // 22: Subscribe
+	(*List)(nil),                                // 23: List
+	(*Items)(nil),                               // 24: Items
+	(*Keys)(nil),                                // 25: Keys
+	(*UserReq)(nil),                             // 26: UserReq
+	(*ExamineResp_ExamineData)(nil),             // 27: ExamineResp.ExamineData
+	(*CheckEntRespCheckData)(nil),               // 28: CheckEntResp.checkData
+	(*GetStatusByCodeResp_GetStatusByCode)(nil), // 29: GetStatusByCodeResp.GetStatusByCode
+	nil, // 30: Subscribe.AreaEntry
 }
 var file_userCenter_proto_depIdxs = []int32{
 	2,  // 0: EntAuthResp.data:type_name -> EntAuthData
-	21, // 1: ExamineResp.data:type_name -> ExamineResp.ExamineData
+	27, // 1: ExamineResp.data:type_name -> ExamineResp.ExamineData
 	7,  // 2: EntListResp.data:type_name -> EntData
 	8,  // 3: EntData.list:type_name -> EntList
 	11, // 4: ExamineListResp.data:type_name -> ExamineListData
 	12, // 5: ExamineListData.list:type_name -> ExamineList
-	22, // 6: CheckEntResp.data:type_name -> CheckEntResp.checkData
+	28, // 6: CheckEntResp.data:type_name -> CheckEntResp.checkData
 	16, // 7: EntInfoResp.data:type_name -> EntInfoData
-	23, // 8: GetStatusByCodeResp.data:type_name -> GetStatusByCodeResp.GetStatusByCode
-	0,  // 9: UserCenter.EntAuth:input_type -> EntAuthReq
-	3,  // 10: UserCenter.EntExamine:input_type -> ExamineReq
-	5,  // 11: UserCenter.EntList:input_type -> EntListReq
-	9,  // 12: UserCenter.ExamineList:input_type -> ExamineListReq
-	13, // 13: UserCenter.CheckEnt:input_type -> CheckEntReq
-	13, // 14: UserCenter.EntInfo:input_type -> CheckEntReq
-	17, // 15: UserCenter.EntUpdate:input_type -> EntUpdateReq
-	18, // 16: UserCenter.ExamineInfo:input_type -> CheckExamineReq
-	19, // 17: UserCenter.GetStatusByCode:input_type -> GetStatusByCodeReq
-	1,  // 18: UserCenter.EntAuth:output_type -> EntAuthResp
-	4,  // 19: UserCenter.EntExamine:output_type -> ExamineResp
-	6,  // 20: UserCenter.EntList:output_type -> EntListResp
-	10, // 21: UserCenter.ExamineList:output_type -> ExamineListResp
-	14, // 22: UserCenter.CheckEnt:output_type -> CheckEntResp
-	15, // 23: UserCenter.EntInfo:output_type -> EntInfoResp
-	4,  // 24: UserCenter.EntUpdate:output_type -> ExamineResp
-	15, // 25: UserCenter.ExamineInfo:output_type -> EntInfoResp
-	20, // 26: UserCenter.GetStatusByCode:output_type -> GetStatusByCodeResp
-	18, // [18:27] is the sub-list for method output_type
-	9,  // [9:18] 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
+	29, // 8: GetStatusByCodeResp.data:type_name -> GetStatusByCodeResp.GetStatusByCode
+	22, // 9: UserInfo.data:type_name -> Subscribe
+	30, // 10: Subscribe.area:type_name -> Subscribe.AreaEntry
+	24, // 11: Subscribe.items:type_name -> Items
+	25, // 12: Items.a_key:type_name -> Keys
+	23, // 13: Subscribe.AreaEntry.value:type_name -> List
+	0,  // 14: UserCenter.EntAuth:input_type -> EntAuthReq
+	3,  // 15: UserCenter.EntExamine:input_type -> ExamineReq
+	5,  // 16: UserCenter.EntList:input_type -> EntListReq
+	9,  // 17: UserCenter.ExamineList:input_type -> ExamineListReq
+	13, // 18: UserCenter.CheckEnt:input_type -> CheckEntReq
+	13, // 19: UserCenter.EntInfo:input_type -> CheckEntReq
+	17, // 20: UserCenter.EntUpdate:input_type -> EntUpdateReq
+	18, // 21: UserCenter.ExamineInfo:input_type -> CheckExamineReq
+	19, // 22: UserCenter.GetStatusByCode:input_type -> GetStatusByCodeReq
+	26, // 23: UserCenter.GetUserInfo:input_type -> UserReq
+	1,  // 24: UserCenter.EntAuth:output_type -> EntAuthResp
+	4,  // 25: UserCenter.EntExamine:output_type -> ExamineResp
+	6,  // 26: UserCenter.EntList:output_type -> EntListResp
+	10, // 27: UserCenter.ExamineList:output_type -> ExamineListResp
+	14, // 28: UserCenter.CheckEnt:output_type -> CheckEntResp
+	15, // 29: UserCenter.EntInfo:output_type -> EntInfoResp
+	4,  // 30: UserCenter.EntUpdate:output_type -> ExamineResp
+	15, // 31: UserCenter.ExamineInfo:output_type -> EntInfoResp
+	20, // 32: UserCenter.GetStatusByCode:output_type -> GetStatusByCodeResp
+	21, // 33: UserCenter.GetUserInfo:output_type -> UserInfo
+	24, // [24:34] is the sub-list for method output_type
+	14, // [14:24] is the sub-list for method input_type
+	14, // [14:14] is the sub-list for extension type_name
+	14, // [14:14] is the sub-list for extension extendee
+	0,  // [0:14] is the sub-list for field type_name
 }
 
 func init() { file_userCenter_proto_init() }
@@ -2497,7 +3054,7 @@ func file_userCenter_proto_init() {
 			}
 		}
 		file_userCenter_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*ExamineResp_ExamineData); i {
+			switch v := v.(*UserInfo); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -2509,7 +3066,7 @@ func file_userCenter_proto_init() {
 			}
 		}
 		file_userCenter_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*CheckEntRespCheckData); i {
+			switch v := v.(*Subscribe); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -2521,6 +3078,78 @@ func file_userCenter_proto_init() {
 			}
 		}
 		file_userCenter_proto_msgTypes[23].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_userCenter_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Items); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*Keys); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[26].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_userCenter_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ExamineResp_ExamineData); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*CheckEntRespCheckData); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_userCenter_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*GetStatusByCodeResp_GetStatusByCode); i {
 			case 0:
 				return &v.state
@@ -2539,7 +3168,7 @@ func file_userCenter_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_userCenter_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   24,
+			NumMessages:   31,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 38 - 0
rpc/pb/userCenter_grpc.pb.go

@@ -40,6 +40,8 @@ type UserCenterClient interface {
 	ExamineInfo(ctx context.Context, in *CheckExamineReq, opts ...grpc.CallOption) (*EntInfoResp, error)
 	//根据统一社会信用代码查询企业状态
 	GetStatusByCode(ctx context.Context, in *GetStatusByCodeReq, opts ...grpc.CallOption) (*GetStatusByCodeResp, error)
+	//获取客户信息
+	GetUserInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserInfo, error)
 }
 
 type userCenterClient struct {
@@ -131,6 +133,15 @@ func (c *userCenterClient) GetStatusByCode(ctx context.Context, in *GetStatusByC
 	return out, nil
 }
 
+func (c *userCenterClient) GetUserInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserInfo, error) {
+	out := new(UserInfo)
+	err := c.cc.Invoke(ctx, "/UserCenter/GetUserInfo", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // UserCenterServer is the server API for UserCenter service.
 // All implementations must embed UnimplementedUserCenterServer
 // for forward compatibility
@@ -153,6 +164,8 @@ type UserCenterServer interface {
 	ExamineInfo(context.Context, *CheckExamineReq) (*EntInfoResp, error)
 	//根据统一社会信用代码查询企业状态
 	GetStatusByCode(context.Context, *GetStatusByCodeReq) (*GetStatusByCodeResp, error)
+	//获取客户信息
+	GetUserInfo(context.Context, *UserReq) (*UserInfo, error)
 	mustEmbedUnimplementedUserCenterServer()
 }
 
@@ -187,6 +200,9 @@ func (UnimplementedUserCenterServer) ExamineInfo(context.Context, *CheckExamineR
 func (UnimplementedUserCenterServer) GetStatusByCode(context.Context, *GetStatusByCodeReq) (*GetStatusByCodeResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetStatusByCode not implemented")
 }
+func (UnimplementedUserCenterServer) GetUserInfo(context.Context, *UserReq) (*UserInfo, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetUserInfo not implemented")
+}
 func (UnimplementedUserCenterServer) mustEmbedUnimplementedUserCenterServer() {}
 
 // UnsafeUserCenterServer may be embedded to opt out of forward compatibility for this service.
@@ -362,6 +378,24 @@ func _UserCenter_GetStatusByCode_Handler(srv interface{}, ctx context.Context, d
 	return interceptor(ctx, in, info, handler)
 }
 
+func _UserCenter_GetUserInfo_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.(UserCenterServer).GetUserInfo(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/UserCenter/GetUserInfo",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(UserCenterServer).GetUserInfo(ctx, req.(*UserReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // UserCenter_ServiceDesc is the grpc.ServiceDesc for UserCenter service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -405,6 +439,10 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "GetStatusByCode",
 			Handler:    _UserCenter_GetStatusByCode_Handler,
 		},
+		{
+			MethodName: "GetUserInfo",
+			Handler:    _UserCenter_GetUserInfo_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "userCenter.proto",

+ 16 - 0
rpc/test/ent_test.go

@@ -199,3 +199,19 @@ func Test_ExamineList(t *testing.T) {
 	log.Println("err ", err)
 	log.Println("res:", res)
 }
+
+// go test -v -run Test_UserInfo
+func Test_UserInfo(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+	FileSystem := usercenterclient.NewUserCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &pb.UserReq{
+		UserId:    "62a94797784e2a5b4b1688d1",
+		Types:     "f",
+		EntId:     14904,
+		EntUserId: 4253,
+	}
+
+	res, err := FileSystem.GetUserInfo(ctx, req)
+	log.Println("err ", err)
+	log.Println("res:", res)
+}

+ 5 - 1
rpc/test/usercenter.yaml

@@ -27,4 +27,8 @@ Mysql:
   userName: root
   passWord: Topnet123
   maxOpenConns: 5
-  maxIdleConns: 5
+  maxIdleConns: 5
+Mongo:
+  dbName: qfw
+  size: 5
+  address: 192.168.3.206:27080

+ 54 - 0
rpc/userCenter.proto

@@ -199,6 +199,58 @@ message GetStatusByCodeResp{
 	GetStatusByCode data = 3; //详情
 }
 
+//用户权益
+message UserInfo{
+	string phone =1;//手机号
+	int64 vipStatus =2;//超级订阅状态; >0有权限 <=0无权限
+	int64 memberStatus =3;//大会员状态;  >0:有权限  <=0:无权限
+	int64 entnicheStatus=4;//商机管理权限状态; 1:有权限   -1:无权限
+	string subscribeType =5;//订阅设置类型 f:免费订阅 v:超级订阅 m:大会员订阅 e:商机管理订阅
+	Subscribe data =6;
+    	string error_msg = 7;
+	int64 error_code = 8; 
+}
+
+//订阅设置
+message Subscribe{
+	int64 startTime =1;//开始时间
+	int64 endTime =2;//结束时间
+    map<string,List> area =3;//地区
+    repeated string buyerclass=4;//采购单位类型
+    repeated string infotype=5;//信息类型
+    repeated Items items =6;//关键词
+    int64 matchway =7;//匹配方式 1标题 2正文
+    int64 projectmatch=8;//项目匹配 
+}
+
+message List{
+	repeated string value =1;
+}
+
+//分类
+message Items{
+	string s_item =1;//分类名称
+	int64 updateTime=2;
+	repeated Keys a_key=3;
+}
+
+//关键词
+message Keys {
+	repeated string key =1;
+	repeated string notkey=2;
+	int64 updateTime=3; 
+	int64 matchway=4;
+}
+
+message UserReq{
+	string appId =1;
+	string userId =2;
+	int64 baseUserId=3;
+	string types =4;//类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
+	int64 entId =5;
+	int64 entUserId =6;
+}
+
 service UserCenter {
 	//企业认证
 	rpc EntAuth (EntAuthReq) returns (EntAuthResp);
@@ -218,4 +270,6 @@ service UserCenter {
 	rpc ExamineInfo(CheckExamineReq) returns (EntInfoResp);
 	//根据统一社会信用代码查询企业状态
 	rpc GetStatusByCode(GetStatusByCodeReq) returns(GetStatusByCodeResp);
+	//获取客户信息
+	rpc GetUserInfo(UserReq) returns(UserInfo);
 }

+ 14 - 0
rpc/usercenter/usercenter.go

@@ -37,6 +37,12 @@ type (
 	GetStatusByCodeReq                  = pb.GetStatusByCodeReq
 	GetStatusByCodeResp                 = pb.GetStatusByCodeResp
 	GetStatusByCodeResp_GetStatusByCode = pb.GetStatusByCodeResp_GetStatusByCode
+	Items                               = pb.Items
+	Keys                                = pb.Keys
+	List                                = pb.List
+	Subscribe                           = pb.Subscribe
+	UserInfo                            = pb.UserInfo
+	UserReq                             = pb.UserReq
 
 	UserCenter interface {
 		// 企业认证
@@ -57,6 +63,8 @@ type (
 		ExamineInfo(ctx context.Context, in *CheckExamineReq, opts ...grpc.CallOption) (*EntInfoResp, error)
 		// 根据统一社会信用代码查询企业状态
 		GetStatusByCode(ctx context.Context, in *GetStatusByCodeReq, opts ...grpc.CallOption) (*GetStatusByCodeResp, error)
+		// 获取客户信息
+		GetUserInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserInfo, error)
 	}
 
 	defaultUserCenter struct {
@@ -123,3 +131,9 @@ func (m *defaultUserCenter) GetStatusByCode(ctx context.Context, in *GetStatusBy
 	client := pb.NewUserCenterClient(m.cli.Conn())
 	return client.GetStatusByCode(ctx, in, opts...)
 }
+
+// 获取客户信息
+func (m *defaultUserCenter) GetUserInfo(ctx context.Context, in *UserReq, opts ...grpc.CallOption) (*UserInfo, error) {
+	client := pb.NewUserCenterClient(m.cli.Conn())
+	return client.GetUserInfo(ctx, in, opts...)
+}

+ 22 - 0
service/subscribe.go

@@ -0,0 +1,22 @@
+package service
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/userCenter/entity"
+	userCenter "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
+)
+
+type SubscribeService struct{}
+
+//获取用户订阅信息  优先大会员、然后商机管理、然后超级订阅、然后免费订阅
+func (this *SubscribeService) GetSubscribeInfo(data *userCenter.UserReq) (map[string]interface{}, string) {
+	info := entity.UserInfoReq{
+		Mysql:      entity.Mysql,
+		Mgo:        entity.Mgo,
+		UserId:     data.UserId,
+		BaseUserId: data.BaseUserId,
+		Types:      data.Types,
+		EntId:      data.EntId,
+		EntUserId:  data.EntUserId,
+	}
+	return info.GetUserInfo()
+}