瀏覽代碼

wip:企业资源分配提交

wangkaiyue 1 年之前
父節點
當前提交
676375b3a9

+ 2 - 2
api/etc/integral-api.yaml

@@ -4,5 +4,5 @@ Port: 8889
 ResourcesCenter:
   Etcd:
     Hosts:
-      - 127.0.0.1:2379
-    Key: resourcescenter.rpc
+      - 192.168.3.206:2379
+    Key: resourcescenter.rpc

+ 3 - 2
api/integral.api

@@ -12,7 +12,9 @@ type purchResourcesReq {
 	EndTime      string `form:"endTime,optional"`      //新增时数据包截止时间
 	VipTime      string `form:"vipTime,optional"`      //超级订阅时间
 	Remarks      string `form:"remarks,optional"`      //备注
+	Batch        int    `form:"batch,optional"`        //企业账号资源初始化数量
 }
+
 type vipReq {
 	VipTime   string `form:"vipTime,optional"`   //超级订阅时间
 	AccountId string `form:"accountId,optional"` //账户标识
@@ -135,5 +137,4 @@ service integral-api {
 	//账号合并
 	@handler UpdateVipTimeHandler // TODO: set handler name and delete this comment
 	post /resources/updateVipTime (vipReq) returns(resourcesRes)
-
-}
+}

+ 1 - 1
rpc/etc/resourcescenter.yaml

@@ -14,4 +14,4 @@ CalleeId: resourcescenter.rpc
 Node: 1
 DedupUrl: http://192.168.3.206:8888
 ProductStr: "附件下载包,采购单位画像包,企业中标分析报告下载包,业主采购分析报告下载包,市场分析定制报告下载包"
-TimeSource: 1 0 0 * * ? *
+TimeSource: 1 0 0 * * ?

+ 109 - 0
rpc/internal/logic/entaccountaddlogic.go

@@ -0,0 +1,109 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jyResourcesCenter/entity"
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/config"
+	"context"
+	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
+	"github.com/google/uuid"
+	"time"
+
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenter"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type EntAccountAddLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+const (
+	ConsumeRecord    = "consume_record"    //流水表
+	AccountResources = "account_resources" //结存表
+)
+
+func NewEntAccountAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EntAccountAddLogic {
+	return &EntAccountAddLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// EntAccountAdd 新增权益账号
+func (l *EntAccountAddLogic) EntAccountAdd(in *resourcesCenter.EntAccountAdd) (*resourcesCenter.Response, error) {
+	eCode, msg := func() (int64, string) {
+		if config.ConfigJson.ProductMap[in.ResourceType] == nil || in.CompanyId == 0 {
+			return entity.ErrorCode, "参数异常"
+		}
+		orm := entity.Engine.NewSession()
+		var entAccountCount int64 = 0
+		_, err := orm.Table(AccountResources).Select("count(1) as dataNumber").Where("companyId=? AND resourceType=? AND endTime>= ?", in.CompanyId, in.ResourceType, time.Now().Format("2006-01-02")).Get(&entAccountCount)
+		if err != nil {
+			return entity.ErrorCode, "账户查询异常"
+		}
+		if err = orm.Begin(); err != nil {
+			return entity.ErrorCode, "数据库操作异常"
+		}
+		for i := 0; i < gconv.Int(in.AccountNum); i++ {
+			var tUserId string
+			if entAccountCount == 0 && i == 0 { //当企业是首次初始化时,需要给当前账号权限
+				tUserId = in.AccountId
+			} else {
+				tUserId = fmt.Sprintf("wait_%s", uuid.New().String()) //待分配
+			}
+
+			var (
+				detailed = entity.Detailed{
+					AccountId:    tUserId,
+					CompanyId:    in.CompanyId,
+					DepartmentId: in.DepartmentId,
+					Name:         in.Name,
+					ResourceType: in.ResourceType,
+					Number:       in.Number,
+					CreateTime:   time.Now().Local(),
+					UserType:     1,
+					Remarks:      in.Remarks,
+					UserId:       tUserId,
+				}
+				balance = entity.Balance{
+					AccountId:    tUserId,
+					CompanyId:    in.CompanyId,
+					DepartmentId: in.DepartmentId,
+					Name:         in.Name,
+					ResourceType: in.ResourceType,
+					Number:       in.Number,
+					Spec:         in.Spec,
+					AppId:        in.AppId,
+					EndTime:      in.EndTime,
+					SourceType:   1,
+				}
+			)
+
+			insertNumb, err := orm.Table(ConsumeRecord).Insert(&detailed)
+			if err != nil || insertNumb <= 0 {
+				fmt.Println("新增流水失败:", err)
+				_ = orm.Rollback()
+				return entity.ErrorCode, "新增流水失败"
+			}
+
+			insertNumb, err = orm.Table(AccountResources).Insert(&balance)
+			if err != nil || insertNumb <= 0 {
+				fmt.Println("结存查询失败:", err)
+				_ = orm.Rollback()
+				return entity.ErrorCode, "结存新增失败"
+			}
+		}
+		_ = orm.Commit()
+		return entity.SuccessCode, "操作成功"
+	}()
+
+	return &resourcesCenter.Response{
+		Code:    eCode,
+		Message: msg,
+	}, nil
+}

+ 78 - 0
rpc/internal/logic/entaccountgivenlogic.go

@@ -0,0 +1,78 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jyResourcesCenter/entity"
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/config"
+	"context"
+	"encoding/json"
+	"time"
+
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenter"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type EntAccountGivenLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewEntAccountGivenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EntAccountGivenLogic {
+	return &EntAccountGivenLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// EntAccountGiven 权益分配
+func (l *EntAccountGivenLogic) EntAccountGiven(in *resourcesCenter.EntOperateReq) (*resourcesCenter.Response, error) {
+	eCode, msg := func() (int64, string) {
+		if config.ConfigJson.ProductMap[in.ResourceType] == nil || in.CompanyId == 0 || in.OperateAccountId == "" {
+			return entity.ErrorCode, "参数异常"
+		}
+		var waitBalance *entity.Balance //等待分配的数量
+		orm := entity.Engine.NewSession()
+		_, err := orm.Table(AccountResources).Where("companyId=? AND resourceType=? AND number>0 AND endTime>= ? AND accountId like 'wait_%'", in.CompanyId, in.ResourceType, time.Now().Format("2006-01-02")).OrderBy("id asc").Limit(1).Get(waitBalance)
+		if err != nil || waitBalance == nil {
+			return entity.ErrorCode, "账户查询异常"
+		}
+		if err = orm.Begin(); err != nil {
+			return entity.ErrorCode, "数据库操作异常"
+		}
+		updateNumb, err := orm.Table(AccountResources).Cols("accountId").
+			Where(" id=?", waitBalance.Id).
+			Update(&map[string]interface{}{
+				"accountId": in.OperateAccountId,
+			})
+		if err != nil || updateNumb <= 0 {
+			_ = orm.Rollback()
+			return entity.ErrorCode, "权益分配异常"
+		}
+
+		jsonData, _ := json.Marshal(map[string]interface{}{"describe": "权益分配"})
+		updateNumb, err = orm.Table(ConsumeRecord).Insert(entity.Detailed{
+			AccountId:    in.OperateAccountId,
+			CompanyId:    waitBalance.CompanyId,
+			ResourceType: waitBalance.ResourceType,
+			Number:       waitBalance.Number,
+			CreateTime:   time.Now().Local(),
+			UserType:     5,
+			Remarks:      string(jsonData),
+			UserId:       in.OperateAccountId,
+			Name:         waitBalance.Name,
+		})
+		if err != nil || updateNumb <= 0 {
+			_ = orm.Rollback()
+			return entity.ErrorCode, "新增流水异常"
+		}
+		return entity.SuccessCode, "操作成功"
+	}()
+
+	return &resourcesCenter.Response{
+		Code:    eCode,
+		Message: msg,
+	}, nil
+}

+ 84 - 0
rpc/internal/logic/entaccountrecoverylogic.go

@@ -0,0 +1,84 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jyResourcesCenter/entity"
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/config"
+	"context"
+	"encoding/json"
+	"fmt"
+	"github.com/google/uuid"
+	"time"
+
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenter"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type EntAccountRecoveryLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewEntAccountRecoveryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EntAccountRecoveryLogic {
+	return &EntAccountRecoveryLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// EntAccountRecovery 权益收回
+func (l *EntAccountRecoveryLogic) EntAccountRecovery(in *resourcesCenter.EntOperateReq) (*resourcesCenter.Response, error) {
+	eCode, msg := func() (int64, string) {
+		if config.ConfigJson.ProductMap[in.ResourceType] == nil || in.CompanyId == 0 || in.OperateAccountId == "" {
+			return entity.ErrorCode, "参数异常"
+		}
+		var (
+			err error
+			orm = entity.Engine.NewSession()
+		)
+		var balance *entity.Balance
+		_, err = orm.Table(AccountResources).
+			Where("companyId=? AND resourceType=? AND number>0 AND endTime>= ? AND accountId = ?", in.CompanyId, in.ResourceType, time.Now().Format("2006-01-02"), in.OperateAccountId).Get(balance)
+		if err != nil || balance == nil {
+			return entity.ErrorCode, "账户查询异常"
+		}
+		if err = orm.Begin(); err != nil {
+			return entity.ErrorCode, "数据库操作异常"
+		}
+		updateNumb, err := orm.Table(AccountResources).Cols("accountId").
+			Where(" id=?", balance.Id).
+			Update(&map[string]interface{}{
+				"accountId": fmt.Sprintf("wait_%s", uuid.New().String()),
+			})
+		if err != nil || updateNumb <= 0 {
+			_ = orm.Rollback()
+			return entity.ErrorCode, "回收异常"
+		}
+		jsonData, _ := json.Marshal(map[string]interface{}{"describe": "权益回收"})
+		updateNumb, err = orm.Table(ConsumeRecord).Insert(entity.Detailed{
+			AccountId:    balance.AccountId,
+			CompanyId:    balance.CompanyId,
+			ResourceType: balance.ResourceType,
+			Number:       balance.Number,
+			CreateTime:   time.Now().Local(),
+			UserType:     5,
+			Remarks:      string(jsonData),
+			UserId:       balance.AccountId,
+			Name:         balance.Name,
+		})
+		if err != nil || updateNumb <= 0 {
+			_ = orm.Rollback()
+			return entity.ErrorCode, "新增流水异常"
+		}
+		_ = orm.Commit()
+		return entity.SuccessCode, "操作成功"
+	}()
+
+	return &resourcesCenter.Response{
+		Code:    eCode,
+		Message: msg,
+	}, nil
+}

+ 85 - 0
rpc/internal/logic/entsourcenumaddlogic.go

@@ -0,0 +1,85 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jyResourcesCenter/entity"
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/config"
+	"context"
+	"fmt"
+	"time"
+
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenter"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type EntSourceNumAddLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewEntSourceNumAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EntSourceNumAddLogic {
+	return &EntSourceNumAddLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// EntSourceNumAdd 新增资源数量
+func (l *EntSourceNumAddLogic) EntSourceNumAdd(in *resourcesCenter.EntSourceNumAdd) (*resourcesCenter.Response, error) {
+	eCode, msg := func() (int64, string) {
+		if config.ConfigJson.ProductMap[in.ResourceType] == nil || in.CompanyId == 0 {
+			return entity.ErrorCode, "参数异常"
+		}
+		var accountBalanceArr []*entity.Balance
+		orm := entity.Engine.NewSession()
+		err := orm.Table(AccountResources).
+			Where("companyId=? AND resourceType=? AND endTime>= ?", in.CompanyId, in.ResourceType, time.Now().Format("2006-01-02")).Find(&accountBalanceArr)
+		if err != nil {
+			return entity.ErrorCode, "查询数据异常"
+		}
+		if err = orm.Begin(); err != nil {
+			return entity.ErrorCode, "数据库操作异常"
+		}
+		for _, balance := range accountBalanceArr {
+			var (
+				detailed = entity.Detailed{
+					AccountId:    balance.AccountId,
+					CompanyId:    in.CompanyId,
+					DepartmentId: in.DepartmentId,
+					Name:         in.Name,
+					ResourceType: in.ResourceType,
+					Number:       in.Number,
+					CreateTime:   time.Now().Local(),
+					UserType:     1,
+					Remarks:      in.Remarks,
+					UserId:       balance.AccountId,
+				}
+			)
+
+			insertNumb, err := orm.Table(ConsumeRecord).Insert(&detailed)
+			if err != nil || insertNumb <= 0 {
+				fmt.Println("新增流水失败:", err)
+				_ = orm.Rollback()
+				return entity.ErrorCode, "新增流水失败"
+			}
+
+			balance.Number = balance.Number + in.Number
+			updateNumb, err := orm.Table(AccountResources).Cols("number").
+				Where(" id=?", balance.Id).
+				Update(&balance)
+			if err != nil || updateNumb <= 0 {
+				_ = orm.Rollback()
+				return entity.ErrorCode, "结存修改失败"
+			}
+		}
+		_ = orm.Commit()
+		return entity.SuccessCode, "操作成功"
+	}()
+	return &resourcesCenter.Response{
+		Code:    eCode,
+		Message: msg,
+	}, nil
+}

+ 24 - 0
rpc/internal/server/resourcescenterserver.go

@@ -69,3 +69,27 @@ func (s *ResourcesCenterServer) UpdateVipTime(ctx context.Context, in *resources
 	l := logic.NewUpdateVipTimeLogic(ctx, s.svcCtx)
 	return l.UpdateVipTime(in)
 }
+
+// 新增资源数量
+func (s *ResourcesCenterServer) EntSourceNumAdd(ctx context.Context, in *resourcesCenter.EntSourceNumAdd) (*resourcesCenter.Response, error) {
+	l := logic.NewEntSourceNumAddLogic(ctx, s.svcCtx)
+	return l.EntSourceNumAdd(in)
+}
+
+// 新增权益账号
+func (s *ResourcesCenterServer) EntAccountAdd(ctx context.Context, in *resourcesCenter.EntAccountAdd) (*resourcesCenter.Response, error) {
+	l := logic.NewEntAccountAddLogic(ctx, s.svcCtx)
+	return l.EntAccountAdd(in)
+}
+
+// 权益分配
+func (s *ResourcesCenterServer) EntAccountGiven(ctx context.Context, in *resourcesCenter.EntOperateReq) (*resourcesCenter.Response, error) {
+	l := logic.NewEntAccountGivenLogic(ctx, s.svcCtx)
+	return l.EntAccountGiven(in)
+}
+
+// 权益收回
+func (s *ResourcesCenterServer) EntAccountRecovery(ctx context.Context, in *resourcesCenter.EntOperateReq) (*resourcesCenter.Response, error) {
+	l := logic.NewEntAccountRecoveryLogic(ctx, s.svcCtx)
+	return l.EntAccountRecovery(in)
+}

+ 171 - 126
rpc/resourcesCenter.proto

@@ -3,177 +3,222 @@ syntax = "proto3";
 package resourcesCenter;
 option go_package = "resourcesCenter/";
 message Response {
-    int64 code = 1; //响应代码
-    string message = 2; //响应消息
+  int64 code = 1; //响应代码
+  string message = 2; //响应消息
 }
 message UseUserResponse{
-    int64 code = 1; //响应代码
-    string message = 2; //响应消息
-    int64 deductionNumb = 3; //扣除数量
+  int64 code = 1; //响应代码
+  string message = 2; //响应消息
+  int64 deductionNumb = 3; //扣除数量
 }
 message Balance {
-    string accountId = 1; //账户标识
-    int64 companyId = 2; //企业标识
-    int64 departmentId = 3; //组织标识
-    string name = 4; //资源名称
-    string resourceType = 5; //资源类型
-    int64 number = 6; //数量
-    string spec = 7; //规格
-    string appId = 8; //标识
-    int64  model = 9; //操作类型0使用1新增
-    string endTime = 10; //截止时间
-    string vipTime = 12; //超级订阅截止时间
-    string Remarks = 11; //备注
+  string accountId = 1; //账户标识
+  int64 companyId = 2; //企业标识
+  int64 departmentId = 3; //组织标识
+  string name = 4; //资源名称
+  string resourceType = 5; //资源类型
+  int64 number = 6; //数量
+  string spec = 7; //规格
+  string appId = 8; //标识
+  int64  model = 9; //操作类型0使用1新增
+  string endTime = 10; //截止时间
+  string vipTime = 12; //超级订阅截止时间
+  string Remarks = 11; //备注
 }
 message VipReq{
-    string accountId = 1; //账户标识
-    string vipTime = 2; //超级订阅截止时间
+  string accountId = 1; //账户标识
+  string vipTime = 2; //超级订阅截止时间
 }
 message Resources {
-    string accountId = 1; //账户标识
-    int64 companyId = 2; //企业标识
-    int64 departmentId = 3; //组织标识
-    string name = 4; //资源名称
-    string resourceType = 5; //资源类型
-    int64 number = 6; //数量
-    string spec = 7; //规格
-    string appId = 8; //标识
-    int64 model = 9; //操作类型0使用1新增
-    string endTime = 10; //截止时间
-    string Remarks = 12; //备注
-    string infoId = 13; //信息标识
-    int64 duplicateRemoval = 14; //是否去重0不去1去重
-    string ruleId = 15; //使用规则标识
-    string vipTime = 16; //超级订阅截止时间
-    string userId = 11; //用户标识
-    int64  vipstate=17;
+  string accountId = 1; //账户标识
+  int64 companyId = 2; //企业标识
+  int64 departmentId = 3; //组织标识
+  string name = 4; //资源名称
+  string resourceType = 5; //资源类型
+  int64 number = 6; //数量
+  string spec = 7; //规格
+  string appId = 8; //标识
+  int64 model = 9; //操作类型0使用1新增
+  string endTime = 10; //截止时间
+  string Remarks = 12; //备注
+  string infoId = 13; //信息标识
+  int64 duplicateRemoval = 14; //是否去重0不去1去重
+  string ruleId = 15; //使用规则标识
+  string vipTime = 16; //超级订阅截止时间
+  string userId = 11; //用户标识
+  int64  vipstate = 17;
 }
 message Detailed {
-    string accountId = 1; //账户标识
-    int64 companyId = 2; //企业标识
-    string resourceType = 3; //资源类型
-    int64 number = 4; //数量
-    string ruleId = 6; //使用规则标识
-    int64 createTime = 7; //创建时间
-    int64 userType = 8; //流水类型0使用1新增
-    int64 departmentId = 9; //组织标识
-    string userId = 10; //用户标识
-    int64 deductionNumb = 11; //扣除数量
-    string remarks = 12; //备注
-    string name = 5; //资源名称
+  string accountId = 1; //账户标识
+  int64 companyId = 2; //企业标识
+  string resourceType = 3; //资源类型
+  int64 number = 4; //数量
+  string ruleId = 6; //使用规则标识
+  int64 createTime = 7; //创建时间
+  int64 userType = 8; //流水类型0使用1新增
+  int64 departmentId = 9; //组织标识
+  string userId = 10; //用户标识
+  int64 deductionNumb = 11; //扣除数量
+  string remarks = 12; //备注
+  string name = 5; //资源名称
 }
 
 message ResourcesAuth {
-    int64 id = 1;
-    string accountId = 2; //账户标识
-    int64 resourcesId = 3; //资源标识
-    int64 quota = 4; //定额
-    int64 ratio = 5; //比例
-    int64 state = 6; //状态
+  int64 id = 1;
+  string accountId = 2; //账户标识
+  int64 resourcesId = 3; //资源标识
+  int64 quota = 4; //定额
+  int64 ratio = 5; //比例
+  int64 state = 6; //状态
 }
 
 message ResourceBalance {
-    int64 id = 1;
-    string name = 3; //资源名称
-    int64 number = 4; //剩余数量
-    string resourceType = 5; //资源代码
-    string spec = 6; //规格
-    int64 thirtyNum = 7;
-    int64 number1 =8 ; //购买数量
-    int64 number2 =9; //兑换数量
-    int64 number3 = 10; //定期发放数量
-    int64 number4 =11; //留资数量
-    string minEndTime = 12; //最近到期时间
+  int64 id = 1;
+  string name = 3; //资源名称
+  int64 number = 4; //剩余数量
+  string resourceType = 5; //资源代码
+  string spec = 6; //规格
+  int64 thirtyNum = 7;
+  int64 number1 = 8 ; //购买数量
+  int64 number2 = 9; //兑换数量
+  int64 number3 = 10; //定期发放数量
+  int64 number4 = 11; //留资数量
+  string minEndTime = 12; //最近到期时间
 }
 
 message ConsumeRecord {
-    int64 id = 1;
-    string userId = 2; //用户标识
-    string name = 3; //资源名称
-    string resourceType = 4; //资源代码
-    int64 number = 5; //数量
-    int64 deductionNumb = 6; //扣除数量
-    string ruleId = 7; //导出规则标识
-    string createTime = 8; //创建时间
-    int64 userType = 9; //消费、充值
-    string remarks = 10; //备注
+  int64 id = 1;
+  string userId = 2; //用户标识
+  string name = 3; //资源名称
+  string resourceType = 4; //资源代码
+  int64 number = 5; //数量
+  int64 deductionNumb = 6; //扣除数量
+  string ruleId = 7; //导出规则标识
+  string createTime = 8; //创建时间
+  int64 userType = 9; //消费、充值
+  string remarks = 10; //备注
 }
 
 
 message ResourcesReq {
-    string accountId = 1;
-    string resourceType = 2; //资源代码
-    int64  vipstate=3;//是否是会员
-    string resourceName = 4; //资源名称
-    int64  showMinEndTime=5;//是否返回最近到期时间1:是
+  string accountId = 1;
+  string resourceType = 2; //资源代码
+  int64  vipstate = 3;//是否是会员
+  string resourceName = 4; //资源名称
+  int64  showMinEndTime = 5;//是否返回最近到期时间1:是
 }
 
 message PreviewReq {
-    string infoId = 1; //信息标识
-    string accountId = 2; //企业标识
-    string resourceType = 3; //资源代码
+  string infoId = 1; //信息标识
+  string accountId = 2; //企业标识
+  string resourceType = 3; //资源代码
 }
 message PreviewRes {
-    int64 code = 1; //响应代码
-    string message = 2; //响应消息
-    int64 repeatNumb = 3; //重复数量
-    int64 deductionNumb = 4; //扣除数量
-    int64 remainNum = 5; //剩余条数
+  int64 code = 1; //响应代码
+  string message = 2; //响应消息
+  int64 repeatNumb = 3; //重复数量
+  int64 deductionNumb = 4; //扣除数量
+  int64 remainNum = 5; //剩余条数
 }
 //根据账户标识查询资源权限请求参数
 message ResourcesAuthRes {
-    int64 code = 1; //响应代码
-    string message = 2; //响应消息
-    repeated ResourcesAuth data = 3; //账号拥有的资源权限
+  int64 code = 1; //响应代码
+  string message = 2; //响应消息
+  repeated ResourcesAuth data = 3; //账号拥有的资源权限
 }
 
 //根据账户标识查询账户余额
 message AccountBalanceRes {
-    int64 code = 1;
-    string message = 2;
-    repeated ResourceBalance data = 3;
-    int64 showEndTime = 4; //是否返回最近到期时间
+  int64 code = 1;
+  string message = 2;
+  repeated ResourceBalance data = 3;
+  int64 showEndTime = 4; //是否返回最近到期时间
 }
 
 //查询流水账
 message RecordReq {
-    string accountId = 1;
-    string userId = 2;
-    int64 pageSize = 3;
-    int64 page = 4;
-    int64 state = 5; //0 查消费,1查充值
-    string resourceType = 6; //资源代码
-    string queryTime = 7; //查询时间
+  string accountId = 1;
+  string userId = 2;
+  int64 pageSize = 3;
+  int64 page = 4;
+  int64 state = 5; //0 查消费,1查充值
+  string resourceType = 6; //资源代码
+  string queryTime = 7; //查询时间
 }
 
 message ConsumeRecordRes {
-    int64 code = 1;
-    string message = 2;
-    repeated ConsumeRecord data = 3;
-    int64 count = 4;
+  int64 code = 1;
+  string message = 2;
+  repeated ConsumeRecord data = 3;
+  int64 count = 4;
 }
 message mergeInfo{
-     string mergeUser=1;//合并用户
-     string mergedUser=2;//被合并用户
-     string appId=3;//身份标识
+  string mergeUser = 1;//合并用户
+  string mergedUser = 2;//被合并用户
+  string appId = 3;//身份标识
+}
+
+
+message EntAccountAdd {
+  string accountId = 1; //账户标识
+  int64 companyId = 2; //企业标识
+  int64 departmentId = 3; //组织标识
+  string userId = 4; //用户标识
+  string name = 5; //资源名称
+  string resourceType = 6; //资源类型
+  int64 number = 7; //资源数量
+  string spec = 8; //规格
+  string appId = 9; //标识
+  string endTime = 10; //资源有效时间
+  string Remarks = 11; //备注
+  int64 AccountNum = 12; //新增账号数量,-1操作现有所有账户
+}
+
+message EntSourceNumAdd {
+  string accountId = 1; //账户标识
+  int64 companyId = 2; //企业标识
+  int64 departmentId = 3; //组织标识
+  string userId = 4; //用户标识
+  string name = 5; //资源名称
+  string resourceType = 6; //资源类型
+  int64 number = 7; //资源数量
+  string spec = 8; //规格
+  string appId = 9; //标识
+  string endTime = 10; //资源有效时间
+  string Remarks = 11; //备注
+}
+
+message EntOperateReq {
+  int64 companyId = 1; //企业标识
+  string resourceType = 2; //资源类型
+  string operateAccountId = 3; //操作账户
 }
 
 service ResourcesCenter {
-    //查询账户资源权限
-    rpc findResourcesAuth (ResourcesReq) returns (AccountBalanceRes);
-    //查询账户资源余额
-    rpc findAccountBalance (ResourcesReq) returns (AccountBalanceRes);
-    //查询流水账
-    rpc findConsumeRecord (RecordReq) returns (ConsumeRecordRes);
-
-    //根据账户标识购买资源
-    rpc purchaseUserBalance (Resources) returns (Response);
-    //根据账户标识使用资源
-    rpc useUserDetailed (Resources) returns (UseUserResponse);
-    //预览信息
-    rpc findPreview (PreviewReq) returns (PreviewRes);
-     //合并账号
-    rpc userMerge(mergeInfo)returns(Response);
-    //超级订阅时间修改
-    rpc updateVipTime(VipReq)returns(Response);
+  //查询账户资源权限
+  rpc findResourcesAuth (ResourcesReq) returns (AccountBalanceRes);
+  //查询账户资源余额
+  rpc findAccountBalance (ResourcesReq) returns (AccountBalanceRes);
+  //查询流水账
+  rpc findConsumeRecord (RecordReq) returns (ConsumeRecordRes);
+
+  //根据账户标识购买资源
+  rpc purchaseUserBalance (Resources) returns (Response);
+  //根据账户标识使用资源
+  rpc useUserDetailed (Resources) returns (UseUserResponse);
+  //预览信息
+  rpc findPreview (PreviewReq) returns (PreviewRes);
+  //合并账号
+  rpc userMerge(mergeInfo)returns(Response);
+  //超级订阅时间修改
+  rpc updateVipTime(VipReq)returns(Response);
+
+  // 新增资源数量
+  rpc entSourceNumAdd (EntSourceNumAdd) returns (Response);
+  // 新增权益账号
+  rpc entAccountAdd (EntAccountAdd) returns (Response);
+  // 权益分配
+  rpc entAccountGiven (EntOperateReq) returns (Response);
+  // 权益收回
+  rpc entAccountRecovery (EntOperateReq) returns (Response);
 }

+ 493 - 52
rpc/resourcesCenter/resourcesCenter.pb.go

@@ -1558,6 +1558,331 @@ func (x *MergeInfo) GetAppId() string {
 	return ""
 }
 
+type EntAccountAdd struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	AccountId    string `protobuf:"bytes,1,opt,name=accountId,proto3" json:"accountId,omitempty"`        //账户标识
+	CompanyId    int64  `protobuf:"varint,2,opt,name=companyId,proto3" json:"companyId,omitempty"`       //企业标识
+	DepartmentId int64  `protobuf:"varint,3,opt,name=departmentId,proto3" json:"departmentId,omitempty"` //组织标识
+	UserId       string `protobuf:"bytes,4,opt,name=userId,proto3" json:"userId,omitempty"`              //用户标识
+	Name         string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`                  //资源名称
+	ResourceType string `protobuf:"bytes,6,opt,name=resourceType,proto3" json:"resourceType,omitempty"`  //资源类型
+	Number       int64  `protobuf:"varint,7,opt,name=number,proto3" json:"number,omitempty"`             //资源数量
+	Spec         string `protobuf:"bytes,8,opt,name=spec,proto3" json:"spec,omitempty"`                  //规格
+	AppId        string `protobuf:"bytes,9,opt,name=appId,proto3" json:"appId,omitempty"`                //标识
+	EndTime      string `protobuf:"bytes,10,opt,name=endTime,proto3" json:"endTime,omitempty"`           //资源有效时间
+	Remarks      string `protobuf:"bytes,11,opt,name=Remarks,proto3" json:"Remarks,omitempty"`           //备注
+	AccountNum   int64  `protobuf:"varint,12,opt,name=AccountNum,proto3" json:"AccountNum,omitempty"`    //新增账号数量,-1操作现有所有账户
+}
+
+func (x *EntAccountAdd) Reset() {
+	*x = EntAccountAdd{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_resourcesCenter_proto_msgTypes[17]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *EntAccountAdd) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EntAccountAdd) ProtoMessage() {}
+
+func (x *EntAccountAdd) ProtoReflect() protoreflect.Message {
+	mi := &file_resourcesCenter_proto_msgTypes[17]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use EntAccountAdd.ProtoReflect.Descriptor instead.
+func (*EntAccountAdd) Descriptor() ([]byte, []int) {
+	return file_resourcesCenter_proto_rawDescGZIP(), []int{17}
+}
+
+func (x *EntAccountAdd) GetAccountId() string {
+	if x != nil {
+		return x.AccountId
+	}
+	return ""
+}
+
+func (x *EntAccountAdd) GetCompanyId() int64 {
+	if x != nil {
+		return x.CompanyId
+	}
+	return 0
+}
+
+func (x *EntAccountAdd) GetDepartmentId() int64 {
+	if x != nil {
+		return x.DepartmentId
+	}
+	return 0
+}
+
+func (x *EntAccountAdd) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
+func (x *EntAccountAdd) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
+func (x *EntAccountAdd) GetResourceType() string {
+	if x != nil {
+		return x.ResourceType
+	}
+	return ""
+}
+
+func (x *EntAccountAdd) GetNumber() int64 {
+	if x != nil {
+		return x.Number
+	}
+	return 0
+}
+
+func (x *EntAccountAdd) GetSpec() string {
+	if x != nil {
+		return x.Spec
+	}
+	return ""
+}
+
+func (x *EntAccountAdd) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *EntAccountAdd) GetEndTime() string {
+	if x != nil {
+		return x.EndTime
+	}
+	return ""
+}
+
+func (x *EntAccountAdd) GetRemarks() string {
+	if x != nil {
+		return x.Remarks
+	}
+	return ""
+}
+
+func (x *EntAccountAdd) GetAccountNum() int64 {
+	if x != nil {
+		return x.AccountNum
+	}
+	return 0
+}
+
+type EntSourceNumAdd struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	AccountId    string `protobuf:"bytes,1,opt,name=accountId,proto3" json:"accountId,omitempty"`        //账户标识
+	CompanyId    int64  `protobuf:"varint,2,opt,name=companyId,proto3" json:"companyId,omitempty"`       //企业标识
+	DepartmentId int64  `protobuf:"varint,3,opt,name=departmentId,proto3" json:"departmentId,omitempty"` //组织标识
+	UserId       string `protobuf:"bytes,4,opt,name=userId,proto3" json:"userId,omitempty"`              //用户标识
+	Name         string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`                  //资源名称
+	ResourceType string `protobuf:"bytes,6,opt,name=resourceType,proto3" json:"resourceType,omitempty"`  //资源类型
+	Number       int64  `protobuf:"varint,7,opt,name=number,proto3" json:"number,omitempty"`             //资源数量
+	Spec         string `protobuf:"bytes,8,opt,name=spec,proto3" json:"spec,omitempty"`                  //规格
+	AppId        string `protobuf:"bytes,9,opt,name=appId,proto3" json:"appId,omitempty"`                //标识
+	EndTime      string `protobuf:"bytes,10,opt,name=endTime,proto3" json:"endTime,omitempty"`           //资源有效时间
+	Remarks      string `protobuf:"bytes,11,opt,name=Remarks,proto3" json:"Remarks,omitempty"`           //备注
+}
+
+func (x *EntSourceNumAdd) Reset() {
+	*x = EntSourceNumAdd{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_resourcesCenter_proto_msgTypes[18]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *EntSourceNumAdd) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EntSourceNumAdd) ProtoMessage() {}
+
+func (x *EntSourceNumAdd) ProtoReflect() protoreflect.Message {
+	mi := &file_resourcesCenter_proto_msgTypes[18]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use EntSourceNumAdd.ProtoReflect.Descriptor instead.
+func (*EntSourceNumAdd) Descriptor() ([]byte, []int) {
+	return file_resourcesCenter_proto_rawDescGZIP(), []int{18}
+}
+
+func (x *EntSourceNumAdd) GetAccountId() string {
+	if x != nil {
+		return x.AccountId
+	}
+	return ""
+}
+
+func (x *EntSourceNumAdd) GetCompanyId() int64 {
+	if x != nil {
+		return x.CompanyId
+	}
+	return 0
+}
+
+func (x *EntSourceNumAdd) GetDepartmentId() int64 {
+	if x != nil {
+		return x.DepartmentId
+	}
+	return 0
+}
+
+func (x *EntSourceNumAdd) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
+func (x *EntSourceNumAdd) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
+func (x *EntSourceNumAdd) GetResourceType() string {
+	if x != nil {
+		return x.ResourceType
+	}
+	return ""
+}
+
+func (x *EntSourceNumAdd) GetNumber() int64 {
+	if x != nil {
+		return x.Number
+	}
+	return 0
+}
+
+func (x *EntSourceNumAdd) GetSpec() string {
+	if x != nil {
+		return x.Spec
+	}
+	return ""
+}
+
+func (x *EntSourceNumAdd) GetAppId() string {
+	if x != nil {
+		return x.AppId
+	}
+	return ""
+}
+
+func (x *EntSourceNumAdd) GetEndTime() string {
+	if x != nil {
+		return x.EndTime
+	}
+	return ""
+}
+
+func (x *EntSourceNumAdd) GetRemarks() string {
+	if x != nil {
+		return x.Remarks
+	}
+	return ""
+}
+
+type EntOperateReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	CompanyId        int64  `protobuf:"varint,1,opt,name=companyId,proto3" json:"companyId,omitempty"`              //企业标识
+	ResourceType     string `protobuf:"bytes,2,opt,name=resourceType,proto3" json:"resourceType,omitempty"`         //资源类型
+	OperateAccountId string `protobuf:"bytes,3,opt,name=operateAccountId,proto3" json:"operateAccountId,omitempty"` //操作账户
+}
+
+func (x *EntOperateReq) Reset() {
+	*x = EntOperateReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_resourcesCenter_proto_msgTypes[19]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *EntOperateReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EntOperateReq) ProtoMessage() {}
+
+func (x *EntOperateReq) ProtoReflect() protoreflect.Message {
+	mi := &file_resourcesCenter_proto_msgTypes[19]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use EntOperateReq.ProtoReflect.Descriptor instead.
+func (*EntOperateReq) Descriptor() ([]byte, []int) {
+	return file_resourcesCenter_proto_rawDescGZIP(), []int{19}
+}
+
+func (x *EntOperateReq) GetCompanyId() int64 {
+	if x != nil {
+		return x.CompanyId
+	}
+	return 0
+}
+
+func (x *EntOperateReq) GetResourceType() string {
+	if x != nil {
+		return x.ResourceType
+	}
+	return ""
+}
+
+func (x *EntOperateReq) GetOperateAccountId() string {
+	if x != nil {
+		return x.OperateAccountId
+	}
+	return ""
+}
+
 var File_resourcesCenter_proto protoreflect.FileDescriptor
 
 var file_resourcesCenter_proto_rawDesc = []byte{
@@ -1770,49 +2095,118 @@ var file_resourcesCenter_proto_rawDesc = []byte{
 	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, 0x87, 0x05, 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,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0xd5, 0x02, 0x0a, 0x0d, 0x45,
+	0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 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, 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, 0x16, 0x0a, 0x06,
+	0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73,
+	0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 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, 0x06, 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, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x75,
+	0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x08, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49,
+	0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 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, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72,
+	0x6b, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d,
+	0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e,
+	0x75, 0x6d, 0x22, 0xb7, 0x02, 0x0a, 0x0f, 0x45, 0x6e, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
+	0x4e, 0x75, 0x6d, 0x41, 0x64, 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, 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, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64,
+	0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12,
+	0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 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, 0x06, 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, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12,
+	0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x70,
+	0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 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, 0x0b, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x07, 0x52, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0x7d, 0x0a, 0x0d,
+	0x45, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a,
+	0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 0x18, 0x01, 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, 0x02, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12,
+	0x2a, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e,
+	0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61,
+	0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x32, 0xc2, 0x07, 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, 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,
+	0x12, 0x43, 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x70, 0x54, 0x69, 0x6d,
+	0x65, 0x12, 0x17, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e,
+	0x74, 0x65, 0x72, 0x2e, 0x56, 0x69, 0x70, 0x52, 0x65, 0x71, 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, 0x4e, 0x0a, 0x0f, 0x65, 0x6e, 0x74, 0x53, 0x6f, 0x75, 0x72,
+	0x63, 0x65, 0x4e, 0x75, 0x6d, 0x41, 0x64, 0x64, 0x12, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75,
+	0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x45, 0x6e, 0x74, 0x53, 0x6f,
+	0x75, 0x72, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x41, 0x64, 0x64, 0x1a, 0x19, 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, 0x6f, 0x75, 0x72, 0x63,
+	0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0d, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f,
+	0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x12, 0x1e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+	0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x45, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f,
+	0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 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,
+	0x65, 0x12, 0x4c, 0x0a, 0x0f, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x47,
+	0x69, 0x76, 0x65, 0x6e, 0x12, 0x1e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x45, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
+	0x65, 0x52, 0x65, 0x71, 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,
-	0x43, 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x70, 0x54, 0x69, 0x6d, 0x65,
-	0x12, 0x17, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74,
-	0x65, 0x72, 0x2e, 0x56, 0x69, 0x70, 0x52, 0x65, 0x71, 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,
+	0x4f, 0x0a, 0x12, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63,
+	0x6f, 0x76, 0x65, 0x72, 0x79, 0x12, 0x1e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+	0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x45, 0x6e, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61,
+	0x74, 0x65, 0x52, 0x65, 0x71, 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 (
@@ -1827,7 +2221,7 @@ func file_resourcesCenter_proto_rawDescGZIP() []byte {
 	return file_resourcesCenter_proto_rawDescData
 }
 
-var file_resourcesCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
+var file_resourcesCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
 var file_resourcesCenter_proto_goTypes = []interface{}{
 	(*Response)(nil),          // 0: resourcesCenter.Response
 	(*UseUserResponse)(nil),   // 1: resourcesCenter.UseUserResponse
@@ -1846,6 +2240,9 @@ var file_resourcesCenter_proto_goTypes = []interface{}{
 	(*RecordReq)(nil),         // 14: resourcesCenter.RecordReq
 	(*ConsumeRecordRes)(nil),  // 15: resourcesCenter.ConsumeRecordRes
 	(*MergeInfo)(nil),         // 16: resourcesCenter.mergeInfo
+	(*EntAccountAdd)(nil),     // 17: resourcesCenter.EntAccountAdd
+	(*EntSourceNumAdd)(nil),   // 18: resourcesCenter.EntSourceNumAdd
+	(*EntOperateReq)(nil),     // 19: resourcesCenter.EntOperateReq
 }
 var file_resourcesCenter_proto_depIdxs = []int32{
 	6,  // 0: resourcesCenter.ResourcesAuthRes.data:type_name -> resourcesCenter.ResourcesAuth
@@ -1859,16 +2256,24 @@ var file_resourcesCenter_proto_depIdxs = []int32{
 	10, // 8: resourcesCenter.ResourcesCenter.findPreview:input_type -> resourcesCenter.PreviewReq
 	16, // 9: resourcesCenter.ResourcesCenter.userMerge:input_type -> resourcesCenter.mergeInfo
 	3,  // 10: resourcesCenter.ResourcesCenter.updateVipTime:input_type -> resourcesCenter.VipReq
-	13, // 11: resourcesCenter.ResourcesCenter.findResourcesAuth:output_type -> resourcesCenter.AccountBalanceRes
-	13, // 12: resourcesCenter.ResourcesCenter.findAccountBalance:output_type -> resourcesCenter.AccountBalanceRes
-	15, // 13: resourcesCenter.ResourcesCenter.findConsumeRecord:output_type -> resourcesCenter.ConsumeRecordRes
-	0,  // 14: resourcesCenter.ResourcesCenter.purchaseUserBalance:output_type -> resourcesCenter.Response
-	1,  // 15: resourcesCenter.ResourcesCenter.useUserDetailed:output_type -> resourcesCenter.UseUserResponse
-	11, // 16: resourcesCenter.ResourcesCenter.findPreview:output_type -> resourcesCenter.PreviewRes
-	0,  // 17: resourcesCenter.ResourcesCenter.userMerge:output_type -> resourcesCenter.Response
-	0,  // 18: resourcesCenter.ResourcesCenter.updateVipTime:output_type -> resourcesCenter.Response
-	11, // [11:19] is the sub-list for method output_type
-	3,  // [3:11] is the sub-list for method input_type
+	18, // 11: resourcesCenter.ResourcesCenter.entSourceNumAdd:input_type -> resourcesCenter.EntSourceNumAdd
+	17, // 12: resourcesCenter.ResourcesCenter.entAccountAdd:input_type -> resourcesCenter.EntAccountAdd
+	19, // 13: resourcesCenter.ResourcesCenter.entAccountGiven:input_type -> resourcesCenter.EntOperateReq
+	19, // 14: resourcesCenter.ResourcesCenter.entAccountRecovery:input_type -> resourcesCenter.EntOperateReq
+	13, // 15: resourcesCenter.ResourcesCenter.findResourcesAuth:output_type -> resourcesCenter.AccountBalanceRes
+	13, // 16: resourcesCenter.ResourcesCenter.findAccountBalance:output_type -> resourcesCenter.AccountBalanceRes
+	15, // 17: resourcesCenter.ResourcesCenter.findConsumeRecord:output_type -> resourcesCenter.ConsumeRecordRes
+	0,  // 18: resourcesCenter.ResourcesCenter.purchaseUserBalance:output_type -> resourcesCenter.Response
+	1,  // 19: resourcesCenter.ResourcesCenter.useUserDetailed:output_type -> resourcesCenter.UseUserResponse
+	11, // 20: resourcesCenter.ResourcesCenter.findPreview:output_type -> resourcesCenter.PreviewRes
+	0,  // 21: resourcesCenter.ResourcesCenter.userMerge:output_type -> resourcesCenter.Response
+	0,  // 22: resourcesCenter.ResourcesCenter.updateVipTime:output_type -> resourcesCenter.Response
+	0,  // 23: resourcesCenter.ResourcesCenter.entSourceNumAdd:output_type -> resourcesCenter.Response
+	0,  // 24: resourcesCenter.ResourcesCenter.entAccountAdd:output_type -> resourcesCenter.Response
+	0,  // 25: resourcesCenter.ResourcesCenter.entAccountGiven:output_type -> resourcesCenter.Response
+	0,  // 26: resourcesCenter.ResourcesCenter.entAccountRecovery:output_type -> resourcesCenter.Response
+	15, // [15:27] is the sub-list for method output_type
+	3,  // [3:15] is the sub-list for method input_type
 	3,  // [3:3] is the sub-list for extension type_name
 	3,  // [3:3] is the sub-list for extension extendee
 	0,  // [0:3] is the sub-list for field type_name
@@ -2084,6 +2489,42 @@ func file_resourcesCenter_proto_init() {
 				return nil
 			}
 		}
+		file_resourcesCenter_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*EntAccountAdd); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_resourcesCenter_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*EntSourceNumAdd); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_resourcesCenter_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*EntOperateReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -2091,7 +2532,7 @@ func file_resourcesCenter_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_resourcesCenter_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   17,
+			NumMessages:   20,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 156 - 0
rpc/resourcesCenter/resourcesCenter_grpc.pb.go

@@ -27,6 +27,10 @@ const (
 	ResourcesCenter_FindPreview_FullMethodName         = "/resourcesCenter.ResourcesCenter/findPreview"
 	ResourcesCenter_UserMerge_FullMethodName           = "/resourcesCenter.ResourcesCenter/userMerge"
 	ResourcesCenter_UpdateVipTime_FullMethodName       = "/resourcesCenter.ResourcesCenter/updateVipTime"
+	ResourcesCenter_EntSourceNumAdd_FullMethodName     = "/resourcesCenter.ResourcesCenter/entSourceNumAdd"
+	ResourcesCenter_EntAccountAdd_FullMethodName       = "/resourcesCenter.ResourcesCenter/entAccountAdd"
+	ResourcesCenter_EntAccountGiven_FullMethodName     = "/resourcesCenter.ResourcesCenter/entAccountGiven"
+	ResourcesCenter_EntAccountRecovery_FullMethodName  = "/resourcesCenter.ResourcesCenter/entAccountRecovery"
 )
 
 // ResourcesCenterClient is the client API for ResourcesCenter service.
@@ -49,6 +53,14 @@ type ResourcesCenterClient interface {
 	UserMerge(ctx context.Context, in *MergeInfo, opts ...grpc.CallOption) (*Response, error)
 	// 超级订阅时间修改
 	UpdateVipTime(ctx context.Context, in *VipReq, opts ...grpc.CallOption) (*Response, error)
+	// 新增资源数量
+	EntSourceNumAdd(ctx context.Context, in *EntSourceNumAdd, opts ...grpc.CallOption) (*Response, error)
+	// 新增权益账号
+	EntAccountAdd(ctx context.Context, in *EntAccountAdd, opts ...grpc.CallOption) (*Response, error)
+	// 权益分配
+	EntAccountGiven(ctx context.Context, in *EntOperateReq, opts ...grpc.CallOption) (*Response, error)
+	// 权益收回
+	EntAccountRecovery(ctx context.Context, in *EntOperateReq, opts ...grpc.CallOption) (*Response, error)
 }
 
 type resourcesCenterClient struct {
@@ -131,6 +143,42 @@ func (c *resourcesCenterClient) UpdateVipTime(ctx context.Context, in *VipReq, o
 	return out, nil
 }
 
+func (c *resourcesCenterClient) EntSourceNumAdd(ctx context.Context, in *EntSourceNumAdd, opts ...grpc.CallOption) (*Response, error) {
+	out := new(Response)
+	err := c.cc.Invoke(ctx, ResourcesCenter_EntSourceNumAdd_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *resourcesCenterClient) EntAccountAdd(ctx context.Context, in *EntAccountAdd, opts ...grpc.CallOption) (*Response, error) {
+	out := new(Response)
+	err := c.cc.Invoke(ctx, ResourcesCenter_EntAccountAdd_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *resourcesCenterClient) EntAccountGiven(ctx context.Context, in *EntOperateReq, opts ...grpc.CallOption) (*Response, error) {
+	out := new(Response)
+	err := c.cc.Invoke(ctx, ResourcesCenter_EntAccountGiven_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *resourcesCenterClient) EntAccountRecovery(ctx context.Context, in *EntOperateReq, opts ...grpc.CallOption) (*Response, error) {
+	out := new(Response)
+	err := c.cc.Invoke(ctx, ResourcesCenter_EntAccountRecovery_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // ResourcesCenterServer is the server API for ResourcesCenter service.
 // All implementations must embed UnimplementedResourcesCenterServer
 // for forward compatibility
@@ -151,6 +199,14 @@ type ResourcesCenterServer interface {
 	UserMerge(context.Context, *MergeInfo) (*Response, error)
 	// 超级订阅时间修改
 	UpdateVipTime(context.Context, *VipReq) (*Response, error)
+	// 新增资源数量
+	EntSourceNumAdd(context.Context, *EntSourceNumAdd) (*Response, error)
+	// 新增权益账号
+	EntAccountAdd(context.Context, *EntAccountAdd) (*Response, error)
+	// 权益分配
+	EntAccountGiven(context.Context, *EntOperateReq) (*Response, error)
+	// 权益收回
+	EntAccountRecovery(context.Context, *EntOperateReq) (*Response, error)
 	mustEmbedUnimplementedResourcesCenterServer()
 }
 
@@ -182,6 +238,18 @@ func (UnimplementedResourcesCenterServer) UserMerge(context.Context, *MergeInfo)
 func (UnimplementedResourcesCenterServer) UpdateVipTime(context.Context, *VipReq) (*Response, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method UpdateVipTime not implemented")
 }
+func (UnimplementedResourcesCenterServer) EntSourceNumAdd(context.Context, *EntSourceNumAdd) (*Response, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method EntSourceNumAdd not implemented")
+}
+func (UnimplementedResourcesCenterServer) EntAccountAdd(context.Context, *EntAccountAdd) (*Response, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method EntAccountAdd not implemented")
+}
+func (UnimplementedResourcesCenterServer) EntAccountGiven(context.Context, *EntOperateReq) (*Response, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method EntAccountGiven not implemented")
+}
+func (UnimplementedResourcesCenterServer) EntAccountRecovery(context.Context, *EntOperateReq) (*Response, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method EntAccountRecovery not implemented")
+}
 func (UnimplementedResourcesCenterServer) mustEmbedUnimplementedResourcesCenterServer() {}
 
 // UnsafeResourcesCenterServer may be embedded to opt out of forward compatibility for this service.
@@ -339,6 +407,78 @@ func _ResourcesCenter_UpdateVipTime_Handler(srv interface{}, ctx context.Context
 	return interceptor(ctx, in, info, handler)
 }
 
+func _ResourcesCenter_EntSourceNumAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(EntSourceNumAdd)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ResourcesCenterServer).EntSourceNumAdd(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: ResourcesCenter_EntSourceNumAdd_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ResourcesCenterServer).EntSourceNumAdd(ctx, req.(*EntSourceNumAdd))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _ResourcesCenter_EntAccountAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(EntAccountAdd)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ResourcesCenterServer).EntAccountAdd(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: ResourcesCenter_EntAccountAdd_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ResourcesCenterServer).EntAccountAdd(ctx, req.(*EntAccountAdd))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _ResourcesCenter_EntAccountGiven_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(EntOperateReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ResourcesCenterServer).EntAccountGiven(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: ResourcesCenter_EntAccountGiven_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ResourcesCenterServer).EntAccountGiven(ctx, req.(*EntOperateReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _ResourcesCenter_EntAccountRecovery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(EntOperateReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ResourcesCenterServer).EntAccountRecovery(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: ResourcesCenter_EntAccountRecovery_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ResourcesCenterServer).EntAccountRecovery(ctx, req.(*EntOperateReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // ResourcesCenter_ServiceDesc is the grpc.ServiceDesc for ResourcesCenter service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -378,6 +518,22 @@ var ResourcesCenter_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "updateVipTime",
 			Handler:    _ResourcesCenter_UpdateVipTime_Handler,
 		},
+		{
+			MethodName: "entSourceNumAdd",
+			Handler:    _ResourcesCenter_EntSourceNumAdd_Handler,
+		},
+		{
+			MethodName: "entAccountAdd",
+			Handler:    _ResourcesCenter_EntAccountAdd_Handler,
+		},
+		{
+			MethodName: "entAccountGiven",
+			Handler:    _ResourcesCenter_EntAccountGiven_Handler,
+		},
+		{
+			MethodName: "entAccountRecovery",
+			Handler:    _ResourcesCenter_EntAccountRecovery_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "resourcesCenter.proto",

+ 36 - 1
rpc/resourcesCenterclient/resourcescenter.go

@@ -1,7 +1,7 @@
 // Code generated by goctl. DO NOT EDIT.
 // Source: resourcesCenter.proto
 
-package resourcesCenterclient
+package resourcescenterclient
 
 import (
 	"context"
@@ -18,6 +18,9 @@ type (
 	ConsumeRecord     = resourcesCenter.ConsumeRecord
 	ConsumeRecordRes  = resourcesCenter.ConsumeRecordRes
 	Detailed          = resourcesCenter.Detailed
+	EntAccountAdd     = resourcesCenter.EntAccountAdd
+	EntOperateReq     = resourcesCenter.EntOperateReq
+	EntSourceNumAdd   = resourcesCenter.EntSourceNumAdd
 	MergeInfo         = resourcesCenter.MergeInfo
 	PreviewReq        = resourcesCenter.PreviewReq
 	PreviewRes        = resourcesCenter.PreviewRes
@@ -48,6 +51,14 @@ type (
 		UserMerge(ctx context.Context, in *MergeInfo, opts ...grpc.CallOption) (*Response, error)
 		// 超级订阅时间修改
 		UpdateVipTime(ctx context.Context, in *VipReq, opts ...grpc.CallOption) (*Response, error)
+		// 新增资源数量
+		EntSourceNumAdd(ctx context.Context, in *EntSourceNumAdd, opts ...grpc.CallOption) (*Response, error)
+		// 新增权益账号
+		EntAccountAdd(ctx context.Context, in *EntAccountAdd, opts ...grpc.CallOption) (*Response, error)
+		// 权益分配
+		EntAccountGiven(ctx context.Context, in *EntOperateReq, opts ...grpc.CallOption) (*Response, error)
+		// 权益收回
+		EntAccountRecovery(ctx context.Context, in *EntOperateReq, opts ...grpc.CallOption) (*Response, error)
 	}
 
 	defaultResourcesCenter struct {
@@ -108,3 +119,27 @@ func (m *defaultResourcesCenter) UpdateVipTime(ctx context.Context, in *VipReq,
 	client := resourcesCenter.NewResourcesCenterClient(m.cli.Conn())
 	return client.UpdateVipTime(ctx, in, opts...)
 }
+
+// 新增资源数量
+func (m *defaultResourcesCenter) EntSourceNumAdd(ctx context.Context, in *EntSourceNumAdd, opts ...grpc.CallOption) (*Response, error) {
+	client := resourcesCenter.NewResourcesCenterClient(m.cli.Conn())
+	return client.EntSourceNumAdd(ctx, in, opts...)
+}
+
+// 新增权益账号
+func (m *defaultResourcesCenter) EntAccountAdd(ctx context.Context, in *EntAccountAdd, opts ...grpc.CallOption) (*Response, error) {
+	client := resourcesCenter.NewResourcesCenterClient(m.cli.Conn())
+	return client.EntAccountAdd(ctx, in, opts...)
+}
+
+// 权益分配
+func (m *defaultResourcesCenter) EntAccountGiven(ctx context.Context, in *EntOperateReq, opts ...grpc.CallOption) (*Response, error) {
+	client := resourcesCenter.NewResourcesCenterClient(m.cli.Conn())
+	return client.EntAccountGiven(ctx, in, opts...)
+}
+
+// 权益收回
+func (m *defaultResourcesCenter) EntAccountRecovery(ctx context.Context, in *EntOperateReq, opts ...grpc.CallOption) (*Response, error) {
+	client := resourcesCenter.NewResourcesCenterClient(m.cli.Conn())
+	return client.EntAccountRecovery(ctx, in, opts...)
+}