Prechádzať zdrojové kódy

feat:常用功能列表

wangshan 3 rokov pred
rodič
commit
f921b171c6

BIN
api/api.exe


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

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

+ 1 - 0
api/internal/logic/workdesktopcomprehensivelogic.go

@@ -42,5 +42,6 @@ func (l *WorkDesktopComprehensiveLogic) WorkDesktopComprehensive(req *types.Work
 	return &types.CommonResp{
 		Error_code: res.ErrorCode,
 		Error_msg:  res.ErrorMsg,
+		Data:       res.Data,
 	}, err
 }

+ 1 - 1
api/internal/types/types.go

@@ -234,7 +234,7 @@ type WorkDesktopComprehensiveReq struct {
 	Phone      string `header:"phone,optional"`
 	MenuMode   string `json:"menuMode,optional"`
 	MenuIds    string `json:"menuIds,optional"`
-	ActionMode string `path:"actionMode,options=commonly|menuMode"`
+	ActionMode string `path:"actionMode,options=commonlyRenew|commonlyList|menuMode"`
 }
 
 type CommonResp struct {

+ 1 - 1
api/userCenter.api

@@ -249,7 +249,7 @@ type (
 		Phone      string `header:"phone,optional"`
 		MenuMode   string `json:"menuMode,optional"`
 		MenuIds    string `json:"menuIds,optional"`
-		ActionMode string `path:"actionMode,options=commonly|menuMode"`
+		ActionMode string `path:"actionMode,options=commonlyRenew|commonlyList|menuMode"`
 	}
 	//
 	CommonResp {

+ 1 - 1
entity/user.go

@@ -46,7 +46,7 @@ func AutoUserPowerInfo(userId string, internalTime int, bigMemberOff bool) map[s
 			if phone != "" {
 				//商机管理用户
 				//同一个手机号 多个商机管理角色 其中一个是企业管理员或者部门管理员 查的时候按角色权重排序
-				entNicheInfos := Mysql.SelectBySql(`SELECT i.isNew,r.role_id  FROM (entniche_user u LEFT JOIN entniche_user_role r ON r.user_id = u.id)  LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone = 13000000727 and u.power=1 and i.status=1 ORDER BY r.role_id DESC`, phone)
+				entNicheInfos := Mysql.SelectBySql(`SELECT i.isNew,r.role_id  FROM (entniche_user u LEFT JOIN entniche_user_role r ON r.user_id = u.id)  LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone = ? and u.power=1 and i.status=1 ORDER BY r.role_id DESC`, phone)
 				//商机管理用户信息判断
 				if entNicheInfos != nil && len(*entNicheInfos) > 0 {
 					entNicheInfo := (*entNicheInfos)[0]

+ 11 - 4
entity/workDesktop.go

@@ -6,6 +6,7 @@ import (
 	"database/sql"
 	"github.com/zeromicro/go-zero/core/logx"
 	"sort"
+	"strconv"
 	"strings"
 	"userCenter/rpc/pb"
 )
@@ -84,6 +85,7 @@ func (m *WorkDesktopMenu) WorkMenuFormat() ([]*pb.MenuList, error) {
 			Name:   mv.Name,
 			Icon:   mv.Icon,
 			Url:    mv.Url,
+			Id:     encrypt.SE.EncodeString(strconv.Itoa(mv.Id)), //功能id加密
 			Usable: MC.If(mv.PowerIds != "", usable && mv.CheckCode == 1, true).(bool),
 			Child:  []*pb.SecondLevelMenu{},
 		}
@@ -99,6 +101,7 @@ func (m *WorkDesktopMenu) WorkMenuFormat() ([]*pb.MenuList, error) {
 					Name:   sv.Name,
 					Icon:   sv.Icon,
 					Url:    sv.Url,
+					Id:     encrypt.SE.EncodeString(strconv.Itoa(sv.Id)), //功能id加密
 					Usable: MC.If(mv.PowerIds != "", usable && mv.CheckCode == 1, true).(bool),
 					Child:  []*pb.ThreeLevelMenu{},
 				}
@@ -114,10 +117,10 @@ func (m *WorkDesktopMenu) WorkMenuFormat() ([]*pb.MenuList, error) {
 							Name:     tv.Name,
 							Icon:     tv.Icon,
 							Url:      tv.Url,
+							Id:       encrypt.SE.EncodeString(strconv.Itoa(tv.Id)), //功能id加密
 							Usable:   MC.If(mv.PowerIds != "", usable && mv.CheckCode == 1, true).(bool),
 							AppType:  tv.AppType,
 							OpenType: tv.OpenType,
-							IsCheck:  tv.CheckCode > 0, //0:默认展示;1:需验证权限,有权限展示;2:需验证权限,无权限也可展示(可用服务无权限不展示)
 							TipInfo: &pb.TipInfo{
 								Title:        tv.AdditionalInfo.Title,
 								Content:      tv.AdditionalInfo.Content,
@@ -218,10 +221,14 @@ var (
 )
 
 //更新常用功能
-func CommonlyUpdate(in *pb.WorkDesktopComprehensiveReq) (B bool, M string) {
+func CommonlyUpdate(in *pb.WorkDesktopComprehensiveReq, size int) (B bool, M string) {
 	//事务  1:查; 2: 存;3: 删;
 	var ids []string
-	for _, mid := range strings.Split(in.MenuIds, ",") {
+	for mk, mid := range strings.Split(in.MenuIds, ",") {
+		//常用功能数量限制
+		if size > 0 && mk >= size {
+			break
+		}
 		//id 解密
 		ids = append(ids, encrypt.SE.DecodeString(mid))
 	}
@@ -240,7 +247,7 @@ func CommonlyUpdate(in *pb.WorkDesktopComprehensiveReq) (B bool, M string) {
 				return false
 			}
 		default: //插入
-			if BaseMysql.InsertBySqlByTx(tx, `INSERT INTO work_commonly  (appid,userid,platform,field,value) VALUES (?,?,?,?,?)`, in.AppId, in.UserId, in.Platform, in.ActionMode, strings.Join(ids, ",")) < 0 {
+			if BaseMysql.InsertBySqlByTx(tx, `INSERT INTO `+WorkCommonly+`  (appid,userid,platform,field,value) VALUES (?,?,?,?,?)`, in.AppId, in.UserId, in.Platform, in.ActionMode, strings.Join(ids, ",")) < 0 {
 				logx.Info("常用功能-插入数据失败")
 				return false
 			}

+ 1 - 1
go.mod

@@ -7,7 +7,6 @@ require (
 	app.yhyue.com/moapp/jybase v0.0.0-20220719064915-2fef79005dfa
 	bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4
 	bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.1
-	github.com/golang/protobuf v1.5.2
 	github.com/zeromicro/go-zero v1.3.5
 	google.golang.org/grpc v1.48.0
 	google.golang.org/protobuf v1.28.0
@@ -31,6 +30,7 @@ require (
 	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

+ 2 - 1
rpc/etc/usercenter.yaml

@@ -48,4 +48,5 @@ Mongo:
     dbName: qfw
     size: 50
     address: 192.168.3.206:27080
-BigMemberOff: false
+BigMemberOff: false
+CommonlySize: 10

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

@@ -28,6 +28,7 @@ type Config struct {
 		Main *MongoStruct
 	}
 	BigMemberOff bool
+	CommonlySize int //常用功能设置数量
 }
 type MongoStruct struct {
 	Address        string `json:"address"`

+ 5 - 3
rpc/internal/logic/workdesktopcomprehensivelogic.go

@@ -3,6 +3,7 @@ package logic
 import (
 	"context"
 	"github.com/zeromicro/go-zero/core/logx"
+	"userCenter/rpc/internal/config"
 	"userCenter/rpc/internal/svc"
 	"userCenter/rpc/pb"
 	"userCenter/service"
@@ -22,8 +23,9 @@ func NewWorkDesktopComprehensiveLogic(ctx context.Context, svcCtx *svc.ServiceCo
 	}
 }
 
-// 菜单选择模式
+//工作桌面--菜单当前选择模式--全部:all/可用:usable
+//工作桌面--常用功能更新
+//工作桌面--常用功能列表
 func (l *WorkDesktopComprehensiveLogic) WorkDesktopComprehensive(in *pb.WorkDesktopComprehensiveReq) (*pb.WorkDesktopComprehensiveResp, error) {
-
-	return service.RenewWorkDesktopMenuModeOrCommonly(in), nil
+	return service.RenewWorkDesktopMenuModeOrCommonly(in, config.ConfigJson.CommonlySize, config.ConfigJson.RedisOutTime, config.ConfigJson.BigMemberOff), nil
 }

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

@@ -55,6 +55,8 @@ func (l *WorkDesktopMenuInfoLogic) WorkDesktopMenuInfo(in *pb.WorkDesktopMenuInf
 	)
 	//菜单树
 	menuList, err := service.GetWordDesktopMenuTree(in, config.ConfigJson.RedisOutTime, config.ConfigJson.BigMemberOff)
+	//菜单模式
+	menuMode, err = service.GetWorkDesktopMenuMode(in)
 	logx.Info(err, "+++++:", len(menuList))
 	if err != nil {
 		errorCode = -1

+ 160 - 131
rpc/pb/userCenter.pb.go

@@ -2452,7 +2452,8 @@ type MenuList struct {
 	Icon   string             `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"`
 	Url    string             `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
 	Usable bool               `protobuf:"varint,4,opt,name=usable,proto3" json:"usable,omitempty"`
-	Child  []*SecondLevelMenu `protobuf:"bytes,5,rep,name=child,proto3" json:"child,omitempty"`
+	Id     string             `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
+	Child  []*SecondLevelMenu `protobuf:"bytes,6,rep,name=child,proto3" json:"child,omitempty"`
 }
 
 func (x *MenuList) Reset() {
@@ -2515,6 +2516,13 @@ func (x *MenuList) GetUsable() bool {
 	return false
 }
 
+func (x *MenuList) GetId() string {
+	if x != nil {
+		return x.Id
+	}
+	return ""
+}
+
 func (x *MenuList) GetChild() []*SecondLevelMenu {
 	if x != nil {
 		return x.Child
@@ -2531,7 +2539,8 @@ type SecondLevelMenu struct {
 	Icon   string            `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"`
 	Url    string            `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
 	Usable bool              `protobuf:"varint,4,opt,name=usable,proto3" json:"usable,omitempty"`
-	Child  []*ThreeLevelMenu `protobuf:"bytes,5,rep,name=child,proto3" json:"child,omitempty"`
+	Id     string            `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
+	Child  []*ThreeLevelMenu `protobuf:"bytes,6,rep,name=child,proto3" json:"child,omitempty"`
 }
 
 func (x *SecondLevelMenu) Reset() {
@@ -2594,6 +2603,13 @@ func (x *SecondLevelMenu) GetUsable() bool {
 	return false
 }
 
+func (x *SecondLevelMenu) GetId() string {
+	if x != nil {
+		return x.Id
+	}
+	return ""
+}
+
 func (x *SecondLevelMenu) GetChild() []*ThreeLevelMenu {
 	if x != nil {
 		return x.Child
@@ -2610,9 +2626,9 @@ type ThreeLevelMenu struct {
 	Icon     string   `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"`
 	Url      string   `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
 	Usable   bool     `protobuf:"varint,4,opt,name=usable,proto3" json:"usable,omitempty"`
-	AppType  string   `protobuf:"bytes,5,opt,name=appType,proto3" json:"appType,omitempty"`
-	OpenType string   `protobuf:"bytes,6,opt,name=openType,proto3" json:"openType,omitempty"`
-	IsCheck  bool     `protobuf:"varint,7,opt,name=isCheck,proto3" json:"isCheck,omitempty"`
+	Id       string   `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
+	AppType  string   `protobuf:"bytes,6,opt,name=appType,proto3" json:"appType,omitempty"`
+	OpenType string   `protobuf:"bytes,7,opt,name=openType,proto3" json:"openType,omitempty"`
 	TipInfo  *TipInfo `protobuf:"bytes,8,opt,name=tipInfo,proto3" json:"tipInfo,omitempty"`
 }
 
@@ -2676,25 +2692,25 @@ func (x *ThreeLevelMenu) GetUsable() bool {
 	return false
 }
 
-func (x *ThreeLevelMenu) GetAppType() string {
+func (x *ThreeLevelMenu) GetId() string {
 	if x != nil {
-		return x.AppType
+		return x.Id
 	}
 	return ""
 }
 
-func (x *ThreeLevelMenu) GetOpenType() string {
+func (x *ThreeLevelMenu) GetAppType() string {
 	if x != nil {
-		return x.OpenType
+		return x.AppType
 	}
 	return ""
 }
 
-func (x *ThreeLevelMenu) GetIsCheck() bool {
+func (x *ThreeLevelMenu) GetOpenType() string {
 	if x != nil {
-		return x.IsCheck
+		return x.OpenType
 	}
-	return false
+	return ""
 }
 
 func (x *ThreeLevelMenu) GetTipInfo() *TipInfo {
@@ -2886,8 +2902,9 @@ type WorkDesktopComprehensiveResp struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	ErrorCode int64  `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
-	ErrorMsg  string `protobuf:"bytes,2,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
+	ErrorCode int64             `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
+	ErrorMsg  string            `protobuf:"bytes,2,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
+	Data      []*ThreeLevelMenu `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
 }
 
 func (x *WorkDesktopComprehensiveResp) Reset() {
@@ -2936,6 +2953,13 @@ func (x *WorkDesktopComprehensiveResp) GetErrorMsg() string {
 	return ""
 }
 
+func (x *WorkDesktopComprehensiveResp) GetData() []*ThreeLevelMenu {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
 var File_userCenter_proto protoreflect.FileDescriptor
 
 var file_userCenter_proto_rawDesc = []byte{
@@ -3245,111 +3269,115 @@ var file_userCenter_proto_rawDesc = []byte{
 	0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6e, 0x75, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a,
 	0x08, 0x6d, 0x65, 0x6e, 0x75, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
 	0x09, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x6e, 0x75,
-	0x4c, 0x69, 0x73, 0x74, 0x22, 0x84, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x6e, 0x75, 0x4c, 0x69, 0x73,
+	0x4c, 0x69, 0x73, 0x74, 0x22, 0x94, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x6e, 0x75, 0x4c, 0x69, 0x73,
 	0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
 	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x02, 0x20,
 	0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c,
 	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x75,
 	0x73, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x61,
-	0x62, 0x6c, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x03,
+	0x62, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x03,
 	0x28, 0x0b, 0x32, 0x10, 0x2e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x4c, 0x65, 0x76, 0x65, 0x6c,
-	0x4d, 0x65, 0x6e, 0x75, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x22, 0x8a, 0x01, 0x0a, 0x0f,
+	0x4d, 0x65, 0x6e, 0x75, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x0f,
 	0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4d, 0x65, 0x6e, 0x75, 0x12,
 	0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
 	0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
 	0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x61,
 	0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x61, 0x62, 0x6c,
-	0x65, 0x12, 0x25, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b,
+	0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69,
+	0x64, 0x12, 0x25, 0x0a, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b,
 	0x32, 0x0f, 0x2e, 0x54, 0x68, 0x72, 0x65, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4d, 0x65, 0x6e,
-	0x75, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x22, 0xd6, 0x01, 0x0a, 0x0e, 0x54, 0x68, 0x72,
+	0x75, 0x52, 0x05, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x22, 0xcc, 0x01, 0x0a, 0x0e, 0x54, 0x68, 0x72,
 	0x65, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4d, 0x65, 0x6e, 0x75, 0x12, 0x12, 0x0a, 0x04, 0x6e,
 	0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
 	0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69,
 	0x63, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
 	0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x18,
-	0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a,
-	0x07, 0x61, 0x70, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
+	0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x0e, 0x0a,
+	0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a,
+	0x07, 0x61, 0x70, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
 	0x61, 0x70, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x54,
-	0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x54,
-	0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x07,
-	0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x22, 0x0a,
-	0x07, 0x74, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08,
-	0x2e, 0x54, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x74, 0x69, 0x70, 0x49, 0x6e, 0x66,
-	0x6f, 0x22, 0x9f, 0x01, 0x0a, 0x07, 0x54, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a,
-	0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69,
-	0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a,
-	0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x55, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a,
-	0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x54, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x54, 0x65, 0x78, 0x74, 0x12,
-	0x22, 0x0a, 0x0c, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18,
-	0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x43, 0x61, 0x6e,
-	0x63, 0x65, 0x6c, 0x22, 0xd3, 0x01, 0x0a, 0x1b, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b,
-	0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x76, 0x65,
-	0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61,
-	0x70, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49,
-	0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x14, 0x0a,
-	0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68,
-	0x6f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64,
-	0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d,
-	0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x6e, 0x75, 0x4d, 0x6f, 0x64, 0x65, 0x18,
-	0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6e, 0x75, 0x4d, 0x6f, 0x64, 0x65, 0x12,
-	0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6e, 0x75, 0x49, 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x07, 0x6d, 0x65, 0x6e, 0x75, 0x49, 0x64, 0x73, 0x22, 0x5a, 0x0a, 0x1c, 0x57, 0x6f, 0x72,
-	0x6b, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65,
-	0x6e, 0x73, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72,
-	0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65,
-	0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 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, 0x32, 0xb0, 0x05, 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, 0x24, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x12, 0x0b, 0x2e,
-	0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x55, 0x73, 0x65,
-	0x72, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72,
-	0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x0a, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52,
+	0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x54,
+	0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x74, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x08,
+	0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x54, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07,
+	0x74, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x9f, 0x01, 0x0a, 0x07, 0x54, 0x69, 0x70, 0x49,
+	0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
+	0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74,
+	0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x55, 0x72,
+	0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d,
+	0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x54, 0x65,
+	0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72,
+	0x6d, 0x54, 0x65, 0x78, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x43,
+	0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x53,
+	0x68, 0x6f, 0x77, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x22, 0xd3, 0x01, 0x0a, 0x1b, 0x57, 0x6f,
+	0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68,
+	0x65, 0x6e, 0x73, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65,
+	0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
+	0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66,
+	0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66,
+	0x6f, 0x72, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74,
+	0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61,
+	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x6e,
+	0x75, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6e,
+	0x75, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6e, 0x75, 0x49, 0x64, 0x73,
+	0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x6e, 0x75, 0x49, 0x64, 0x73, 0x22,
+	0x7f, 0x0a, 0x1c, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x43, 0x6f,
+	0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 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, 0x23, 0x0a, 0x04, 0x64,
+	0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x54, 0x68, 0x72, 0x65,
+	0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
+	0x32, 0xb0, 0x05, 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, 0x24, 0x0a,
+	0x07, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x12, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41,
+	0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64, 0x52,
+	0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74,
+	0x65, 0x12, 0x0a, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e,
+	0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x07, 0x55,
+	0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x12, 0x0a, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52,
 	0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x23, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x12, 0x0a, 0x2e, 0x55, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x69, 0x6e,
-	0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73,
-	0x6b, 0x74, 0x6f, 0x70, 0x4d, 0x65, 0x6e, 0x75, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x57,
-	0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x4d, 0x65, 0x6e, 0x75, 0x49, 0x6e,
-	0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b,
-	0x74, 0x6f, 0x70, 0x4d, 0x65, 0x6e, 0x75, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x57, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x43, 0x6f,
-	0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x76, 0x65, 0x12, 0x1c, 0x2e, 0x57, 0x6f,
+	0x12, 0x48, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x4d,
+	0x65, 0x6e, 0x75, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65,
+	0x73, 0x6b, 0x74, 0x6f, 0x70, 0x4d, 0x65, 0x6e, 0x75, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71,
+	0x1a, 0x18, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x4d, 0x65,
+	0x6e, 0x75, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, 0x0a, 0x18, 0x57, 0x6f,
 	0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68,
-	0x65, 0x6e, 0x73, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x57, 0x6f, 0x72, 0x6b,
-	0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e,
-	0x73, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
-	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x65, 0x6e, 0x73, 0x69, 0x76, 0x65, 0x12, 0x1c, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73,
+	0x6b, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x76,
+	0x65, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x73, 0x6b, 0x74,
+	0x6f, 0x70, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x68, 0x65, 0x6e, 0x73, 0x69, 0x76, 0x65, 0x52,
+	0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x33,
 }
 
 var (
@@ -3420,39 +3448,40 @@ var file_userCenter_proto_depIdxs = []int32{
 	32, // 12: MenuList.child:type_name -> SecondLevelMenu
 	33, // 13: SecondLevelMenu.child:type_name -> ThreeLevelMenu
 	34, // 14: ThreeLevelMenu.tipInfo:type_name -> TipInfo
-	0,  // 15: UserCenter.EntAuth:input_type -> EntAuthReq
-	3,  // 16: UserCenter.EntExamine:input_type -> ExamineReq
-	6,  // 17: UserCenter.EntList:input_type -> EntListReq
-	10, // 18: UserCenter.ExamineList:input_type -> ExamineListReq
-	14, // 19: UserCenter.CheckEnt:input_type -> CheckEntReq
-	14, // 20: UserCenter.EntInfo:input_type -> CheckEntReq
-	19, // 21: UserCenter.EntUpdate:input_type -> EntUpdateReq
-	20, // 22: UserCenter.ExamineInfo:input_type -> CheckExamineReq
-	21, // 23: UserCenter.GetStatusByCode:input_type -> GetStatusByCodeReq
-	24, // 24: UserCenter.UserAdd:input_type -> UserAddReq
-	27, // 25: UserCenter.UserUpdate:input_type -> UserIdReq
-	27, // 26: UserCenter.UserDel:input_type -> UserIdReq
-	28, // 27: UserCenter.WorkDesktopMenuInfo:input_type -> WorkDesktopMenuInfoReq
-	35, // 28: UserCenter.WorkDesktopComprehensive:input_type -> WorkDesktopComprehensiveReq
-	1,  // 29: UserCenter.EntAuth:output_type -> EntAuthResp
-	4,  // 30: UserCenter.EntExamine:output_type -> ExamineResp
-	7,  // 31: UserCenter.EntList:output_type -> EntListResp
-	11, // 32: UserCenter.ExamineList:output_type -> ExamineListResp
-	15, // 33: UserCenter.CheckEnt:output_type -> CheckEntResp
-	17, // 34: UserCenter.EntInfo:output_type -> EntInfoResp
-	4,  // 35: UserCenter.EntUpdate:output_type -> ExamineResp
-	17, // 36: UserCenter.ExamineInfo:output_type -> EntInfoResp
-	22, // 37: UserCenter.GetStatusByCode:output_type -> GetStatusByCodeResp
-	25, // 38: UserCenter.UserAdd:output_type -> UserAddResp
-	4,  // 39: UserCenter.UserUpdate:output_type -> ExamineResp
-	4,  // 40: UserCenter.UserDel:output_type -> ExamineResp
-	29, // 41: UserCenter.WorkDesktopMenuInfo:output_type -> WorkDesktopMenuInfoResp
-	36, // 42: UserCenter.WorkDesktopComprehensive:output_type -> WorkDesktopComprehensiveResp
-	29, // [29:43] is the sub-list for method output_type
-	15, // [15:29] is the sub-list for method input_type
-	15, // [15:15] is the sub-list for extension type_name
-	15, // [15:15] is the sub-list for extension extendee
-	0,  // [0:15] is the sub-list for field type_name
+	33, // 15: WorkDesktopComprehensiveResp.data:type_name -> ThreeLevelMenu
+	0,  // 16: UserCenter.EntAuth:input_type -> EntAuthReq
+	3,  // 17: UserCenter.EntExamine:input_type -> ExamineReq
+	6,  // 18: UserCenter.EntList:input_type -> EntListReq
+	10, // 19: UserCenter.ExamineList:input_type -> ExamineListReq
+	14, // 20: UserCenter.CheckEnt:input_type -> CheckEntReq
+	14, // 21: UserCenter.EntInfo:input_type -> CheckEntReq
+	19, // 22: UserCenter.EntUpdate:input_type -> EntUpdateReq
+	20, // 23: UserCenter.ExamineInfo:input_type -> CheckExamineReq
+	21, // 24: UserCenter.GetStatusByCode:input_type -> GetStatusByCodeReq
+	24, // 25: UserCenter.UserAdd:input_type -> UserAddReq
+	27, // 26: UserCenter.UserUpdate:input_type -> UserIdReq
+	27, // 27: UserCenter.UserDel:input_type -> UserIdReq
+	28, // 28: UserCenter.WorkDesktopMenuInfo:input_type -> WorkDesktopMenuInfoReq
+	35, // 29: UserCenter.WorkDesktopComprehensive:input_type -> WorkDesktopComprehensiveReq
+	1,  // 30: UserCenter.EntAuth:output_type -> EntAuthResp
+	4,  // 31: UserCenter.EntExamine:output_type -> ExamineResp
+	7,  // 32: UserCenter.EntList:output_type -> EntListResp
+	11, // 33: UserCenter.ExamineList:output_type -> ExamineListResp
+	15, // 34: UserCenter.CheckEnt:output_type -> CheckEntResp
+	17, // 35: UserCenter.EntInfo:output_type -> EntInfoResp
+	4,  // 36: UserCenter.EntUpdate:output_type -> ExamineResp
+	17, // 37: UserCenter.ExamineInfo:output_type -> EntInfoResp
+	22, // 38: UserCenter.GetStatusByCode:output_type -> GetStatusByCodeResp
+	25, // 39: UserCenter.UserAdd:output_type -> UserAddResp
+	4,  // 40: UserCenter.UserUpdate:output_type -> ExamineResp
+	4,  // 41: UserCenter.UserDel:output_type -> ExamineResp
+	29, // 42: UserCenter.WorkDesktopMenuInfo:output_type -> WorkDesktopMenuInfoResp
+	36, // 43: UserCenter.WorkDesktopComprehensive:output_type -> WorkDesktopComprehensiveResp
+	30, // [30:44] is the sub-list for method output_type
+	16, // [16:30] is the sub-list for method input_type
+	16, // [16:16] is the sub-list for extension type_name
+	16, // [16:16] is the sub-list for extension extendee
+	0,  // [0:16] is the sub-list for field type_name
 }
 
 func init() { file_userCenter_proto_init() }

BIN
rpc/rpc.exe


+ 9 - 5
rpc/userCenter.proto

@@ -265,7 +265,8 @@ message MenuList{
   string icon = 2;
   string url = 3;
   bool usable = 4;
-  repeated SecondLevelMenu child = 5;
+  string  id = 5;
+  repeated SecondLevelMenu child = 6;
 }
 
 message  SecondLevelMenu{
@@ -273,7 +274,8 @@ message  SecondLevelMenu{
   string icon = 2;
   string url = 3;
   bool usable = 4;
-  repeated ThreeLevelMenu child = 5;
+  string  id = 5;
+  repeated ThreeLevelMenu child = 6;
 }
 
 message  ThreeLevelMenu{
@@ -281,9 +283,10 @@ message  ThreeLevelMenu{
   string icon = 2;
   string url = 3;
   bool usable = 4;
-  string appType = 5;
-  string openType = 6;
-  TipInfo tipInfo = 7;
+  string  id = 5;
+  string appType = 6;
+  string openType = 7;
+  TipInfo tipInfo = 8;
 }
 
 message TipInfo {
@@ -309,6 +312,7 @@ message WorkDesktopComprehensiveReq{
 message WorkDesktopComprehensiveResp{
   int64   error_code = 1;
   string  error_msg = 2;
+  repeated ThreeLevelMenu data = 3;
 }
 
 service UserCenter {

+ 92 - 12
service/workDesktop.go

@@ -7,6 +7,7 @@ import (
 	"errors"
 	"fmt"
 	"github.com/zeromicro/go-zero/core/logx"
+	"strings"
 	"time"
 	"userCenter/entity"
 	"userCenter/rpc/pb"
@@ -15,30 +16,82 @@ import (
 
 //工作桌面--菜单当前选择模式--全部:all/可用:usable
 //工作桌面--常用功能更新
-func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *WorkDesktopComprehensiveResp) {
-	//
+//工作桌面--常用功能列表
+func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq, size int, redisOutTime int, bigMemberOff bool) (r *WorkDesktopComprehensiveResp) {
 	r = &WorkDesktopComprehensiveResp{}
 	switch in.ActionMode {
-	case "commonly": //常用功能更新
+	case "commonlyRenew": //常用功能更新
 		//in.MenuIds  为空;删除
 		if in.MenuIds == "" {
-			if !func() bool {
-				if entity.BaseMysql.CountBySql(`SELECT COUNT(id)  FROM `+entity.WorkCommonly+` WHERE userid = '?' AND appid = ? AND platform = '?' AND field = ?`, in.UserId, in.AppId, in.Platform, in.ActionMode) > 0 {
-					return entity.BaseMysql.UpdateOrDeleteBySql(`DELETE  FROM `+entity.WorkCommonly+` WHERE userid = '?' AND appid = ? AND platform = '?' AND field = ?`, in.UserId, in.AppId, in.Platform, in.ActionMode) > 0
+			count := entity.BaseMysql.CountBySql(`SELECT COUNT(id)  FROM `+entity.WorkCommonly+` WHERE userid = ? AND appid = ? AND platform = ? AND field = ?`, in.UserId, in.AppId, in.Platform, in.ActionMode)
+			if count > 0 {
+				if count := entity.BaseMysql.UpdateOrDeleteBySql(`DELETE  FROM `+entity.WorkCommonly+` WHERE userid = ? AND appid = ? AND platform = ? AND field = ?`, in.UserId, in.AppId, in.Platform, in.ActionMode); count <= 0 {
+					r.ErrorCode = -1
+					r.ErrorMsg = "常用功能-清空常用功能异常"
 				}
-				return true
-			}() {
-				r.ErrorCode = -1
-				r.ErrorMsg = "常用功能-清空常用功能异常"
 			}
 		} else {
 			//in.MenuIds 不为空:更新
-			if b, m := entity.CommonlyUpdate(in); !b {
+			if b, m := entity.CommonlyUpdate(in, size); !b {
 				r.ErrorCode = -1
 				r.ErrorMsg = m
 			}
 		}
+	case "commonlyList":
+		//查询常用功能列表
+		in.ActionMode = "commonlyRenew"
+		existingData := entity.BaseMysql.SelectBySql(`SELECT value  FROM `+entity.WorkCommonly+` WHERE userid = ? AND appid = ? AND field = ? AND platform = ?  ORDER BY id DESC `, in.UserId, in.AppId, in.ActionMode, in.Platform)
+		if existingData != nil && len(*existingData) > 0 {
+			eData := (*existingData)[0]
+			if MC.ObjToString(eData["value"]) != "" {
+				var (
+					params []string
+					pIds   []interface{}
+				)
+				for _, pv := range strings.Split(MC.ObjToString(eData["value"]), ",") {
+					params = append(params, "?")
+					pIds = append(pIds, pv)
+				}
+				menuData := entity.BaseMysql.SelectBySql(fmt.Sprintf(`SELECT * from %s WHERE  id IN (%s) AND status = 0`, entity.WorkMenu, strings.Join(params, ",")), pIds...)
+				if menuData != nil && len(*menuData) > 0 {
+					var menuList = []*pb.ThreeLevelMenu{}
+					var m = &entity.WorkDesktopMenu{
+						MenuTree:     nil,
+						UserId:       in.UserId,
+						TimeOut:      redisOutTime,
+						BigMemberOff: bigMemberOff,
+					}
+					for _, mv := range *menuData {
+						//0:默认展示;1:需验证权限,有权限展示;2:需验证权限,无权限也可展示(可用服务无权限不展示)
+						usable := m.VerifyPermissions(MC.ObjToString(mv["powerids"]))
+						menu := &pb.ThreeLevelMenu{
+							Name:     MC.ObjToString(mv["name"]),
+							Icon:     MC.ObjToString(mv["icon"]),
+							AppType:  MC.ObjToString(mv["apptype"]),
+							Usable:   MC.If(MC.ObjToString(mv["powerids"]) != "", usable && MC.IntAll(mv["checkcode"]) == 1, true).(bool),
+							OpenType: MC.ObjToString(mv["opentype"]),
+						}
+						switch in.Platform {
+						case "WX":
+							menu.Url = MC.ObjToString(mv["wxurl"])
+						case "APP":
+							menu.Url = MC.ObjToString(mv["appurl"])
+						default:
+							menu.Url = MC.ObjToString(mv["pcurl"])
+						}
+						if additionalInfo := MC.ObjToString(mv["additionalinfo"]); additionalInfo != "" {
+							additional := pb.TipInfo{}
+							if json.Unmarshal([]byte(additionalInfo), &additional) == nil {
+								menu.TipInfo = &additional
+							}
+						}
+						menuList = append(menuList, menu)
+					}
+					r.Data = menuList
+				}
+			}
 
+		}
 	case "menuMode": //菜单模式更新
 		if in.MenuMode == "" || (in.MenuMode != "usable" && in.MenuMode != "all") {
 			r.ErrorCode = -1
@@ -53,12 +106,39 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
 						r.ErrorMsg = "菜单模式-更新异常"
 					}
 				}
+			} else {
+				if entity.BaseMysql.Insert(entity.WorkCommonly, map[string]interface{}{
+					"appid":    in.AppId,
+					"userid":   in.UserId,
+					"field":    in.ActionMode,
+					"platform": in.Platform,
+					"value":    in.MenuMode,
+				}) < 0 {
+					r.ErrorCode = -1
+					r.ErrorMsg = "菜单模式-插入异常"
+				}
 			}
 		}
 	}
 	return
 }
 
+//
+func GetWorkDesktopMenuMode(in *WorkDesktopMenuInfoReq) (str string, err error) {
+	if in.UserId == "" {
+		return "", fmt.Errorf("参数异常")
+	}
+	str = "all"
+	menuModes := entity.BaseMysql.SelectBySql(`SELECT value FROM `+entity.WorkCommonly+` WHERE appid=? AND userid=? AND field = 'menuMode' AND platform = ? LIMIT 1`, in.AppId, in.UserId, in.Platform)
+	if menuModes != nil && len(*menuModes) > 0 {
+		menuMode := (*menuModes)[0]
+		if MC.ObjToString(menuMode["value"]) != "" {
+			str = MC.ObjToString(menuMode["value"])
+		}
+	}
+	return
+}
+
 //获取工作桌面菜单树
 func GetWordDesktopMenuTree(in *WorkDesktopMenuInfoReq, redisOutTime int, bigMemberOff bool) ([]*pb.MenuList, error) {
 	t1 := time.Now()
@@ -72,7 +152,7 @@ func GetWordDesktopMenuTree(in *WorkDesktopMenuInfoReq, redisOutTime int, bigMem
 		}
 	}
 	//tidb数据
-	menuData := entity.BaseMysql.SelectBySql(`SELECT * FROM `+entity.WorkCommonly+` WHERE status=0 AND appid=? ORDER BY id ASC`, in.AppId)
+	menuData := entity.BaseMysql.SelectBySql(`SELECT * FROM `+entity.WorkMenu+` WHERE status=0 AND appid=? ORDER BY id ASC`, in.AppId)
 	if menuData == nil || len(*menuData) == 0 {
 		return nil, errors.New("查询数据异常")
 	}