WH01243 3 lat temu
rodzic
commit
84a677a8e8

+ 2 - 0
api/medical/internal/logic/distributor/searchdistributorlogic.go

@@ -42,6 +42,8 @@ func (l *SearchDistributorLogic) SearchDistributor(req *types.SearchDistributorR
 		Brand:         req.Brand,
 		ProductModel:  req.ProductModel,
 		Sort:          int64(req.Sort),
+		Appid:         req.Appid,
+		NewUserId:     int64(req.NewUserId),
 	})
 	return &types.CommonRes{
 		Error_msg:  resp.ErrorMsg,

+ 3 - 1
api/medical/internal/logic/institution/searchinstitutionlogic.go

@@ -39,9 +39,11 @@ func (l *SearchInstitutionLogic) SearchInstitution(req *types.SearchInstitutionR
 		AreaCode:         req.AreaCode,
 		LevelCode:        req.LevelCode,
 		MiTypeCode:       req.MiTypeCode,
-		BusinessTypeCode: int64(req.BusinessTypeCode),
+		BusinessTypeCode: req.BusinessTypeCode,
 		SdequipmentCode:  businessScopeList,
 		Sort:             int64(req.Sort),
+		Appid:            req.Appid,
+		NewUserId:        int64(req.NewUserId),
 	})
 	return &types.CommonRes{
 		Error_msg:  resp.ErrorMsg,

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

@@ -12,9 +12,11 @@ type SearchInstitutionReq struct {
 	AreaCode         string           `json:"area_code,optional"`          // 区域代码
 	LevelCode        string           `json:"level_code,optional"`         // 医院等级代码
 	MiTypeCode       string           `json:"mi_type_code,optional"`       // 机构类型
-	BusinessTypeCode int              `json:"business_type_code,optional"` // 经营性质 1-公立 2-民营 3-其他
+	BusinessTypeCode string           `json:"business_type_code,optional"` // 经营性质 1-公立 2-民营 3-其他
 	SdequipmentCode  []Business_Scope `json:"sdequipment_code,optional"`   // 业务范围
 	Sort             int              `json:"sort,optional"`               // 0是数量   1是金额
+	NewUserId        int              `header:"newUserId,optional"`
+	Appid            string           `header:"appid,optional"`
 }
 
 type SearchDistributorReq struct {
@@ -24,6 +26,8 @@ type SearchDistributorReq struct {
 	Brand         string           `json:"brand,optional,optional"` // 品牌
 	ProductModel  string           `json:"product_model,optional"`  // 产品型号
 	Sort          int              `json:"sort,optional"`           // 0是数量   1是金额
+	NewUserId     int              `header:"newUserId,optional"`
+	Appid         string           `header:"appid,optional"`
 }
 
 type Business_Scope struct {

+ 5 - 1
api/medical/medical.api

@@ -11,9 +11,11 @@ type SearchInstitutionReq {
 	AreaCode         string           `json:"area_code,optional"`          // 区域代码
 	LevelCode        string           `json:"level_code,optional"`         // 医院等级代码
 	MiTypeCode       string           `json:"mi_type_code,optional"`       // 机构类型
-	BusinessTypeCode int              `json:"business_type_code,optional"` // 经营性质 1-公立 2-民营 3-其他
+	BusinessTypeCode string           `json:"business_type_code,optional"` // 经营性质 1-公立 2-民营 3-其他
 	SdequipmentCode  []Business_Scope `json:"sdequipment_code,optional"`   // 业务范围
 	Sort             int              `json:"sort,optional"`               // 0是数量   1是金额
+	NewUserId        int              `header:"newUserId,optional"`
+	Appid            string           `header:"appid,optional"`
 }
 // 搜索经销商请求
 type SearchDistributorReq {
@@ -23,6 +25,8 @@ type SearchDistributorReq {
 	Brand         string           `json:"brand,optional,optional"` // 品牌
 	ProductModel  string           `json:"product_model,optional"`  // 产品型号
 	Sort          int              `json:"sort,optional"`           // 0是数量   1是金额
+	NewUserId     int              `header:"newUserId,optional"`
+	Appid         string           `header:"appid,optional"`
 }
 type Business_Scope {
 	Key       []string `json:"key,optional"`       //关键词

+ 3 - 0
entity/util.go

@@ -128,6 +128,9 @@ func ConversionMoeny(i_money interface{}) string {
 		m = m_1[0:len_m1-4] + "." + m_1[len_m1-4:len_m1-2] + "万元"
 	} else {
 		if len(m_arr) == 1 {
+			if m == "0" {
+				return ""
+			}
 			return m + ".00元"
 		}
 		m_2 := m_arr[1]

+ 8 - 5
rpc/medical/internal/logic/distributorlogic.go

@@ -2,12 +2,13 @@ package logic
 
 import (
 	quitl "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
-	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service"
-	"context"
-
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/internal/svc"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
+	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service"
+	"context"
+	"strconv"
 
 	"github.com/zeromicro/go-zero/core/logx"
 )
@@ -32,15 +33,17 @@ func (l *DistributorLogic) Distributor(in *medical.SearchDistributorReq) (*medic
 	m := service.InstitutionService{}
 	dataList := m.Distributor(in)
 	result := &medical.CompanyResp{}
-	companyList := make([]*medical.CompanyData, len(dataList))
+	companyList := []*medical.CompanyData{}
 	for _, value := range dataList {
+		isClaim, _ := strconv.ParseBool(quitl.InterfaceToStr(value["isClaim"]))
 		data := medical.CompanyData{
-			CompanyId:    quitl.InterfaceToStr(value["company_id"]),
+			CompanyId:    encrypt.SE.EncodeString(quitl.InterfaceToStr(value["company_id"])),
 			CompanyName:  quitl.InterfaceToStr(value["supplier"]),
 			Area:         quitl.InterfaceToStr(value["area"]),
 			City:         quitl.InterfaceToStr(value["city"]),
 			ProjectMoney: entity.ConversionMoeny(value["project_money"]),
 			ProjectCount: quitl.Int64All(value["project_count"]),
+			IsClaim:      isClaim,
 		}
 		companyList = append(companyList, &data)
 	}

+ 5 - 1
rpc/medical/internal/logic/institutionlogic.go

@@ -2,9 +2,11 @@ package logic
 
 import (
 	quitl "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service"
 	"context"
+	"strconv"
 
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/internal/svc"
 	"bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
@@ -33,13 +35,15 @@ func (l *InstitutionLogic) Institution(in *medical.SearchInstitutionReq) (*medic
 	result := &medical.CompanyResp{}
 	companyList := []*medical.CompanyData{}
 	for _, value := range dataList {
+		isClaim, _ := strconv.ParseBool(quitl.InterfaceToStr(value["isClaim"]))
 		data := medical.CompanyData{
-			CompanyId:    quitl.InterfaceToStr(value["company_id"]),
+			CompanyId:    encrypt.SE.EncodeString(quitl.InterfaceToStr(value["company_id"])),
 			CompanyName:  quitl.InterfaceToStr(value["mi_name"]),
 			Area:         quitl.InterfaceToStr(value["area"]),
 			City:         quitl.InterfaceToStr(value["city"]),
 			ProjectMoney: entity.ConversionMoeny(value["project_money"]),
 			ProjectCount: quitl.Int64All(value["project_count"]),
+			IsClaim:      isClaim,
 		}
 		companyList = append(companyList, &data)
 	}

+ 8 - 3
rpc/medical/medical.proto

@@ -29,9 +29,11 @@ message SearchInstitutionReq {
   string      areaCode         =2;      // 区域代码
   string      levelCode        =3;      // 医院等级代码
   string      miTypeCode       =4;      // 机构类型
-  int64       businessTypeCode =5;      // 经营性质 1-公立 2-民营 3-其他
+  string       businessTypeCode =5;      // 经营性质 1-公立 2-民营 3-其他
   repeated    Business_Scope  sdequipmentCode  =6;      // 业务范围
-  int64       sort       =7;            // 0是数量   1是金额
+  int64       sort            =7;            // 0是数量   1是金额
+  int64       newUserId       =8;
+  string      appid           =9;
 }
 message SearchDistributorReq {
   string      companyName     =1;          // 要搜索的经销商
@@ -39,7 +41,9 @@ message SearchDistributorReq {
   repeated    Business_Scope   businessScope   =3;          // 业务范围
   string      brand           =4;          // 品牌
   string      productModel    =5;          // 产品型号
-  int64       sort       =6;              // 0是数量   1是金额
+  int64       sort            =6;              // 0是数量   1是金额
+  int64       newUserId       =7;
+  string      appid           =8;
 }
 message Business_Scope{
   repeated string      key               =1; //关键词
@@ -54,6 +58,7 @@ message CompanyData {
   string      project_money  =4;          // 项目总金额
   int64       project_count  =5;          // 项目总数
   string      city           =6;
+  bool        isClaim        =7;
 }
 
 message CompanyResp {

+ 338 - 290
rpc/medical/medical/medical.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // 	protoc-gen-go v1.28.0
-// 	protoc        v3.19.4
+// 	protoc        v3.15.1
 // source: medical.proto
 
 package medical
@@ -277,13 +277,15 @@ type SearchInstitutionReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	CompanyName      string            `protobuf:"bytes,1,opt,name=companyName,proto3" json:"companyName,omitempty"`            // 要搜索的医疗机构
-	AreaCode         string            `protobuf:"bytes,2,opt,name=areaCode,proto3" json:"areaCode,omitempty"`                  // 区域代码
-	LevelCode        string            `protobuf:"bytes,3,opt,name=levelCode,proto3" json:"levelCode,omitempty"`                // 医院等级代码
-	MiTypeCode       string            `protobuf:"bytes,4,opt,name=miTypeCode,proto3" json:"miTypeCode,omitempty"`              // 机构类型
-	BusinessTypeCode int64             `protobuf:"varint,5,opt,name=businessTypeCode,proto3" json:"businessTypeCode,omitempty"` // 经营性质 1-公立 2-民营 3-其他
-	SdequipmentCode  []*Business_Scope `protobuf:"bytes,6,rep,name=sdequipmentCode,proto3" json:"sdequipmentCode,omitempty"`    // 业务范围
-	Sort             int64             `protobuf:"varint,7,opt,name=sort,proto3" json:"sort,omitempty"`                         // 0是数量   1是金额
+	CompanyName      string            `protobuf:"bytes,1,opt,name=companyName,proto3" json:"companyName,omitempty"`           // 要搜索的医疗机构
+	AreaCode         string            `protobuf:"bytes,2,opt,name=areaCode,proto3" json:"areaCode,omitempty"`                 // 区域代码
+	LevelCode        string            `protobuf:"bytes,3,opt,name=levelCode,proto3" json:"levelCode,omitempty"`               // 医院等级代码
+	MiTypeCode       string            `protobuf:"bytes,4,opt,name=miTypeCode,proto3" json:"miTypeCode,omitempty"`             // 机构类型
+	BusinessTypeCode string            `protobuf:"bytes,5,opt,name=businessTypeCode,proto3" json:"businessTypeCode,omitempty"` // 经营性质 1-公立 2-民营 3-其他
+	SdequipmentCode  []*Business_Scope `protobuf:"bytes,6,rep,name=sdequipmentCode,proto3" json:"sdequipmentCode,omitempty"`   // 业务范围
+	Sort             int64             `protobuf:"varint,7,opt,name=sort,proto3" json:"sort,omitempty"`                        // 0是数量   1是金额
+	NewUserId        int64             `protobuf:"varint,8,opt,name=newUserId,proto3" json:"newUserId,omitempty"`
+	Appid            string            `protobuf:"bytes,9,opt,name=appid,proto3" json:"appid,omitempty"`
 }
 
 func (x *SearchInstitutionReq) Reset() {
@@ -346,11 +348,11 @@ func (x *SearchInstitutionReq) GetMiTypeCode() string {
 	return ""
 }
 
-func (x *SearchInstitutionReq) GetBusinessTypeCode() int64 {
+func (x *SearchInstitutionReq) GetBusinessTypeCode() string {
 	if x != nil {
 		return x.BusinessTypeCode
 	}
-	return 0
+	return ""
 }
 
 func (x *SearchInstitutionReq) GetSdequipmentCode() []*Business_Scope {
@@ -367,6 +369,20 @@ func (x *SearchInstitutionReq) GetSort() int64 {
 	return 0
 }
 
+func (x *SearchInstitutionReq) GetNewUserId() int64 {
+	if x != nil {
+		return x.NewUserId
+	}
+	return 0
+}
+
+func (x *SearchInstitutionReq) GetAppid() string {
+	if x != nil {
+		return x.Appid
+	}
+	return ""
+}
+
 type SearchDistributorReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -378,6 +394,8 @@ type SearchDistributorReq struct {
 	Brand         string            `protobuf:"bytes,4,opt,name=brand,proto3" json:"brand,omitempty"`                 // 品牌
 	ProductModel  string            `protobuf:"bytes,5,opt,name=productModel,proto3" json:"productModel,omitempty"`   // 产品型号
 	Sort          int64             `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"`                  // 0是数量   1是金额
+	NewUserId     int64             `protobuf:"varint,7,opt,name=newUserId,proto3" json:"newUserId,omitempty"`
+	Appid         string            `protobuf:"bytes,8,opt,name=appid,proto3" json:"appid,omitempty"`
 }
 
 func (x *SearchDistributorReq) Reset() {
@@ -454,6 +472,20 @@ func (x *SearchDistributorReq) GetSort() int64 {
 	return 0
 }
 
+func (x *SearchDistributorReq) GetNewUserId() int64 {
+	if x != nil {
+		return x.NewUserId
+	}
+	return 0
+}
+
+func (x *SearchDistributorReq) GetAppid() string {
+	if x != nil {
+		return x.Appid
+	}
+	return ""
+}
+
 type Business_Scope struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -528,6 +560,7 @@ type CompanyData struct {
 	ProjectMoney string `protobuf:"bytes,4,opt,name=project_money,json=projectMoney,proto3" json:"project_money,omitempty"`  // 项目总金额
 	ProjectCount int64  `protobuf:"varint,5,opt,name=project_count,json=projectCount,proto3" json:"project_count,omitempty"` // 项目总数
 	City         string `protobuf:"bytes,6,opt,name=city,proto3" json:"city,omitempty"`
+	IsClaim      bool   `protobuf:"varint,7,opt,name=isClaim,proto3" json:"isClaim,omitempty"`
 }
 
 func (x *CompanyData) Reset() {
@@ -604,6 +637,13 @@ func (x *CompanyData) GetCity() string {
 	return ""
 }
 
+func (x *CompanyData) GetIsClaim() bool {
+	if x != nil {
+		return x.IsClaim
+	}
+	return false
+}
+
 type CompanyResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -2337,7 +2377,7 @@ var file_medical_proto_rawDesc = []byte{
 	0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65,
 	0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
 	0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x22, 0x06, 0x0a, 0x04, 0x5a, 0x65, 0x72,
-	0x6f, 0x22, 0x95, 0x02, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x74,
+	0x6f, 0x22, 0xc9, 0x02, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x74,
 	0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f,
 	0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
 	0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08,
@@ -2347,298 +2387,306 @@ var file_medical_proto_rawDesc = []byte{
 	0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x69, 0x54, 0x79, 0x70, 0x65,
 	0x43, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x69, 0x54, 0x79,
 	0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65,
-	0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
+	0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
 	0x52, 0x10, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f,
 	0x64, 0x65, 0x12, 0x41, 0x0a, 0x0f, 0x73, 0x64, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e,
 	0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65,
 	0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x53,
 	0x63, 0x6f, 0x70, 0x65, 0x52, 0x0f, 0x73, 0x64, 0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e,
 	0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x14, 0x53, 0x65,
-	0x61, 0x72, 0x63, 0x68, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52,
-	0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d,
-	0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79,
-	0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65,
-	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61, 0x43, 0x6f, 0x64, 0x65,
-	0x12, 0x3d, 0x0a, 0x0d, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x53, 0x63, 0x6f, 0x70,
-	0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
-	0x6c, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x53, 0x63, 0x6f, 0x70, 0x65,
-	0x52, 0x0d, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12,
-	0x14, 0x0a, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
-	0x62, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
-	0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f,
-	0x64, 0x75, 0x63, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72,
-	0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x58, 0x0a,
-	0x0e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12,
-	0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
-	0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x6b, 0x65, 0x79, 0x18, 0x02,
-	0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x6b, 0x65, 0x79, 0x12,
-	0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52,
-	0x06, 0x6e, 0x6f, 0x74, 0x6b, 0x65, 0x79, 0x22, 0xc1, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70,
-	0x61, 0x6e, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61,
-	0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d,
-	0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e,
-	0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f,
-	0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x65,
-	0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x23, 0x0a,
-	0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x6e,
-	0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6f,
-	0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65,
-	0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18,
-	0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x22, 0x73, 0x0a, 0x0b, 0x43,
-	0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 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, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03,
-	0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43,
-	0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
-	0x22, 0x5f, 0x0a, 0x09, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a,
-	0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64,
-	0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x05, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x12, 0x0a,
-	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
-	0x65, 0x22, 0x60, 0x0a, 0x0a, 0x4d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12,
+	0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77,
+	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65,
+	0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
+	0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x22, 0x95, 0x02,
+	0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75,
+	0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e,
+	0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d,
+	0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x65, 0x61,
+	0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x65, 0x61,
+	0x43, 0x6f, 0x64, 0x65, 0x12, 0x3d, 0x0a, 0x0d, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73,
+	0x53, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65,
+	0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x5f, 0x53,
+	0x63, 0x6f, 0x70, 0x65, 0x52, 0x0d, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x53, 0x63,
+	0x6f, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x6f,
+	0x64, 0x75, 0x63, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x12, 0x0a,
+	0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x6f, 0x72,
+	0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x07,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12,
+	0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
+	0x61, 0x70, 0x70, 0x69, 0x64, 0x22, 0x58, 0x0a, 0x0e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73,
+	0x73, 0x5f, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
+	0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70,
+	0x65, 0x6e, 0x64, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x70,
+	0x70, 0x65, 0x6e, 0x64, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x6b, 0x65,
+	0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x6b, 0x65, 0x79, 0x22,
+	0xdb, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12,
+	0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x21,
+	0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d,
+	0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+	0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72,
+	0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72,
+	0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12,
+	0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63,
+	0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x07,
+	0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x22, 0x73, 0x0a,
+	0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 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, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
+	0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c,
+	0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61,
+	0x74, 0x61, 0x22, 0x5f, 0x0a, 0x09, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x12,
 	0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63,
 	0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01,
 	0x28, 0x09, 0x52, 0x05, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76,
 	0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12,
 	0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
-	0x61, 0x6d, 0x65, 0x22, 0x76, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x74, 0x65,
-	0x6d, 0x12, 0x31, 0x0a, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18,
-	0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e,
-	0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x6c, 0x65, 0x76, 0x65, 0x6c,
-	0x43, 0x6f, 0x64, 0x65, 0x12, 0x35, 0x0a, 0x0c, 0x6d, 0x69, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f,
-	0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x64,
-	0x69, 0x63, 0x61, 0x6c, 0x2e, 0x4d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52,
-	0x0a, 0x6d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x75, 0x0a, 0x0e, 0x46,
-	0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 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, 0x27, 0x0a, 0x04, 0x64, 0x61, 0x74,
-	0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
-	0x6c, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x64, 0x61,
-	0x74, 0x61, 0x22, 0x8d, 0x02, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12,
-	0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
-	0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73,
-	0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73,
-	0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d,
-	0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x61, 0x72,
-	0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x74,
-	0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x74,
-	0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
-	0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70,
-	0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75,
-	0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x0a, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74,
-	0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74,
-	0x75, 0x73, 0x22, 0x87, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 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,
-	0x25, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e,
-	0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f,
-	0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18,
-	0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x59, 0x0a, 0x0b,
-	0x50, 0x6f, 0x72, 0x74, 0x72, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61,
-	0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49,
-	0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12,
-	0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8c, 0x04, 0x0a, 0x0c, 0x50, 0x6f, 0x72, 0x74,
-	0x72, 0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x65, 0x64, 0x73,
-	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x62, 0x65, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b,
-	0x76, 0x69, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x0b, 0x76, 0x69, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x64, 0x61, 0x79, 0x12, 0x1e,
-	0x0a, 0x0a, 0x64, 0x6f, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x6e, 0x75, 0x6d, 0x12, 0x18,
-	0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73,
-	0x69, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69,
-	0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65,
-	0x73, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x62,
-	0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c,
-	0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65,
-	0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x06, 0x6d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x71, 0x75,
-	0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x71,
-	0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x61, 0x72,
-	0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65,
-	0x70, 0x61, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c,
-	0x6c, 0x6f, 0x77, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x6c, 0x6f,
-	0x77, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d, 0x65,
-	0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e,
-	0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68,
-	0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x73, 0x74,
-	0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72,
-	0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x0f, 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, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72,
-	0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x11,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69,
-	0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x69,
-	0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x22, 0x62, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52,
-	0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x6e,
-	0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x6e, 0x74, 0x49, 0x64,
-	0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04,
-	0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x22, 0x4c, 0x0a, 0x0c, 0x55, 0x6e,
-	0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72,
-	0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02,
-	0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x61,
-	0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43,
-	0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72,
-	0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67,
-	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67,
-	0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x18,
-	0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e,
-	0x75, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64,
-	0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
-	0x65, 0x49, 0x64, 0x73, 0x22, 0x66, 0x0a, 0x0c, 0x49, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65,
-	0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01,
+	0x61, 0x6d, 0x65, 0x22, 0x60, 0x0a, 0x0a, 0x4d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64,
+	0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c,
+	0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65,
+	0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x76, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49,
+	0x74, 0x65, 0x6d, 0x12, 0x31, 0x0a, 0x0a, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x64,
+	0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
+	0x6c, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x6c, 0x65, 0x76,
+	0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x35, 0x0a, 0x0c, 0x6d, 0x69, 0x5f, 0x74, 0x79, 0x70,
+	0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d,
+	0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x4d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64,
+	0x65, 0x52, 0x0a, 0x6d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x75, 0x0a,
+	0x0e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 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, 0x27, 0x0a, 0x04, 0x64,
+	0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x64, 0x69,
+	0x63, 0x61, 0x6c, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04,
+	0x64, 0x61, 0x74, 0x61, 0x22, 0x8d, 0x02, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66,
+	0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70,
+	0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70,
+	0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x61, 0x72,
+	0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70,
+	0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x18,
+	0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x65,
+	0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65,
+	0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,
+	0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d,
+	0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a,
+	0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
+	0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18,
+	0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06,
+	0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74,
+	0x61, 0x74, 0x75, 0x73, 0x22, 0x87, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66,
+	0x6f, 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, 0x25, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
+	0x11, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e,
+	0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74,
+	0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x59,
+	0x0a, 0x0b, 0x50, 0x6f, 0x72, 0x74, 0x72, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a,
+	0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70,
+	0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49,
+	0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x8c, 0x04, 0x0a, 0x0c, 0x50, 0x6f,
+	0x72, 0x74, 0x72, 0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x65,
+	0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x62, 0x65, 0x64, 0x73, 0x12, 0x20,
+	0x0a, 0x0b, 0x76, 0x69, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x0b, 0x76, 0x69, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x64, 0x61, 0x79,
+	0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x6f, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x6e, 0x75, 0x6d, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x6e, 0x75, 0x6d,
+	0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65,
+	0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62,
+	0x73, 0x69, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18, 0x06, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x75, 0x73, 0x69,
+	0x6e, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0c, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a,
+	0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65,
+	0x76, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x69, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x65,
+	0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
+	0x65, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x70,
+	0x61, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
+	0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66,
+	0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x6f, 0x6c,
+	0x6c, 0x6f, 0x77, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61,
+	0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e,
+	0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69,
+	0x73, 0x68, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65,
+	0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x09,
+	0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x0f, 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, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65,
+	0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79,
+	0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08,
+	0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
+	0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x22, 0x62, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x69,
+	0x6d, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01,
 	0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05,
 	0x45, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x6e, 0x74,
-	0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65,
-	0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x22, 0xa4, 0x01, 0x0a,
-	0x0d, 0x49, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c,
-	0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08,
-	0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
-	0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x34, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c,
-	0x2e, 0x49, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53,
-	0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x23,
-	0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73,
-	0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61,
-	0x74, 0x75, 0x73, 0x22, 0x6a, 0x0a, 0x0a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65,
-	0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70,
-	0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x12,
-	0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x50,
-	0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18,
-	0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22,
-	0x66, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x12,
-	0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d,
-	0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70,
-	0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70,
-	0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4e,
-	0x65, 0x77, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x04, 0x6c, 0x69, 0x73,
-	0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
-	0x6c, 0x2e, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69,
-	0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f,
-	0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72,
-	0x43, 0x6f, 0x64, 0x65, 0x22, 0xb8, 0x01, 0x0a, 0x0a, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x4c,
-	0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x69, 0x64, 0x73, 0x74,
-	0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x69, 0x64, 0x73,
-	0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x69, 0x64, 0x61, 0x6d, 0x6f, 0x75,
-	0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x69, 0x64, 0x61, 0x6d, 0x6f,
-	0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x74, 0x69, 0x6d, 0x65,
-	0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x74, 0x69, 0x6d,
-	0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69,
-	0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x69, 0x6e, 0x6e, 0x65,
-	0x72, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22,
-	0xd1, 0x02, 0x0a, 0x08, 0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x0e, 0x0a, 0x02,
-	0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07,
-	0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75,
-	0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18,
-	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08,
-	0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
-	0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
-	0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61,
-	0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64,
-	0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69,
-	0x73, 0x68, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65,
-	0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07,
-	0x63, 0x61, 0x70, 0x69, 0x74, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63,
-	0x61, 0x70, 0x69, 0x74, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e,
-	0x79, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63,
-	0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61,
-	0x70, 0x70, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49,
-	0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65,
-	0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69,
-	0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d,
-	0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54,
-	0x69, 0x6d, 0x65, 0x22, 0x51, 0x0a, 0x12, 0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4c,
-	0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x6c, 0x69, 0x73,
-	0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
-	0x6c, 0x2e, 0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74,
-	0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x7d, 0x0a, 0x10, 0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61,
-	0x69, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x72,
-	0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x45,
-	0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f,
-	0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x45, 0x72, 0x72, 0x6f,
-	0x72, 0x4d, 0x73, 0x67, 0x12, 0x2f, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
-	0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x45, 0x6e, 0x74,
-	0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52,
-	0x04, 0x44, 0x61, 0x74, 0x61, 0x32, 0xee, 0x05, 0x0a, 0x07, 0x4d, 0x65, 0x64, 0x69, 0x63, 0x61,
-	0x6c, 0x12, 0x42, 0x0a, 0x0b, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e,
-	0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63,
-	0x68, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a,
-	0x14, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e,
-	0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74,
-	0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0d, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c,
-	0x2e, 0x5a, 0x65, 0x72, 0x6f, 0x1a, 0x17, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e,
-	0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42,
-	0x0a, 0x0b, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x2e,
-	0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x69,
-	0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x6d,
-	0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x3a, 0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x49, 0x6e,
-	0x66, 0x6f, 0x53, 0x61, 0x76, 0x65, 0x12, 0x11, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c,
-	0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x13, 0x2e, 0x6d, 0x65, 0x64, 0x69,
-	0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39,
-	0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12,
-	0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52,
-	0x65, 0x71, 0x1a, 0x15, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x55, 0x73, 0x65,
-	0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x08, 0x50, 0x6f, 0x72,
-	0x74, 0x72, 0x61, 0x69, 0x74, 0x12, 0x14, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e,
-	0x50, 0x6f, 0x72, 0x74, 0x72, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x6d, 0x65,
-	0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x72, 0x61, 0x69, 0x74, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x2e, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x11, 0x2e, 0x6d, 0x65,
-	0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x12,
-	0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x36, 0x0a, 0x09, 0x55, 0x6e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x12,
-	0x15, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x55, 0x6e, 0x63, 0x6c, 0x61, 0x69,
-	0x6d, 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c,
-	0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x09, 0x49, 0x73,
-	0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x12, 0x15, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
-	0x6c, 0x2e, 0x49, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x16,
-	0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x49, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d,
-	0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x16, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65,
-	0x64, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x4c, 0x69, 0x73, 0x74,
-	0x12, 0x13, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d,
-	0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e,
-	0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x48, 0x0a, 0x16, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x69,
-	0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x6d, 0x65, 0x64,
-	0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a,
-	0x19, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61,
-	0x69, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x09, 0x47, 0x65,
-	0x74, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x12, 0x15, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
-	0x6c, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x16,
-	0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x77, 0x4d,
-	0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x6d, 0x65, 0x64, 0x69,
-	0x63, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18,
+	0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x22, 0x4c, 0x0a, 0x0c,
+	0x55, 0x6e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06,
+	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73,
+	0x65, 0x72, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x02, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x09, 0x43,
+	0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f,
+	0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x45, 0x72, 0x72,
+	0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d,
+	0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d,
+	0x73, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x75,
+	0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+	0x65, 0x4e, 0x75, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+	0x49, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75,
+	0x72, 0x63, 0x65, 0x49, 0x64, 0x73, 0x22, 0x66, 0x0a, 0x0c, 0x49, 0x73, 0x43, 0x6c, 0x61, 0x69,
+	0x6d, 0x65, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14,
+	0x0a, 0x05, 0x45, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45,
+	0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79,
+	0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x22, 0xa4,
+	0x01, 0x0a, 0x0d, 0x49, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x1c, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a,
+	0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x34, 0x0a, 0x04, 0x44, 0x61,
+	0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63,
+	0x61, 0x6c, 0x2e, 0x49, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70,
+	0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61,
+	0x1a, 0x23, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x12, 0x16, 0x0a,
+	0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73,
+	0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x6a, 0x0a, 0x0a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64,
+	0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x41,
+	0x70, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x41, 0x70, 0x70, 0x49,
+	0x64, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x04, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
+	0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
+	0x65, 0x22, 0x66, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x52, 0x65,
+	0x71, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d, 0x65,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e,
+	0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a,
+	0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x0d, 0x47, 0x65,
+	0x74, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x04, 0x6c,
+	0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x64, 0x69,
+	0x63, 0x61, 0x6c, 0x2e, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04,
+	0x6c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72,
+	0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72,
+	0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x22, 0xb8, 0x01, 0x0a, 0x0a, 0x4e, 0x65, 0x77, 0x4d, 0x73,
+	0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x65, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x69, 0x64,
+	0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x69,
+	0x64, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x69, 0x64, 0x61, 0x6d,
+	0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x69, 0x64, 0x61,
+	0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x74, 0x69,
+	0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x74,
+	0x69, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x69, 0x6e,
+	0x6e, 0x65, 0x72, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x77, 0x69, 0x6e, 0x6e, 0x65,
+	0x72, 0x22, 0xd1, 0x02, 0x0a, 0x08, 0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x0e,
+	0x0a, 0x02, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17,
+	0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69,
+	0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x19,
+	0x0a, 0x08, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x07, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
+	0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a,
+	0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
+	0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x73, 0x74, 0x61, 0x62,
+	0x6c, 0x69, 0x73, 0x68, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x0d, 0x65, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x61, 0x74, 0x65, 0x12, 0x18,
+	0x0a, 0x07, 0x63, 0x61, 0x70, 0x69, 0x74, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x07, 0x63, 0x61, 0x70, 0x69, 0x74, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x70,
+	0x61, 0x6e, 0x79, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x14, 0x0a,
+	0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70,
+	0x70, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69,
+	0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+	0x54, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74,
+	0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74,
+	0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x51, 0x0a, 0x12, 0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69,
+	0x6d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x6c,
+	0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x64, 0x69,
+	0x63, 0x61, 0x6c, 0x2e, 0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x04, 0x6c, 0x69,
+	0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x7d, 0x0a, 0x10, 0x45, 0x6e, 0x74, 0x43,
+	0x6c, 0x61, 0x69, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09,
+	0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x45, 0x72,
+	0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x45, 0x72,
+	0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x2f, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x45,
+	0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x75, 0x63,
+	0x74, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x32, 0xee, 0x05, 0x0a, 0x07, 0x4d, 0x65, 0x64, 0x69,
+	0x63, 0x61, 0x6c, 0x12, 0x42, 0x0a, 0x0b, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69,
+	0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x61,
+	0x72, 0x63, 0x68, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
+	0x71, 0x1a, 0x14, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
+	0x61, 0x6e, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x46, 0x69,
+	0x6c, 0x74, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0d, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63,
+	0x61, 0x6c, 0x2e, 0x5a, 0x65, 0x72, 0x6f, 0x1a, 0x17, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
+	0x6c, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x42, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x12,
+	0x1d, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
+	0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14,
+	0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68,
+	0x49, 0x6e, 0x66, 0x6f, 0x53, 0x61, 0x76, 0x65, 0x12, 0x11, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63,
+	0x61, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x13, 0x2e, 0x6d, 0x65,
+	0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x39, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x41, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f,
+	0x12, 0x12, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
+	0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x55,
+	0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x08, 0x50,
+	0x6f, 0x72, 0x74, 0x72, 0x61, 0x69, 0x74, 0x12, 0x14, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
+	0x6c, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x72, 0x61, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e,
+	0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x72, 0x61, 0x69, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x2e, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x11, 0x2e,
+	0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71,
+	0x1a, 0x12, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x09, 0x55, 0x6e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65,
+	0x64, 0x12, 0x15, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x55, 0x6e, 0x63, 0x6c,
+	0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63,
+	0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x09,
+	0x49, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x12, 0x15, 0x2e, 0x6d, 0x65, 0x64, 0x69,
+	0x63, 0x61, 0x6c, 0x2e, 0x49, 0x73, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x71,
+	0x1a, 0x16, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x49, 0x73, 0x43, 0x6c, 0x61,
+	0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x16, 0x43, 0x6c, 0x61, 0x69,
+	0x6d, 0x65, 0x64, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x4c, 0x69,
+	0x73, 0x74, 0x12, 0x13, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61,
+	0x69, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61,
+	0x6c, 0x2e, 0x45, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
+	0x73, 0x70, 0x12, 0x48, 0x0a, 0x16, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x49, 0x6e, 0x73,
+	0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x6d,
+	0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x52, 0x65,
+	0x71, 0x1a, 0x19, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x45, 0x6e, 0x74, 0x43,
+	0x6c, 0x61, 0x69, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x09,
+	0x47, 0x65, 0x74, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x12, 0x15, 0x2e, 0x6d, 0x65, 0x64, 0x69,
+	0x63, 0x61, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x77, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71,
+	0x1a, 0x16, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65,
+	0x77, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x6d, 0x65,
+	0x64, 0x69, 0x63, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 1 - 1
rpc/medical/medical/medical_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.19.4
+// - protoc             v3.15.1
 // source: medical.proto
 
 package medical

+ 102 - 75
service/InstitutionService.go

@@ -12,7 +12,7 @@ import (
 
 type InstitutionService struct{}
 
-//医疗机构搜索条件
+// GetFilterItem 医疗机构搜索条件
 func (b InstitutionService) GetFilterItem() (levelList, typeList *[]map[string]interface{}) {
 	//机构类型
 	levelSql := fmt.Sprintf("select  * from %s where  name!='%s'", entity.CODE_MEDICAL_INSTITUTION_LEVEL, "其它")
@@ -23,8 +23,7 @@ func (b InstitutionService) GetFilterItem() (levelList, typeList *[]map[string]i
 	return
 }
 
-//医疗机构搜索条件
-
+// Institution 医疗机构搜索条件
 func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataList []map[string]interface{}) {
 	//先查询医疗机构
 	//医疗机构查询拼接
@@ -70,8 +69,8 @@ func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataL
 		musts = append(musts, miTyprQuery)
 	}
 	//经营性质处理
-	if in.BusinessTypeCode != 0 {
-		businessTypeQuery := entity.SplicingString("business_type", fmt.Sprint(in.AreaCode))
+	if in.BusinessTypeCode != "" {
+		businessTypeQuery := entity.SplicingString("business_type", in.BusinessTypeCode)
 		musts = append(musts, businessTypeQuery)
 	}
 	//机构名称处理
@@ -80,56 +79,38 @@ func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataL
 		musts = append(musts, companyNameQuery)
 	}
 	//业务范围处理
-	boolsNum := 0
-	businessShoulds := []string{}
-	businessMust_not := []string{}
-	if len(in.SdequipmentCode) > 0 {
-		boolsNum = 1
-		findfields := `"sdequipment"`
-		multi_match = fmt.Sprintf(multi_match, "%s", findfields)
-		for _, v := range in.SdequipmentCode {
-			//关键词
-			for _, keyV := range v.Key {
-				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+keyV+"\""))
-			}
-			//附加词
-			for _, AppendV := range v.Appendkey {
-				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+AppendV+"\""))
-			}
-			//排除词
-			for _, notV := range v.Notkey {
-				businessMust_not = append(businessMust_not, fmt.Sprintf(multi_match, "\""+notV+"\""))
-			}
-			//添加
-			if len(businessShoulds) > 0 {
-				notStr := ""
-				if len(businessShoulds) > 0 {
-					notStr = fmt.Sprintf(`,"must_not":[%s]`, strings.Join(businessMust_not, ","))
-				}
-				bools = append(bools, fmt.Sprintf(query_bool_must_and, strings.Join(businessShoulds, ","), notStr))
-			}
-		}
-	}
+	boolsNum, bools := BusinessScopehandle(in.SdequipmentCode, multi_match, `"sdequipment"`, query_bool_must_and, bools)
 	shouldNumber := 0
 	if len(shoulds) > 0 {
 		shouldNumber = 1
 	}
 	shouldStr := fmt.Sprintf(shouldQuery, strings.Join(shoulds, ","), shouldNumber)
 	musts = append(musts, shouldStr)
-	queryStr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(bools, ","), boolsNum, 0, 500)
-	//再根据医疗机构名称查找项目金额总数
+	queryStr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(bools, ","), boolsNum, 0, 100)
+	//医疗机构查找
 	companyList := elastic.Get(entity.INSTITUTION_INDEX, entity.INSTITUTION_TYPE, queryStr)
 	log.Println(queryStr)
+	//再根据医疗机构名称查找项目金额总数
 	companyName := ""
 	companyMap := make(map[string]map[string]interface{})
 	if len(*companyList) > 0 && companyList != nil {
+		//认领数据查询
+		companyIdMap := ClaimCompanyData(in.Appid, in.NewUserId, entity.TypeDistributor)
 		for key, value := range *companyList {
 			if key > 0 {
 				companyName += `,`
 			}
 			companyName += `"` + fmt.Sprint(value["mi_name"]) + `"`
+			value["project_money"] = float64(0.00)
+			value["project_count"] = 0
+			if companyIdMap[fmt.Sprint(value["company_id"])] == nil {
+				value["isClaim"] = false
+			} else {
+				value["isClaim"] = true
+			}
 			companyMap[fmt.Sprint(value["mi_name"])] = value
 		}
+
 	} else {
 		return
 	}
@@ -139,25 +120,32 @@ func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataL
 	if in.Sort == 1 {
 		orderField = "count"
 	}
-
 	aggStr := fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"buyer":[%s]}},{"terms":{"bidstatus":["中标","成交","合同"]}},{"term":{"bid_field":"%s"}}],"minimum_should_match":0}},"aggs":{"group_field":{"terms":{"field":"buyer","order":[{"%s":"%s"}]},"aggs":{"count":{"sum":{"field":"bidamount"}}}}},"size":0}`, companyName, entity.BIDFIELD, orderField, orderType)
 	log.Println(aggStr)
 	countList := entity.GetAggs(entity.PROJECTSET_INDEX, entity.PROJECTSET_TYPE, aggStr)
+	//
 	if len(countList) > 0 && countList != nil {
 		for _, value := range countList {
+			log.Println(companyMap[value.CompanyName], value.CompanyName, companyMap[value.CompanyName])
 			if companyMap[value.CompanyName] != nil {
 				companyMap[value.CompanyName]["project_money"] = value.ProjectMoney
 				companyMap[value.CompanyName]["project_count"] = value.ProjectCount
 				dataList = append(dataList, companyMap[value.CompanyName])
+				delete(companyMap, value.CompanyName)
 			}
 		}
+		for _, value := range companyMap {
+			log.Println(value)
+			dataList = append(dataList, value)
+		}
 	} else {
-		return
+		dataList = *companyList
+
 	}
 	return
 }
 
-//经销商搜索
+// Distributor 经销商搜索
 func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataList []map[string]interface{}) {
 	//先查询医疗机构
 	//医疗机构查询拼接
@@ -181,7 +169,6 @@ func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataL
 			}
 		}
 	}
-
 	//省份处理
 	if len(areaArr) > 0 {
 		areaQuery := entity.SplicingArr("area", areaArr)
@@ -193,36 +180,7 @@ func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataL
 		shoulds = append(shoulds, cityQuery)
 	}
 	//业务范围处理
-	boolsNum := 0
-	businessShoulds := []string{}
-	businessMust_not := []string{}
-	if len(in.BusinessScope) > 0 {
-		boolsNum = 1
-		findfields := `"productlist.name"`
-		multi_match = fmt.Sprintf(multi_match, "%s", findfields)
-		for _, v := range in.BusinessScope {
-			//关键词
-			for _, keyV := range v.Key {
-				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+keyV+"\""))
-			}
-			//附加词
-			for _, AppendV := range v.Appendkey {
-				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+AppendV+"\""))
-			}
-			//排除词
-			for _, notV := range v.Notkey {
-				businessMust_not = append(businessMust_not, fmt.Sprintf(multi_match, "\""+notV+"\""))
-			}
-			//添加
-			if len(businessShoulds) > 0 {
-				notStr := ""
-				if len(businessShoulds) > 0 {
-					notStr = fmt.Sprintf(`,"must_not":[%s]`, strings.Join(businessMust_not, ","))
-				}
-				bools = append(bools, fmt.Sprintf(query_bool_must_and, strings.Join(businessShoulds, ","), notStr))
-			}
-		}
-	}
+	boolsNum, bools := BusinessScopehandle(in.BusinessScope, multi_match, `"productlist.name"`, query_bool_must_and, bools)
 	//品牌处理
 	if in.Brand != "" {
 		brandQuery := entity.SplicingString("productlist.brand", in.Brand)
@@ -244,19 +202,28 @@ func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataL
 	}
 	shouldStr := fmt.Sprintf(shouldQuery, strings.Join(shoulds, ","), shouldNumber)
 	musts = append(musts, shouldStr)
-
-	queryStr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(businessShoulds, ","), boolsNum, 0, 500)
-	//再根据医疗机构名称查找项目金额总数
+	queryStr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(bools, ","), boolsNum, 0, 100)
+	//医疗机构查找
 	companyList := elastic.Get(entity.SUPPLIER_PRODUCT_INDEX, entity.SUPPLIER_PRODUCT_TYPE, queryStr)
 	log.Println(queryStr)
+	//再根据医疗机构名称查找项目金额总数
 	companyIds := ""
 	companyMap := make(map[string]map[string]interface{})
 	if len(*companyList) > 0 && companyList != nil {
+		//认领数据查询
+		companyIdMap := ClaimCompanyData(in.Appid, in.NewUserId, entity.TypeDistributor)
 		for key, value := range *companyList {
 			if key > 0 {
 				companyIds += `,`
 			}
 			companyIds += `"` + fmt.Sprint(value["company_id"]) + `"`
+			value["project_money"] = float64(0.00)
+			value["project_count"] = 0
+			if companyIdMap[fmt.Sprint(value["company_id"])] == nil {
+				value["isClaim"] = false
+			} else {
+				value["isClaim"] = true
+			}
 			companyMap[fmt.Sprint(value["company_id"])] = value
 		}
 	} else {
@@ -277,10 +244,70 @@ func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataL
 				companyMap[value.CompanyName]["project_money"] = value.ProjectMoney
 				companyMap[value.CompanyName]["project_count"] = value.ProjectCount
 				dataList = append(dataList, companyMap[value.CompanyName])
+				delete(companyMap, value.CompanyName)
 			}
 		}
+		for _, value := range companyMap {
+			log.Println(value)
+			dataList = append(dataList, value)
+		}
 	} else {
-		return
+		dataList = *companyList
 	}
 	return
 }
+
+//  ClaimCompanyData 已认领企业查询处理
+// @param  appId 用户标识
+// @param  newUserId 用户标识
+// @param  claimType 数据类型
+func ClaimCompanyData(appId string, newUserId, claimType int64) map[string]map[string]interface{} {
+	claimList := entity.BaseMysql.Find(entity.TableDomainEntClaim, map[string]interface{}{
+		"user_id": newUserId,
+		"status":  1,
+		"type":    claimType,
+		"appid":   appId,
+	}, "ent_id", "", -1, -1)
+	companyIdMap := make(map[string]map[string]interface{})
+	if claimList == nil || len(*claimList) == 0 {
+		return companyIdMap
+	}
+	for _, m := range *claimList {
+		companyIdMap[quitl.InterfaceToStr(m["ent_id"])] = m
+	}
+	return companyIdMap
+}
+
+// BusinessScopehandle 业务范围处理
+func BusinessScopehandle(BusinessScope []*medical.Business_Scope, multi_match, findfields, query_bool_must_and string, bools []string) (int, []string) {
+	boolsNum := 0
+	businessShoulds := []string{}
+	businessMust_not := []string{}
+	if len(BusinessScope) > 0 {
+		boolsNum = 1
+		multi_match = fmt.Sprintf(multi_match, "%s", findfields)
+		for _, v := range BusinessScope {
+			//关键词
+			for _, keyV := range v.Key {
+				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+keyV+"\""))
+			}
+			//附加词
+			for _, AppendV := range v.Appendkey {
+				businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+AppendV+"\""))
+			}
+			//排除词
+			for _, notV := range v.Notkey {
+				businessMust_not = append(businessMust_not, fmt.Sprintf(multi_match, "\""+notV+"\""))
+			}
+			//添加
+			if len(businessShoulds) > 0 {
+				notStr := ""
+				if len(businessShoulds) > 0 {
+					notStr = fmt.Sprintf(`,"must_not":[%s]`, strings.Join(businessMust_not, ","))
+				}
+				bools = append(bools, fmt.Sprintf(query_bool_must_and, strings.Join(businessShoulds, ","), notStr))
+			}
+		}
+	}
+	return boolsNum, bools
+}

+ 4 - 2
service/InstitutionService_test.go

@@ -130,8 +130,10 @@ func TestInstitutionService_Distributor(t *testing.T) {
 							Appendkey: []string{},
 							Notkey:    []string{"1", "2"}},
 					},
-					Brand:        "梅里埃,西门子",
-					ProductModel: "70600",
+					Brand:        "",
+					ProductModel: "",
+					Appid:        "10000",
+					NewUserId:    68819,
 				}},
 		},
 	}