瀏覽代碼

wip:附件下载包功能

WH01243 3 年之前
父節點
當前提交
8713239d45

+ 15 - 11
api/integral.api

@@ -5,11 +5,12 @@ type purchResourcesReq {
 	CompanyId    int64  `form:"companyId,optional"`    //企业标识
 	CompanyId    int64  `form:"companyId,optional"`    //企业标识
 	DepartmentId int64  `form:"departmentId,optional"` //组织标识
 	DepartmentId int64  `form:"departmentId,optional"` //组织标识
 	Name         string `form:"name"`                  //资源名称
 	Name         string `form:"name"`                  //资源名称
-	ResourceType string `form:"resourceType"`          //资源类型
+	ResourceType string `form:"resourceType,optional"` //资源类型
 	Number       int64  `form:"number"`                //数量
 	Number       int64  `form:"number"`                //数量
 	Spec         string `form:"spec,optional"`         //规格
 	Spec         string `form:"spec,optional"`         //规格
 	AppId        string `form:"appId"`                 //标识
 	AppId        string `form:"appId"`                 //标识
 	EndTime      string `form:"endTime,optional"`      //新增时数据包截止时间
 	EndTime      string `form:"endTime,optional"`      //新增时数据包截止时间
+	VipTime      string `form:"vipTime,optional"`      //超级订阅时间
 	Remarks      string `form:"remarks,optional"`      //备注
 	Remarks      string `form:"remarks,optional"`      //备注
 }
 }
 type useResourcesReq {
 type useResourcesReq {
@@ -17,7 +18,7 @@ type useResourcesReq {
 	CompanyId        int64  `form:"companyId,optional"`        //企业标识
 	CompanyId        int64  `form:"companyId,optional"`        //企业标识
 	DepartmentId     int64  `form:"departmentId,optional"`     //组织标识
 	DepartmentId     int64  `form:"departmentId,optional"`     //组织标识
 	Name             string `form:"name"`                      //资源名称
 	Name             string `form:"name"`                      //资源名称
-	ResourceType     string `form:"resourceType"`              //资源类型
+	ResourceType     string `form:"resourceType,optional"`     //资源类型
 	Number           int64  `form:"number"`                    //数量
 	Number           int64  `form:"number"`                    //数量
 	AppId            string `form:"appId"`                     //标识
 	AppId            string `form:"appId"`                     //标识
 	RuleId           string `form:"ruleId,optional"`           //使用规则标识
 	RuleId           string `form:"ruleId,optional"`           //使用规则标识
@@ -54,11 +55,12 @@ type previewRes {
 
 
 //流水账请求参数返回参数
 //流水账请求参数返回参数
 type recordReq {
 type recordReq {
-	AccountId string `form:"accountId,optional"` //企业标识
-	UserId    string `form:"userId,optional"`    //用户标识
-	Page      int64  `form:"page,optional"`
-	PageSize  int64  `form:"pageSize,optional"`
-	State     int64  `form:"state,optional"` //0查消耗记录 1 查充值记录
+	AccountId    string `form:"accountId,optional"` //企业标识
+	UserId       string `form:"userId,optional"`    //用户标识
+	Page         int64  `form:"page,optional"`
+	PageSize     int64  `form:"pageSize,optional"`
+	ResourceType string `form:"resourceType,optional"` //资源类型
+	State        int64  `form:"state,optional"`        //0查消耗记录 1 查充值记录
 }
 }
 
 
 type recordRes {
 type recordRes {
@@ -70,8 +72,9 @@ type recordRes {
 
 
 //查询用户资源权限
 //查询用户资源权限
 type authReq {
 type authReq {
-	AccountId string `form:"accountId,optional"` //企业标识
-	UserId    string `form:"userId,optional"`    //用户标识
+	AccountId    string `form:"accountId,optional"`    //企业标识
+	UserId       string `form:"userId,optional"`       //用户标识
+	ResourceType string `form:"resourceType,optional"` //资源类型
 }
 }
 
 
 type authRes {
 type authRes {
@@ -82,8 +85,9 @@ type authRes {
 
 
 //账户余额
 //账户余额
 type balanceReq {
 type balanceReq {
-	AccountId string `form:"accountId,optional"` //企业标识
-	UserId    string `form:"userId,optional"`    //用户标识
+	AccountId    string `form:"accountId,optional"`    //企业标识
+	UserId       string `form:"userId,optional"`       //用户标识
+	ResourceType string `form:"resourceType,optional"` //资源类型
 }
 }
 type balanceRes {
 type balanceRes {
 	Code    int64                    `json:"code"`
 	Code    int64                    `json:"code"`

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

@@ -32,6 +32,7 @@ func (l *FindBalanceLogic) FindBalance(req types.BalanceReq) (*types.BalanceRes,
 	lsi := l.svcCtx.ResourcesCenter
 	lsi := l.svcCtx.ResourcesCenter
 	resp, err := lsi.FindAccountBalance(l.ctx, &resourcesCenterclient.ResourcesReq{
 	resp, err := lsi.FindAccountBalance(l.ctx, &resourcesCenterclient.ResourcesReq{
 		AccountId: req.AccountId,
 		AccountId: req.AccountId,
+		ResourceType:req.ResourceType,
 	})
 	})
 	log.Println(resp)
 	log.Println(resp)
 	if err != nil {
 	if err != nil {

+ 3 - 0
api/internal/logic/findrecordlogic.go

@@ -36,6 +36,9 @@ func (l *FindRecordLogic) FindRecord(req types.RecordReq) (*types.RecordRes, err
 		PageSize:  req.PageSize,
 		PageSize:  req.PageSize,
 		Page:      req.Page,
 		Page:      req.Page,
 		State:     req.State,
 		State:     req.State,
+		ResourceType: req.ResourceType,
+
+
 	})
 	})
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err

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

@@ -41,6 +41,7 @@ func (l *PurchaseUserBalanceLogic) PurchaseUserBalance(req types.PurchResourcesR
 		EndTime:      req.EndTime,
 		EndTime:      req.EndTime,
 		Spec:         req.Spec,
 		Spec:         req.Spec,
 		Remarks:      req.Remarks,
 		Remarks:      req.Remarks,
+		VipTime:      req.VipTime,
 	})
 	})
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err

+ 15 - 11
api/internal/types/types.go

@@ -6,11 +6,12 @@ type PurchResourcesReq struct {
 	CompanyId    int64  `form:"companyId,optional"`    //企业标识
 	CompanyId    int64  `form:"companyId,optional"`    //企业标识
 	DepartmentId int64  `form:"departmentId,optional"` //组织标识
 	DepartmentId int64  `form:"departmentId,optional"` //组织标识
 	Name         string `form:"name"`                  //资源名称
 	Name         string `form:"name"`                  //资源名称
-	ResourceType string `form:"resourceType"`          //资源类型
+	ResourceType string `form:"resourceType,optional"` //资源类型
 	Number       int64  `form:"number"`                //数量
 	Number       int64  `form:"number"`                //数量
 	Spec         string `form:"spec,optional"`         //规格
 	Spec         string `form:"spec,optional"`         //规格
 	AppId        string `form:"appId"`                 //标识
 	AppId        string `form:"appId"`                 //标识
 	EndTime      string `form:"endTime,optional"`      //新增时数据包截止时间
 	EndTime      string `form:"endTime,optional"`      //新增时数据包截止时间
+	VipTime      string `form:"vipTime,optional"`      //超级订阅时间
 	Remarks      string `form:"remarks,optional"`      //备注
 	Remarks      string `form:"remarks,optional"`      //备注
 }
 }
 
 
@@ -19,7 +20,7 @@ type UseResourcesReq struct {
 	CompanyId        int64  `form:"companyId,optional"`        //企业标识
 	CompanyId        int64  `form:"companyId,optional"`        //企业标识
 	DepartmentId     int64  `form:"departmentId,optional"`     //组织标识
 	DepartmentId     int64  `form:"departmentId,optional"`     //组织标识
 	Name             string `form:"name"`                      //资源名称
 	Name             string `form:"name"`                      //资源名称
-	ResourceType     string `form:"resourceType"`              //资源类型
+	ResourceType     string `form:"resourceType,optional"`     //资源类型
 	Number           int64  `form:"number"`                    //数量
 	Number           int64  `form:"number"`                    //数量
 	AppId            string `form:"appId"`                     //标识
 	AppId            string `form:"appId"`                     //标识
 	RuleId           string `form:"ruleId,optional"`           //使用规则标识
 	RuleId           string `form:"ruleId,optional"`           //使用规则标识
@@ -54,11 +55,12 @@ type PreviewRes struct {
 }
 }
 
 
 type RecordReq struct {
 type RecordReq struct {
-	AccountId string `form:"accountId,optional"` //企业标识
-	UserId    string `form:"userId,optional"`    //用户标识
-	Page      int64  `form:"page,optional"`
-	PageSize  int64  `form:"pageSize,optional"`
-	State     int64  `form:"state,optional"` //0查消耗记录 1 查充值记录
+	AccountId    string `form:"accountId,optional"` //企业标识
+	UserId       string `form:"userId,optional"`    //用户标识
+	Page         int64  `form:"page,optional"`
+	PageSize     int64  `form:"pageSize,optional"`
+	ResourceType string `form:"resourceType,optional"` //资源类型
+	State        int64  `form:"state,optional"`        //0查消耗记录 1 查充值记录
 }
 }
 
 
 type RecordRes struct {
 type RecordRes struct {
@@ -69,8 +71,9 @@ type RecordRes struct {
 }
 }
 
 
 type AuthReq struct {
 type AuthReq struct {
-	AccountId string `form:"accountId,optional"` //企业标识
-	UserId    string `form:"userId,optional"`    //用户标识
+	AccountId    string `form:"accountId,optional"`    //企业标识
+	UserId       string `form:"userId,optional"`       //用户标识
+	ResourceType string `form:"resourceType,optional"` //资源类型
 }
 }
 
 
 type AuthRes struct {
 type AuthRes struct {
@@ -80,8 +83,9 @@ type AuthRes struct {
 }
 }
 
 
 type BalanceReq struct {
 type BalanceReq struct {
-	AccountId string `form:"accountId,optional"` //企业标识
-	UserId    string `form:"userId,optional"`    //用户标识
+	AccountId    string `form:"accountId,optional"`    //企业标识
+	UserId       string `form:"userId,optional"`       //用户标识
+	ResourceType string `form:"resourceType,optional"` //资源类型
 }
 }
 
 
 type BalanceRes struct {
 type BalanceRes struct {

+ 1 - 0
entity/accountResources.go

@@ -11,4 +11,5 @@ type Balance struct {
 	Spec         string `xorm:"spec" form:"spec" json:"spec"`                         //规格
 	Spec         string `xorm:"spec" form:"spec" json:"spec"`                         //规格
 	AppId        string `xorm:"appId" form:"appId" json:"appId"`                      //标识
 	AppId        string `xorm:"appId" form:"appId" json:"appId"`                      //标识
 	EndTime      string `xorm:"endTime" form:"endTime" json:"endTime"`                //截止时间
 	EndTime      string `xorm:"endTime" form:"endTime" json:"endTime"`                //截止时间
+	VipTime      string `xorm:"vipTime" form:"vipTime" json:"vipTime"`                //超级订阅截止时间
 }
 }

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

@@ -8,8 +8,7 @@ type Config struct {
 	Node           int    // 节点
 	Node           int    // 节点
 	CalleeId       string // 服务名字
 	CalleeId       string // 服务名字
 	DedupUrl       string
 	DedupUrl       string
+	FileSystemConf zrpc.RpcClientConf
 }
 }
 
 
 var ConfigJson Config
 var ConfigJson Config
-
-

+ 1 - 0
rpc/internal/logic/purchaseuserbalancelogic.go

@@ -40,6 +40,7 @@ func (l *PurchaseUserBalanceLogic) PurchaseUserBalance(in *resourcesCenter.Resou
 		AppId:        in.AppId,
 		AppId:        in.AppId,
 		Model:        in.Model,
 		Model:        in.Model,
 		EndTime:      in.EndTime,
 		EndTime:      in.EndTime,
+		VipTime:      in.VipTime,
 	}
 	}
 	detailed := &resourcesCenter.Detailed{
 	detailed := &resourcesCenter.Detailed{
 		AccountId:    in.AccountId,
 		AccountId:    in.AccountId,

+ 4 - 0
rpc/resourcesCenter.proto

@@ -22,6 +22,7 @@ message Balance {
     string appId = 8; //标识
     string appId = 8; //标识
     int64  model = 9; //操作类型0使用1新增
     int64  model = 9; //操作类型0使用1新增
     string endTime = 10; //截止时间
     string endTime = 10; //截止时间
+    string vipTime = 12; //超级订阅截止时间
     string Remarks = 11; //备注
     string Remarks = 11; //备注
 }
 }
 message Resources {
 message Resources {
@@ -39,6 +40,7 @@ message Resources {
     string infoId = 13; //信息标识
     string infoId = 13; //信息标识
     int64 duplicateRemoval = 14; //是否去重0不去1去重
     int64 duplicateRemoval = 14; //是否去重0不去1去重
     string ruleId = 15; //使用规则标识
     string ruleId = 15; //使用规则标识
+    string vipTime = 16; //超级订阅截止时间
     string userId = 11; //用户标识
     string userId = 11; //用户标识
 }
 }
 message Detailed {
 message Detailed {
@@ -90,6 +92,7 @@ message ConsumeRecord {
 
 
 message ResourcesReq {
 message ResourcesReq {
     string accountId = 1;
     string accountId = 1;
+    string resourceType = 2; //资源代码
 }
 }
 
 
 message PreviewReq {
 message PreviewReq {
@@ -125,6 +128,7 @@ message RecordReq {
     int64 pageSize = 3;
     int64 pageSize = 3;
     int64 page = 4;
     int64 page = 4;
     int64 state = 5; //0 查消费,1查充值
     int64 state = 5; //0 查消费,1查充值
+     string resourceType = 6; //资源代码
 }
 }
 
 
 message ConsumeRecordRes {
 message ConsumeRecordRes {

+ 228 - 188
rpc/resourcesCenter/resourcesCenter.pb.go

@@ -157,6 +157,7 @@ type Balance struct {
 	AppId        string `protobuf:"bytes,8,opt,name=appId,proto3" json:"appId,omitempty"`                //标识
 	AppId        string `protobuf:"bytes,8,opt,name=appId,proto3" json:"appId,omitempty"`                //标识
 	Model        int64  `protobuf:"varint,9,opt,name=model,proto3" json:"model,omitempty"`               //操作类型0使用1新增
 	Model        int64  `protobuf:"varint,9,opt,name=model,proto3" json:"model,omitempty"`               //操作类型0使用1新增
 	EndTime      string `protobuf:"bytes,10,opt,name=endTime,proto3" json:"endTime,omitempty"`           //截止时间
 	EndTime      string `protobuf:"bytes,10,opt,name=endTime,proto3" json:"endTime,omitempty"`           //截止时间
+	VipTime      string `protobuf:"bytes,12,opt,name=vipTime,proto3" json:"vipTime,omitempty"`           //超级订阅截止时间
 	Remarks      string `protobuf:"bytes,11,opt,name=Remarks,proto3" json:"Remarks,omitempty"`           //备注
 	Remarks      string `protobuf:"bytes,11,opt,name=Remarks,proto3" json:"Remarks,omitempty"`           //备注
 }
 }
 
 
@@ -262,6 +263,13 @@ func (x *Balance) GetEndTime() string {
 	return ""
 	return ""
 }
 }
 
 
+func (x *Balance) GetVipTime() string {
+	if x != nil {
+		return x.VipTime
+	}
+	return ""
+}
+
 func (x *Balance) GetRemarks() string {
 func (x *Balance) GetRemarks() string {
 	if x != nil {
 	if x != nil {
 		return x.Remarks
 		return x.Remarks
@@ -288,6 +296,7 @@ type Resources struct {
 	InfoId           string `protobuf:"bytes,13,opt,name=infoId,proto3" json:"infoId,omitempty"`                      //信息标识
 	InfoId           string `protobuf:"bytes,13,opt,name=infoId,proto3" json:"infoId,omitempty"`                      //信息标识
 	DuplicateRemoval int64  `protobuf:"varint,14,opt,name=duplicateRemoval,proto3" json:"duplicateRemoval,omitempty"` //是否去重0不去1去重
 	DuplicateRemoval int64  `protobuf:"varint,14,opt,name=duplicateRemoval,proto3" json:"duplicateRemoval,omitempty"` //是否去重0不去1去重
 	RuleId           string `protobuf:"bytes,15,opt,name=ruleId,proto3" json:"ruleId,omitempty"`                      //使用规则标识
 	RuleId           string `protobuf:"bytes,15,opt,name=ruleId,proto3" json:"ruleId,omitempty"`                      //使用规则标识
+	VipTime          string `protobuf:"bytes,16,opt,name=vipTime,proto3" json:"vipTime,omitempty"`                    //超级订阅截止时间
 	UserId           string `protobuf:"bytes,11,opt,name=userId,proto3" json:"userId,omitempty"`                      //用户标识
 	UserId           string `protobuf:"bytes,11,opt,name=userId,proto3" json:"userId,omitempty"`                      //用户标识
 }
 }
 
 
@@ -421,6 +430,13 @@ func (x *Resources) GetRuleId() string {
 	return ""
 	return ""
 }
 }
 
 
+func (x *Resources) GetVipTime() string {
+	if x != nil {
+		return x.VipTime
+	}
+	return ""
+}
+
 func (x *Resources) GetUserId() string {
 func (x *Resources) GetUserId() string {
 	if x != nil {
 	if x != nil {
 		return x.UserId
 		return x.UserId
@@ -861,7 +877,8 @@ type ResourcesReq struct {
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 	unknownFields protoimpl.UnknownFields
 
 
-	AccountId string `protobuf:"bytes,1,opt,name=accountId,proto3" json:"accountId,omitempty"`
+	AccountId    string `protobuf:"bytes,1,opt,name=accountId,proto3" json:"accountId,omitempty"`
+	ResourceType string `protobuf:"bytes,2,opt,name=resourceType,proto3" json:"resourceType,omitempty"` //资源代码
 }
 }
 
 
 func (x *ResourcesReq) Reset() {
 func (x *ResourcesReq) Reset() {
@@ -903,6 +920,13 @@ func (x *ResourcesReq) GetAccountId() string {
 	return ""
 	return ""
 }
 }
 
 
+func (x *ResourcesReq) GetResourceType() string {
+	if x != nil {
+		return x.ResourceType
+	}
+	return ""
+}
+
 type PreviewReq struct {
 type PreviewReq struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -1179,11 +1203,12 @@ type RecordReq struct {
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 	unknownFields protoimpl.UnknownFields
 
 
-	AccountId string `protobuf:"bytes,1,opt,name=accountId,proto3" json:"accountId,omitempty"`
-	UserId    string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"`
-	PageSize  int64  `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
-	Page      int64  `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"`
-	State     int64  `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"` //0 查消费,1查充值
+	AccountId    string `protobuf:"bytes,1,opt,name=accountId,proto3" json:"accountId,omitempty"`
+	UserId       string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"`
+	PageSize     int64  `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
+	Page         int64  `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"`
+	State        int64  `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"`              //0 查消费,1查充值
+	ResourceType string `protobuf:"bytes,6,opt,name=resourceType,proto3" json:"resourceType,omitempty"` //资源代码
 }
 }
 
 
 func (x *RecordReq) Reset() {
 func (x *RecordReq) Reset() {
@@ -1253,6 +1278,13 @@ func (x *RecordReq) GetState() int64 {
 	return 0
 	return 0
 }
 }
 
 
+func (x *RecordReq) GetResourceType() string {
+	if x != nil {
+		return x.ResourceType
+	}
+	return ""
+}
+
 type ConsumeRecordRes struct {
 type ConsumeRecordRes struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -1402,7 +1434,7 @@ var file_resourcesCenter_proto_rawDesc = []byte{
 	0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
 	0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
 	0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e,
 	0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e,
 	0x4e, 0x75, 0x6d, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x65, 0x64, 0x75,
 	0x4e, 0x75, 0x6d, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x65, 0x64, 0x75,
-	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x22, 0xad, 0x02, 0x0a, 0x07, 0x42, 0x61,
+	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x22, 0xc7, 0x02, 0x0a, 0x07, 0x42, 0x61,
 	0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
 	0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
 	0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
 	0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
 	0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64,
 	0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64,
@@ -1420,191 +1452,199 @@ var file_resourcesCenter_proto_rawDesc = []byte{
 	0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
 	0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
 	0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
 	0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
 	0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12,
 	0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12,
-	0x18, 0x0a, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0xa3, 0x03, 0x0a, 0x09, 0x52, 0x65,
-	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75,
-	0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f,
-	0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79,
-	0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e,
-	0x79, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e,
-	0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72,
-	0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
-	0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x72,
-	0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12,
-	0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18,
-	0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x61,
-	0x70, 0x70, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49,
-	0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69,
-	0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d,
-	0x65, 0x12, 0x18, 0x0a, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0c, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x69,
-	0x6e, 0x66, 0x6f, 0x49, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6e, 0x66,
-	0x6f, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65,
-	0x52, 0x65, 0x6d, 0x6f, 0x76, 0x61, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x64,
-	0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x61, 0x6c, 0x12,
-	0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
-	0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22,
-	0xe6, 0x02, 0x0a, 0x08, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09,
-	0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f,
-	0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63,
-	0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f,
-	0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
-	0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06,
-	0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x75,
-	0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x06,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a,
-	0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08,
-	0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
-	0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x61,
-	0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c,
-	0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06,
-	0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f,
-	0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x65, 0x64,
-	0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65,
-	0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x6d,
-	0x61, 0x72, 0x6b, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73,
-	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x41, 0x75, 0x74, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
-	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63,
-	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61,
-	0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f,
-	0x75, 0x72, 0x63, 0x65, 0x73, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72,
-	0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75,
-	0x6f, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x71, 0x75, 0x6f, 0x74, 0x61,
-	0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x05, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18,
-	0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xa3, 0x01, 0x0a,
-	0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65,
-	0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64,
-	0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
-	0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c,
-	0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01,
+	0x18, 0x0a, 0x07, 0x76, 0x69, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x07, 0x76, 0x69, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x52, 0x65, 0x6d,
+	0x61, 0x72, 0x6b, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x52, 0x65, 0x6d, 0x61,
+	0x72, 0x6b, 0x73, 0x22, 0xbd, 0x03, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+	0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12,
+	0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x22, 0x0a,
+	0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49,
+	0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+	0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73,
+	0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d,
+	0x62, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65,
+	0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x08,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d,
+	0x6f, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65,
+	0x6c, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x52,
+	0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x52, 0x65,
+	0x6d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x18,
+	0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x12, 0x2a, 0x0a,
+	0x10, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x61,
+	0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61,
+	0x74, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c,
+	0x65, 0x49, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49,
+	0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x69, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x07, 0x76, 0x69, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75,
+	0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65,
+	0x72, 0x49, 0x64, 0x22, 0xe6, 0x02, 0x0a, 0x08, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64,
+	0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c,
+	0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c,
+	0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01,
 	0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
 	0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
-	0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
-	0x73, 0x70, 0x65, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x69, 0x72, 0x74, 0x79, 0x4e, 0x75,
-	0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x68, 0x69, 0x72, 0x74, 0x79, 0x4e,
-	0x75, 0x6d, 0x22, 0x9b, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65,
-	0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04,
-	0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+	0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c, 0x65,
+	0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64,
+	0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65,
+	0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c,
+	0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64,
+	0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x64, 0x75,
+	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x12, 0x18,
+	0x0a, 0x07, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x07, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa1, 0x01, 0x0a,
+	0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x41, 0x75, 0x74, 0x68, 0x12, 0x0e,
+	0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c,
+	0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b,
+	0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x49, 0x64, 0x12, 0x14,
+	0x0a, 0x05, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x71,
+	0x75, 0x6f, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x05, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74,
+	0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
+	0x22, 0xa3, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x61, 0x6c,
+	0x61, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62,
+	0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,
 	0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
 	0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
-	0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
-	0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x05,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d,
-	0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x18, 0x06, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75,
-	0x6d, 0x62, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72,
-	0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
-	0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73,
-	0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73,
-	0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b,
-	0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73,
-	0x22, 0x2c, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71,
-	0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x66,
-	0x0a, 0x0a, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06,
-	0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6e,
-	0x66, 0x6f, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49,
-	0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
-	0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79,
-	0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
-	0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x76, 0x69,
-	0x65, 0x77, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
-	0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x4e, 0x75, 0x6d,
-	0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x4e,
-	0x75, 0x6d, 0x62, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e,
-	0x4e, 0x75, 0x6d, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x65, 0x64, 0x75,
-	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x6d,
-	0x61, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65,
-	0x6d, 0x61, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x22, 0x74, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75,
-	0x72, 0x63, 0x65, 0x73, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63,
-	0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
-	0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x64, 0x61, 0x74,
-	0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
-	0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
-	0x63, 0x65, 0x73, 0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x77, 0x0a,
-	0x11, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52,
-	0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
-	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
-	0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20,
-	0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72,
-	0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65,
-	0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x87, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x63, 0x6f, 0x72,
-	0x64, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+	0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x06, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x69, 0x72,
+	0x74, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x68, 0x69,
+	0x72, 0x74, 0x79, 0x4e, 0x75, 0x6d, 0x22, 0x9b, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x75,
+	0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72,
+	0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64,
+	0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
+	0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+	0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f,
+	0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62,
+	0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,
+	0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d,
+	0x62, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69,
+	0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64,
+	0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x75, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1e,
+	0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a,
+	0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65,
+	0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x6d,
+	0x61, 0x72, 0x6b, 0x73, 0x22, 0x50, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+	0x73, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49,
 	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
 	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
-	0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 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, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74,
-	0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
-	0x22, 0x8a, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f,
-	0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
-	0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28,
-	0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e,
-	0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72,
-	0x64, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74,
-	0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x5f, 0x0a,
-	0x09, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65,
-	0x72, 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d,
-	0x65, 0x72, 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x72, 0x67,
-	0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65,
-	0x72, 0x67, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49,
-	0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x32, 0xc2,
-	0x04, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74,
-	0x65, 0x72, 0x12, 0x56, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
-	0x63, 0x65, 0x73, 0x41, 0x75, 0x74, 0x68, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
-	0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
-	0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
-	0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
-	0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x12, 0x66, 0x69,
-	0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65,
-	0x12, 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74,
-	0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a,
-	0x22, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65,
-	0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65,
-	0x52, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x75,
-	0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75,
-	0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72,
-	0x64, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
-	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65,
-	0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x13, 0x70, 0x75, 0x72, 0x63, 0x68,
-	0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1a,
-	0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72,
-	0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73,
+	0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79,
+	0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
+	0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x66, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65,
+	0x77, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09,
+	0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65,
+	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x9e,
+	0x01, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a,
+	0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64,
+	0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72,
+	0x65, 0x70, 0x65, 0x61, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0a, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x12, 0x24, 0x0a, 0x0d, 0x64,
+	0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d,
+	0x62, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x18, 0x05,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x22,
+	0x74, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x41, 0x75, 0x74, 0x68,
+	0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x12, 0x32, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
+	0x1e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65,
+	0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x41, 0x75, 0x74, 0x68, 0x52,
+	0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x77, 0x0a, 0x11, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+	0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f,
+	0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18,
+	0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
+	0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+	0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+	0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xab,
+	0x01, 0x0a, 0x09, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09,
+	0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73,
+	0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72,
+	0x49, 0x64, 0x12, 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, 0x12, 0x12,
+	0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61,
+	0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f,
+	0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
+	0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x8a, 0x01, 0x0a,
+	0x10, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65,
+	0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
+	0x32, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e,
+	0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e,
+	0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x04, 0x64,
+	0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x5f, 0x0a, 0x09, 0x6d, 0x65, 0x72,
+	0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x55,
+	0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x72, 0x67, 0x65,
+	0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, 0x55, 0x73,
+	0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64,
+	0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x32, 0xc2, 0x04, 0x0a, 0x0f, 0x52,
+	0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x56,
+	0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x41,
+	0x75, 0x74, 0x68, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43,
+	0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52,
+	0x65, 0x71, 0x1a, 0x22, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65,
+	0x6e, 0x74, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61,
+	0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x12, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x63,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x72,
+	0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52,
+	0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x72, 0x65,
+	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x41, 0x63,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x12,
+	0x52, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65,
+	0x63, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71,
+	0x1a, 0x21, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74,
+	0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
+	0x52, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x13, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x55,
+	0x73, 0x65, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73,
 	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73,
 	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73,
-	0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72,
-	0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75,
-	0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75,
-	0x72, 0x63, 0x65, 0x73, 0x1a, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
-	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65,
-	0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x64, 0x50, 0x72,
-	0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
-	0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52,
-	0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65,
-	0x6e, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x12,
-	0x42, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x1a, 0x2e, 0x72,
-	0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x6d,
-	0x65, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75,
-	0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
-	0x6e, 0x73, 0x65, 0x42, 0x12, 0x5a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
-	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+	0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+	0x65, 0x12, 0x4f, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61,
+	0x69, 0x6c, 0x65, 0x64, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x1a, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74,
+	0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+	0x73, 0x65, 0x12, 0x47, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x64, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65,
+	0x77, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e,
+	0x74, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x1b,
+	0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72,
+	0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x09, 0x75,
+	0x73, 0x65, 0x72, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75,
+	0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x6d, 0x65, 0x72, 0x67, 0x65,
+	0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42,
+	0x12, 0x5a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74,
+	0x65, 0x72, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 }
 
 
 var (
 var (

+ 10 - 10
rpc/resourcesCenterclient/resourcescenter.go

@@ -14,22 +14,22 @@ import (
 )
 )
 
 
 type (
 type (
-	ResourcesReq      = resourcesCenter.ResourcesReq
-	PreviewRes        = resourcesCenter.PreviewRes
-	UseUserResponse   = resourcesCenter.UseUserResponse
-	Resources         = resourcesCenter.Resources
-	ConsumeRecord     = resourcesCenter.ConsumeRecord
-	Balance           = resourcesCenter.Balance
-	Detailed          = resourcesCenter.Detailed
 	Response          = resourcesCenter.Response
 	Response          = resourcesCenter.Response
-	PreviewReq        = resourcesCenter.PreviewReq
+	ResourceBalance   = resourcesCenter.ResourceBalance
 	AccountBalanceRes = resourcesCenter.AccountBalanceRes
 	AccountBalanceRes = resourcesCenter.AccountBalanceRes
+	ConsumeRecord     = resourcesCenter.ConsumeRecord
+	ResourcesReq      = resourcesCenter.ResourcesReq
+	PreviewReq        = resourcesCenter.PreviewReq
 	RecordReq         = resourcesCenter.RecordReq
 	RecordReq         = resourcesCenter.RecordReq
 	ConsumeRecordRes  = resourcesCenter.ConsumeRecordRes
 	ConsumeRecordRes  = resourcesCenter.ConsumeRecordRes
+	Balance           = resourcesCenter.Balance
+	PreviewRes        = resourcesCenter.PreviewRes
+	ResourcesAuthRes  = resourcesCenter.ResourcesAuthRes
 	MergeInfo         = resourcesCenter.MergeInfo
 	MergeInfo         = resourcesCenter.MergeInfo
+	UseUserResponse   = resourcesCenter.UseUserResponse
+	Resources         = resourcesCenter.Resources
+	Detailed          = resourcesCenter.Detailed
 	ResourcesAuth     = resourcesCenter.ResourcesAuth
 	ResourcesAuth     = resourcesCenter.ResourcesAuth
-	ResourceBalance   = resourcesCenter.ResourceBalance
-	ResourcesAuthRes  = resourcesCenter.ResourcesAuthRes
 
 
 	ResourcesCenter interface {
 	ResourcesCenter interface {
 		// 查询账户资源权限
 		// 查询账户资源权限

+ 16 - 0
rpc/test/resourcescenter.yaml

@@ -0,0 +1,16 @@
+Name: resourcescenter.rpc
+ListenOn: 127.0.0.1:8080
+Etcd:
+  Hosts:
+    - 127.0.0.1:2379
+  Key: resourcescenter.rpc
+DataSource: root:Topnet123@tcp(192.168.3.11:3366)/jy_user_center?charset=utf8mb4&parseTime=true&loc=Local
+FileSystemConf:
+  Etcd:
+    Hosts:
+      - 127.0.0.1:2379
+    Key: resourcescenter.rpc
+CalleeId: resourcescenter.rpc
+
+Node: 1
+DedupUrl: http://192.168.3.204:8888

+ 110 - 0
rpc/test/test1_test.go

@@ -0,0 +1,110 @@
+package test
+
+import (
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/config"
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenterclient"
+	"context"
+	"flag"
+	"github.com/tal-tech/go-zero/core/conf"
+	"github.com/tal-tech/go-zero/zrpc"
+	"log"
+	"testing"
+	"time"
+)
+
+var configFile = flag.String("f", "resourcescenter.yaml", "the config file")
+var c config.Config
+
+func init() {
+	conf.MustLoad(*configFile, &c)
+}
+
+//充值
+func Test_activityLottery(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+	FileSystem := resourcesCenterclient.NewResourcesCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &resourcesCenterclient.Resources{
+		AccountId:    "61b82ee86f84230ed57ee87a",
+		CompanyId:    0,
+		DepartmentId: 0,
+		Name:         "附件下载包",
+		ResourceType: "附件下载包",
+		Number:       120,
+		AppId:        "10000",
+		EndTime:      "2022-01-31",
+		Spec:         "个",
+		Remarks:      "备注",
+		VipTime:      "2022-01-20",
+	}
+	res, err := FileSystem.PurchaseUserBalance(ctx, req)
+	log.Println("err ", err)
+	log.Println("req ", res)
+}
+
+//使用
+func Test_useUserDetailed(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+	FileSystem := resourcesCenterclient.NewResourcesCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &resourcesCenterclient.Resources{
+		AccountId:        "61b82ee86f84230ed57ee87a",
+		CompanyId:        0,
+		DepartmentId:     0,
+		Name:             "附件下载包",
+		ResourceType:     "附件下载包",
+		Number:           400,
+		AppId:            "10000",
+		EndTime:          "2022-01-31",
+		Spec:             "个",
+		Remarks:          "备注",
+		VipTime:          "2022-01-20",
+		DuplicateRemoval: 0,
+		UserId:           "61b82ee86f84230ed57ee87a",
+	}
+	res, err := FileSystem.UseUserDetailed(ctx, req)
+	log.Println("err ", err)
+	log.Println("req ", res)
+}
+
+//流水查询
+func Test_findConsumeRecord(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+	FileSystem := resourcesCenterclient.NewResourcesCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &resourcesCenterclient.RecordReq{
+		AccountId:    "61b82ee86f84230ed57ee87a",
+		UserId:       "61b82ee86f84230ed57ee87a",
+		PageSize:     10,
+		Page:         1,
+		State:        1, //0查消耗记录 1 查充值记录
+		ResourceType: "附件下载包",
+	}
+	res, err := FileSystem.FindConsumeRecord(ctx, req)
+	log.Println("err ", err)
+	log.Println("req ", res)
+}
+
+//余额
+func Test_findAccountBalance(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+	FileSystem := resourcesCenterclient.NewResourcesCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &resourcesCenterclient.ResourcesReq{
+		AccountId:    "61b82ee86f84230ed57ee87a",
+		ResourceType: "附件下载包",
+	}
+	res, err := FileSystem.FindAccountBalance(ctx, req)
+	log.Println("err ", err)
+	log.Println("req ", res)
+}
+
+//合并账号
+func Test_userMerge(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+	FileSystem := resourcesCenterclient.NewResourcesCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &resourcesCenterclient.MergeInfo{
+		MergedUser: "61b82ee86f84230ed57ee87a",
+		MergeUser:  "61b82ee86f84230ed57ee87a",
+		AppId:      "10000",
+	}
+	res, err := FileSystem.UserMerge(ctx, req)
+	log.Println("err ", err)
+	log.Println("req ", res)
+}

+ 81 - 56
service/balanceService.go

@@ -25,14 +25,27 @@ func (service *BalanceService) PurchaseUserBalance(balanceData *resourcesCenter.
 	orm := entity.Engine.NewSession()
 	orm := entity.Engine.NewSession()
 	err := orm.Begin()
 	err := orm.Begin()
 	balance := entity.Balance{}
 	balance := entity.Balance{}
-	fool, err := orm.Table(AccountResources).
-		Select("*").
-		Where("accountId=? and  companyId=? and  departmentId=? and  ResourceType=? and  endTime=?", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, balanceData.EndTime).
-		Get(&balance)
-	if err != nil && !fool {
-		fmt.Println("结存查询失败:", err)
-		return entity.ErrorCode, "企业下的组织查询失败"
+	log.Println(balance.ResourceType, "附件下载包", balance.ResourceType == "附件下载包")
+	if balanceData.ResourceType == "附件下载包" {
+		fool, err := orm.Table(AccountResources).
+			Select("*").
+			Where("accountId=? and  companyId=? and  departmentId=? and  ResourceType=? and  endTime=? and vipTime=?", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, balanceData.EndTime, balanceData.VipTime).
+			Get(&balance)
+		if err != nil && !fool {
+			fmt.Println("结存查询失败:", err)
+			return entity.ErrorCode, "企业下的组织查询失败"
+		}
+	} else {
+		fool, err := orm.Table(AccountResources).
+			Select("*").
+			Where("accountId=? and  companyId=? and  departmentId=? and  ResourceType=? and  endTime=? ", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, balanceData.EndTime).
+			Get(&balance)
+		if err != nil && !fool {
+			fmt.Println("结存查询失败:", err)
+			return entity.ErrorCode, "企业下的组织查询失败"
+		}
 	}
 	}
+
 	//新增流水记录
 	//新增流水记录
 	detailed := entity.Detailed{
 	detailed := entity.Detailed{
 		AccountId:    detailedData.AccountId,
 		AccountId:    detailedData.AccountId,
@@ -68,7 +81,7 @@ func (service *BalanceService) PurchaseUserBalance(balanceData *resourcesCenter.
 			Spec:         balanceData.Spec,
 			Spec:         balanceData.Spec,
 			AppId:        balanceData.AppId,
 			AppId:        balanceData.AppId,
 			EndTime:      balanceData.EndTime,
 			EndTime:      balanceData.EndTime,
-		}
+			VipTime:      balanceData.VipTime}
 		insertNumb, err = orm.Table(AccountResources).Insert(&balance)
 		insertNumb, err = orm.Table(AccountResources).Insert(&balance)
 		if err != nil || insertNumb <= 0 {
 		if err != nil || insertNumb <= 0 {
 			fmt.Println("结存查询失败:", err)
 			fmt.Println("结存查询失败:", err)
@@ -78,27 +91,9 @@ func (service *BalanceService) PurchaseUserBalance(balanceData *resourcesCenter.
 		orm.Commit()
 		orm.Commit()
 		return entity.SuccessCode, "结存新增成功"
 		return entity.SuccessCode, "结存新增成功"
 	}
 	}
-	/*if in.Model == 0 {
-		if (balance.Number < in.Number) {
-			return entity.ErrorCode, "该用户结存不够不可使用"
-		}
-		balance.Number = balance.Number - in.Number
-		updateNumb, err := orm.Table(AccountResources).
-			Cols("number").
-			Where("accountId=? and  companyId=? and  departmentId=? and  resourceType=?", in.AccountId, in.CompanyId, in.DepartmentId, in.ResourceType).
-			Update(&balance)
-		if err != nil {
-			fmt.Println("结存修改失败:", err)
-			return entity.ErrorCode, "结存修改失败"
-		}
-		if updateNumb > 0 {
-			return entity.SuccessCode, "结存修改成功"
-		}
-		return entity.ErrorCode, "结存修改失败"
-	}*/
 	balance.Number = balance.Number + balanceData.Number
 	balance.Number = balance.Number + balanceData.Number
 	updateNumb, err := orm.Table(AccountResources).
 	updateNumb, err := orm.Table(AccountResources).
-		Where("accountId=? and  companyId=? and  departmentId=? and  resourceType=? and endTime=?", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, balanceData.EndTime).
+		Where("accountId=? and  companyId=? and  departmentId=? and  resourceType=? and endTime=? and  vipTime=?", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, balanceData.EndTime, balanceData.VipTime).
 		Update(&balance)
 		Update(&balance)
 	if err != nil || updateNumb <= 0 {
 	if err != nil || updateNumb <= 0 {
 		orm.Rollback()
 		orm.Rollback()
@@ -110,23 +105,23 @@ func (service *BalanceService) PurchaseUserBalance(balanceData *resourcesCenter.
 }
 }
 
 
 //根据账户标识使用资源
 //根据账户标识使用资源
-func (service *BalanceService) UseUserDetailed(duplicateRemoval int64, balanceData *resourcesCenter.Balance, detailedData *resourcesCenter.Detailed, infoId, url string) (int64, string,int64) {
+func (service *BalanceService) UseUserDetailed(duplicateRemoval int64, balanceData *resourcesCenter.Balance, detailedData *resourcesCenter.Detailed, infoId, url string) (int64, string, int64) {
 	orm := entity.Engine.NewSession()
 	orm := entity.Engine.NewSession()
 	err := orm.Begin()
 	err := orm.Begin()
 	//去重
 	//去重
 	deductionNumb := detailedData.Number
 	deductionNumb := detailedData.Number
-	deductionNumbs:= detailedData.Number
+	deductionNumbs := detailedData.Number
 	if duplicateRemoval == 1 {
 	if duplicateRemoval == 1 {
-		dataDesc:=0
+		dataDesc := 0
 		if detailedData.ResourceType == "标准字段包" {
 		if detailedData.ResourceType == "标准字段包" {
 			dataDesc = 2
 			dataDesc = 2
 		} else if detailedData.ResourceType == "高级字段包" {
 		} else if detailedData.ResourceType == "高级字段包" {
 			dataDesc = 1
 			dataDesc = 1
 		}
 		}
-		url = url + "/data/dedupAndSave?dataDesc="+fmt.Sprint(dataDesc)+"&personId=" + detailedData.UserId + "&infoId=" + infoId + "&accountId=" + detailedData.AccountId
+		url = url + "/data/dedupAndSave?dataDesc=" + fmt.Sprint(dataDesc) + "&personId=" + detailedData.UserId + "&infoId=" + infoId + "&accountId=" + detailedData.AccountId
 		res, urlerr := http.PostForm(url, nil)
 		res, urlerr := http.PostForm(url, nil)
 		if urlerr != nil {
 		if urlerr != nil {
-			return entity.ErrorCode, "去重失败",0
+			return entity.ErrorCode, "去重失败", 0
 		}
 		}
 		defer res.Body.Close()
 		defer res.Body.Close()
 		body, _ := ioutil.ReadAll(res.Body)
 		body, _ := ioutil.ReadAll(res.Body)
@@ -134,7 +129,7 @@ func (service *BalanceService) UseUserDetailed(duplicateRemoval int64, balanceDa
 		_ = json.Unmarshal([]byte(body), &dat)
 		_ = json.Unmarshal([]byte(body), &dat)
 		if dat.Code == 0 {
 		if dat.Code == 0 {
 			deductionNumb = dat.Data.NewCount
 			deductionNumb = dat.Data.NewCount
-			deductionNumbs= dat.Data.NewCount
+			deductionNumbs = dat.Data.NewCount
 		}
 		}
 	}
 	}
 	//查询结存是否够用
 	//查询结存是否够用
@@ -142,18 +137,27 @@ func (service *BalanceService) UseUserDetailed(duplicateRemoval int64, balanceDa
 		Age int `xorm:"age"`
 		Age int `xorm:"age"`
 	}
 	}
 	sumStruct := "0"
 	sumStruct := "0"
-	_, err = orm.Table(AccountResources).
-		Select("sum(number) as  number").
-		Where("accountId=? and  companyId=? and  departmentId=? and  ResourceType=? and  endTime>=?", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, time.Now().Format("2006-01-02")).
-		Get(&sumStruct)
+	if balanceData.ResourceType == "附件下载包" {
+		now := time.Now()
+		endTime := now.AddDate(0, int(-now.Month()+2), -now.Day()).Format("2006-01-02")
+		_, err = orm.Table(AccountResources).
+			Select("sum(number) as  number").
+			Where("accountId=? and  companyId=? and  departmentId=? and  ResourceType=? and  endTime=? and vipTime>?", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, endTime, time.Now().Format("2006-01-02")).
+			Get(&sumStruct)
+	} else {
+		_, err = orm.Table(AccountResources).
+			Select("sum(number) as  number").
+			Where("accountId=? and  companyId=? and  departmentId=? and  ResourceType=? and  endTime>=?", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, time.Now().Format("2006-01-02")).
+			Get(&sumStruct)
+	}
 	if err != nil {
 	if err != nil {
 		fmt.Println("结存查询失败:", err)
 		fmt.Println("结存查询失败:", err)
 		orm.Rollback()
 		orm.Rollback()
-		return entity.ErrorCode, "结存查询失败",0
+		return entity.ErrorCode, "结存查询失败", 0
 	}
 	}
 	surplusNumb, err := strconv.ParseInt(sumStruct, 10, 64)
 	surplusNumb, err := strconv.ParseInt(sumStruct, 10, 64)
 	if surplusNumb < deductionNumb {
 	if surplusNumb < deductionNumb {
-		return entity.ErrorCode, "结存不足,请立即充值",0
+		return entity.ErrorCode, "结存不足,请立即充值", 0
 	}
 	}
 	//新增流水记录
 	//新增流水记录
 	detailed := entity.Detailed{
 	detailed := entity.Detailed{
@@ -174,23 +178,34 @@ func (service *BalanceService) UseUserDetailed(duplicateRemoval int64, balanceDa
 	if err != nil || insertNumb <= 0 {
 	if err != nil || insertNumb <= 0 {
 		fmt.Println("新增流水失败:", err)
 		fmt.Println("新增流水失败:", err)
 		orm.Rollback()
 		orm.Rollback()
-		return entity.ErrorCode, "新增流水失败",0
+		return entity.ErrorCode, "新增流水失败", 0
 	}
 	}
 	if deductionNumb == 0 {
 	if deductionNumb == 0 {
 		orm.Commit()
 		orm.Commit()
-		return entity.SuccessCode, "修改结存成功",deductionNumb
+		return entity.SuccessCode, "修改结存成功", deductionNumb
 	}
 	}
 	//修改结存
 	//修改结存
 	balanceList := []entity.Balance{}
 	balanceList := []entity.Balance{}
-	err = orm.Table(AccountResources).
-		Select("*").
-		Where("accountId=? and  companyId=? and  departmentId=? and  number>0 and  ResourceType=? and  endTime>=?", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, time.Now().Format("2006-01-02")).
-		OrderBy("endTime").
-		Find(&balanceList)
+	if balanceData.ResourceType == "附件下载包" {
+		now := time.Now()
+		endTime := now.AddDate(0, int(-now.Month()+2), -now.Day()).Format("2006-01-02")
+		err = orm.Table(AccountResources).
+			Select("*").
+			Where("accountId=? and  companyId=? and  departmentId=? and  number>0 and  ResourceType=? and  endTime=?  and vipTime>=?  ", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, endTime, time.Now().Format("2006-01-02")).
+			OrderBy("endTime").
+			Find(&balanceList)
+	} else {
+		err = orm.Table(AccountResources).
+			Select("*").
+			Where("accountId=? and  companyId=? and  departmentId=? and  number>0 and  ResourceType=? and  endTime>=?   ", balanceData.AccountId, balanceData.CompanyId, balanceData.DepartmentId, balanceData.ResourceType, time.Now().Format("2006-01-02")).
+			OrderBy("endTime").
+			Find(&balanceList)
+	}
+
 	if err != nil {
 	if err != nil {
 		fmt.Println("结存查询失败:", err)
 		fmt.Println("结存查询失败:", err)
 		orm.Rollback()
 		orm.Rollback()
-		return entity.ErrorCode, "企业下的组织查询失败",0
+		return entity.ErrorCode, "企业下的组织查询失败", 0
 	}
 	}
 	for _, value := range balanceList {
 	for _, value := range balanceList {
 		if value.Number > deductionNumb {
 		if value.Number > deductionNumb {
@@ -206,14 +221,14 @@ func (service *BalanceService) UseUserDetailed(duplicateRemoval int64, balanceDa
 		if err != nil || updateNumb <= 0 {
 		if err != nil || updateNumb <= 0 {
 			fmt.Println("结存修改失败:", err)
 			fmt.Println("结存修改失败:", err)
 			orm.Rollback()
 			orm.Rollback()
-			return entity.ErrorCode, "结存修改失败",0
+			return entity.ErrorCode, "结存修改失败", 0
 		}
 		}
 		if deductionNumb == 0 {
 		if deductionNumb == 0 {
 			break
 			break
 		}
 		}
 	}
 	}
 	orm.Commit()
 	orm.Commit()
-	return entity.SuccessCode, "使用结存成功",deductionNumbs
+	return entity.SuccessCode, "使用结存成功", deductionNumbs
 }
 }
 
 
 //去重查询
 //去重查询
@@ -221,7 +236,7 @@ func (service *BalanceService) FindPreview(in *resourcesCenter.PreviewReq, url s
 	orm := entity.Engine
 	orm := entity.Engine
 	balance := []entity.AccountBalance{}
 	balance := []entity.AccountBalance{}
 	//先查询余额
 	//先查询余额
-	dataDesc:=0
+	dataDesc := 0
 	if in.ResourceType == "标准字段包" {
 	if in.ResourceType == "标准字段包" {
 		dataDesc = 2
 		dataDesc = 2
 	} else if in.ResourceType == "高级字段包" {
 	} else if in.ResourceType == "高级字段包" {
@@ -233,7 +248,7 @@ func (service *BalanceService) FindPreview(in *resourcesCenter.PreviewReq, url s
 		return entity.ErrorCode, "查询余额失败", 0, 0
 		return entity.ErrorCode, "查询余额失败", 0, 0
 	}
 	}
 	var appheader = "application/x-www-form-urlencoded"
 	var appheader = "application/x-www-form-urlencoded"
-	param := "dataDesc="+fmt.Sprint(dataDesc)+"&personId=" + in.AccountId + "&infoId=" + in.InfoId + "&accountId=" + in.AccountId
+	param := "dataDesc=" + fmt.Sprint(dataDesc) + "&personId=" + in.AccountId + "&infoId=" + in.InfoId + "&accountId=" + in.AccountId
 	resp, status, _ := HttpPost_M(url+"/data/dedupByAcount", appheader, param, 20)
 	resp, status, _ := HttpPost_M(url+"/data/dedupByAcount", appheader, param, 20)
 	log.Println(resp, status)
 	log.Println(resp, status)
 	if status != 200 && (resp == nil || len(resp) <= 0) {
 	if status != 200 && (resp == nil || len(resp) <= 0) {
@@ -348,11 +363,20 @@ func (service *BalanceService) UserMerge(mergeUser, mergedUser, appId string) (i
 		}
 		}
 		//结存操作
 		//结存操作
 		balance := entity.Balance{}
 		balance := entity.Balance{}
-		_, err = orm.Table(AccountResources).
-			Select("*").
-			Where("accountId=? and resourceType=?  endTime=?", mergeUser, value.ResourceType, value.EndTime).
-			OrderBy("endTime").
-			Get(&balance)
+		if value.ResourceType == "附件下载包" {
+			_, err = orm.Table(AccountResources).
+				Select("*").
+				Where("accountId=? and resourceType=?  endTime=? and vipTime=?", mergeUser, value.ResourceType, value.EndTime, value.VipTime).
+				OrderBy("endTime").
+				Get(&balance)
+		} else {
+			_, err = orm.Table(AccountResources).
+				Select("*").
+				Where("accountId=? and resourceType=?  endTime=?", mergeUser, value.ResourceType, value.EndTime).
+				OrderBy("endTime").
+				Get(&balance)
+		}
+
 		if balance.Id != 0 {
 		if balance.Id != 0 {
 			//增加结存数量
 			//增加结存数量
 			balance.Number += value.Number
 			balance.Number += value.Number
@@ -378,6 +402,7 @@ func (service *BalanceService) UserMerge(mergeUser, mergedUser, appId string) (i
 				Spec:         value.Spec,
 				Spec:         value.Spec,
 				AppId:        value.AppId,
 				AppId:        value.AppId,
 				EndTime:      value.EndTime,
 				EndTime:      value.EndTime,
+				VipTime:      value.VipTime,
 			}
 			}
 			insertNumb, err := orm.Table(AccountResources).Insert(&mergeBalance)
 			insertNumb, err := orm.Table(AccountResources).Insert(&mergeBalance)
 			if err != nil || insertNumb <= 0 {
 			if err != nil || insertNumb <= 0 {

+ 35 - 13
service/resourceManageService.go

@@ -34,28 +34,43 @@ func (service *ResourceManageService) FindResourcesAuth(data *resourcesCenter.Re
 //查询账户资源余额
 //查询账户资源余额
 func (service *ResourceManageService) FindAccountBalance(in *resourcesCenter.ResourcesReq) ([]*resourcesCenter.ResourceBalance, error) {
 func (service *ResourceManageService) FindAccountBalance(in *resourcesCenter.ResourcesReq) ([]*resourcesCenter.ResourceBalance, error) {
 	now := time.Now().Format("2006-01-02")
 	now := time.Now().Format("2006-01-02")
+	now1 := time.Now()
+	endTime := now1.AddDate(0, int(-now1.Month()+2), -now1.Day()).Format("2006-01-02")
 	orm := entity.Engine.NewSession()
 	orm := entity.Engine.NewSession()
 	var accountBalanceArr []*entity.AccountBalance
 	var accountBalanceArr []*entity.AccountBalance
 	dataList := make([]*resourcesCenter.ResourceBalance, 0)
 	dataList := make([]*resourcesCenter.ResourceBalance, 0)
-	err := orm.Table("account_resources").Select("ANY_VALUE(id) as id,ANY_VALUE(name) as name,resourceType,ANY_VALUE(spec)").
-		Where("accountId = ? and endTime >= ?", in.AccountId, now).GroupBy("resourceType").Find(&accountBalanceArr)
-	//err := orm.Query()
+	var err error
+	if in.ResourceType == "附件下载包" {
+		err = orm.Table("account_resources").Select("ANY_VALUE(id) as id,ANY_VALUE(name) as name,resourceType,ANY_VALUE(spec)").
+			Where("accountId = ? and endTime =? and  vipTime>?", in.AccountId, endTime, now).GroupBy("resourceType").Find(&accountBalanceArr)
+	} else {
+		err = orm.Table("account_resources").Select("ANY_VALUE(id) as id,ANY_VALUE(name) as name,resourceType,ANY_VALUE(spec)").
+			Where("accountId = ? and endTime >= ?", in.AccountId, now).GroupBy("resourceType").Find(&accountBalanceArr)
+	}
+
 	if err != nil {
 	if err != nil {
 		return dataList, err
 		return dataList, err
 	}
 	}
-	//log.Println(accountBalanceArr)
 	for _, v := range accountBalanceArr {
 	for _, v := range accountBalanceArr {
-		//log.Println(v)
 		oldTime := time.Now().AddDate(0, 0, 30).Format("2006-01-02")
 		oldTime := time.Now().AddDate(0, 0, 30).Format("2006-01-02")
 		//统计30内到期数量
 		//统计30内到期数量
-		var c int64
-		b, err := orm.Table("account_resources").Select("sum(number) as number").
-			Where("accountId = ? and resourceType = ? and endTime >= ? and endTime <= ?",
-				in.AccountId, v.ResourceType, now, oldTime).Get(&c)
+		b := false
+		var err error
 		var number int64
 		var number int64
+		c := int64(0)
 		//统计总数量
 		//统计总数量
-		isOk, err := orm.Table("account_resources").Select("sum(number) as number").
-			Where("accountId = ? and resourceType = ? and endTime >= ?", in.AccountId, v.ResourceType, now).Get(&number)
+		isOk := false;
+		if v.ResourceType == "附件下载包" {
+			isOk, err = orm.Table("account_resources").Select("sum(number) as number").
+				Where("accountId = ? and resourceType = ? and endTime = ? and  vipTime>=?", in.AccountId, v.ResourceType, endTime, now).Get(&number)
+		} else {
+			var c int64
+			b, err = orm.Table("account_resources").Select("sum(number) as number").
+				Where("accountId = ? and resourceType = ? and endTime >= ? and endTime <= ?",
+					in.AccountId, v.ResourceType, now, oldTime).Get(&c)
+			isOk, err = orm.Table("account_resources").Select("sum(number) as number").
+				Where("accountId = ? and resourceType = ? and endTime >= ?", in.AccountId, v.ResourceType, now).Get(&number)
+		}
 		if !b && err != nil && !isOk {
 		if !b && err != nil && !isOk {
 			return dataList, err
 			return dataList, err
 		}
 		}
@@ -78,17 +93,24 @@ func (service *ResourceManageService) FindConsumeRecord(in *resourcesCenter.Reco
 	dataList := make([]*resourcesCenter.ConsumeRecord, 0)
 	dataList := make([]*resourcesCenter.ConsumeRecord, 0)
 	var count int64
 	var count int64
 	var err error
 	var err error
+	if in.ResourceType == "" {
+		in.ResourceType = "字段包"
+	} else {
+		in.ResourceType = "附件下载包"
+	}
 	if in.State == 0 {
 	if in.State == 0 {
 		count, err = orm.Table("consume_record").
 		count, err = orm.Table("consume_record").
-			Where("accountId = ? and userId = ? and userType = 0", in.AccountId, in.UserId).
+			Where("accountId = ? and userId = ? and userType = 0  and resourceType like  ?", in.AccountId, in.UserId, "%"+in.ResourceType+"%").
 			Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
 			Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
+
 		if err != nil && count == 0 {
 		if err != nil && count == 0 {
 			return dataList, 0, err
 			return dataList, 0, err
 		}
 		}
 	} else {
 	} else {
 		count, err = orm.Table("consume_record").
 		count, err = orm.Table("consume_record").
-			Where("accountId = ? and userType = 1", in.AccountId).
+			Where("accountId = ? and userType = 1 and   resourceType like ?", in.AccountId, "%"+in.ResourceType+"%").
 			Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
 			Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
+
 		if err != nil && count == 0 {
 		if err != nil && count == 0 {
 			return dataList, 0, err
 			return dataList, 0, err
 		}
 		}