wangchuanjin 1 vuosi sitten
vanhempi
commit
7b6f9f2d05

+ 4 - 7
public/entity/base_ent_empower.go

@@ -57,7 +57,7 @@ func (b *base_ent_empower) HasEmpower(appid, function_code string, ent_id, ent_u
 	return false
 }
 
-//重新授权
+//先把有权限的人清空,再把权益授权给新的人
 func (b *base_ent_empower) ReEmpower(appid string, function_code []string, ent_id int64, ent_user_id []int64) bool {
 	return Mysql_BaseService.ExecTx("重新授权", func(tx *sql.Tx) bool {
 		args := []interface{}{appid, ent_id}
@@ -83,7 +83,7 @@ func (b *base_ent_empower) ReEmpower(appid string, function_code []string, ent_i
 }
 
 //授权
-func (b *base_ent_empower) Empower(appid string, function_code []string, ent_id int64, ent_user_id []int64) bool {
+func (b *base_ent_empower) Empower(tx *sql.Tx, appid string, function_code []string, ent_id int64, ent_user_id []int64) bool {
 	fields := []string{"appid", "ent_id", "ent_user_id", "function_code", "create_time"}
 	nowFormat := NowFormat(Date_Full_Layout)
 	values := []interface{}{}
@@ -92,11 +92,8 @@ func (b *base_ent_empower) Empower(appid string, function_code []string, ent_id
 			values = append(values, appid, ent_id, v, vv, nowFormat)
 		}
 	}
-	return Mysql_BaseService.ExecTx("授权", func(tx *sql.Tx) bool {
-		b.CancelEmpower(tx, appid, function_code, ent_id, ent_user_id)
-		r1, _ := Mysql_BaseService.InsertBatchByTx(tx, "base_ent_empower", fields, values)
-		return r1 == int64(len(function_code)*len(ent_user_id))
-	})
+	r1, _ := Mysql_BaseService.InsertBatchByTx(tx, "base_ent_empower", fields, values)
+	return r1 == int64(len(function_code)*len(ent_user_id))
 }
 
 //根据功能代码取消授权

+ 39 - 3
public/service/power.go

@@ -164,7 +164,7 @@ func HasPowers(appid string, account_id, ent_account_id, ent_id, ent_user_id int
 }
 
 /*
- * 重新授权
+ * 先把有权限的人清空,再把权益授权给新的人
  * @param appid
  * @param function_code 功能代码
  * @param ent_id 企业id
@@ -189,6 +189,39 @@ func ReEmpower(appid string, function_code []string, ent_id int64, ent_user_id [
 	return 0, nil
 }
 
+/*
+ * 先根据功能分类把人的权益清空,再给人授权新的权益
+ * @param appid
+ * @param function_module 功能分类
+ * @param function_code 功能代码
+ * @param ent_id 企业id
+ * @param ent_user_id 企业用户id
+ * @return 0:失败 1:成功 -2:数量不足
+ */
+func CrReEmpower(appid string, function_module, function_code []string, ent_id int64, ent_user_id []int64) (int64, error) {
+	if appid == "" {
+		return 0, errors.New("无效的参数appid")
+	} else if len(function_module) == 0 {
+		return 0, errors.New("无效的参数function_module")
+	} else if len(function_code) == 0 {
+		return 0, errors.New("无效的参数function_code")
+	} else if ent_id == 0 {
+		return 0, errors.New("无效的参数ent_id")
+	} else if len(ent_user_id) == 0 {
+		return 0, errors.New("无效的参数ent_user_id")
+	} else if status, err := Base_ent_wait_empower.CheckBeforeEmpower(appid, function_code, ent_id, ent_user_id); err != nil {
+		return status, err
+	}
+	if Mysql_BaseService.ExecTx("根据功能分类取消所有授权", func(tx *sql.Tx) bool {
+		ok1 := Base_ent_empower.CancelAllEmpower(tx, appid, function_module, ent_id, ent_user_id)
+		ok2 := Base_ent_empower.Empower(tx, appid, function_code, ent_id, ent_user_id)
+		return ok1 && ok2
+	}) {
+		return 1, nil
+	}
+	return 0, nil
+}
+
 /*
  * 授权
  * @param appid
@@ -209,7 +242,10 @@ func Empower(appid string, function_code []string, ent_id int64, ent_user_id []i
 	} else if status, err := Base_ent_wait_empower.CheckBeforeEmpower(appid, function_code, ent_id, ent_user_id); err != nil {
 		return status, err
 	}
-	if Base_ent_empower.Empower(appid, function_code, ent_id, ent_user_id) {
+	if Mysql_BaseService.ExecTx("授权", func(tx *sql.Tx) bool {
+		Base_ent_empower.CancelEmpower(tx, appid, function_code, ent_id, ent_user_id)
+		return Base_ent_empower.Empower(tx, appid, function_code, ent_id, ent_user_id)
+	}) {
 		return 1, nil
 	}
 	return 0, nil
@@ -244,7 +280,7 @@ func CancelEmpower(appid string, function_code []string, ent_id int64, ent_user_
 /*
  * 根据功能分类取消所有授权
  * @param appid
- * @param function_code 功能代码
+ * @param function_module 功能分类
  * @param ent_id 企业id
  * @param ent_user_id 企业用户id
  * @return 0:失败 1:成功

+ 37 - 0
rpc/internal/logic/crreempowerlogic.go

@@ -0,0 +1,37 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	. "bp.jydev.jianyu360.cn/BaseService/resourceCenter/public/service"
+	"bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CrReEmpowerLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCrReEmpowerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CrReEmpowerLogic {
+	return &CrReEmpowerLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 先根据功能分类把人的权益清空,再给人授权新的权益
+func (l *CrReEmpowerLogic) CrReEmpower(in *pb.CrReEmpowerReq) (*pb.Resp, error) {
+	resp := &pb.Resp{}
+	status, err := CrReEmpower(in.Appid, in.FunctionModule, in.FunctionCode, in.EntId, in.EntUserId)
+	if err != nil {
+		l.Error(fmt.Sprintf("%+v", in), err)
+	}
+	resp.Status = status
+	return &pb.Resp{}, nil
+}

+ 1 - 1
rpc/internal/logic/reempowerlogic.go

@@ -26,7 +26,7 @@ func NewReEmpowerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ReEmpow
 	}
 }
 
-// 重新授权
+// 先把有权限的人清空,再把权益授权给新的人
 func (l *ReEmpowerLogic) ReEmpower(in *pb.EmpowerReq) (*pb.Resp, error) {
 	resp := &pb.Resp{}
 	status, err := ReEmpower(in.Appid, strings.Split(in.FunctionCode, ","), in.EntId, in.EntUserId)

+ 7 - 1
rpc/internal/server/resourceserver.go

@@ -46,12 +46,18 @@ func (s *ResourceServer) Recharge(ctx context.Context, in *pb.RechargeReq) (*pb.
 	return l.Recharge(in)
 }
 
-// 重新授权
+// 先把有权限的人清空,再把权益授权给新的人
 func (s *ResourceServer) ReEmpower(ctx context.Context, in *pb.EmpowerReq) (*pb.Resp, error) {
 	l := logic.NewReEmpowerLogic(ctx, s.svcCtx)
 	return l.ReEmpower(in)
 }
 
+// 先根据功能分类把人的权益清空,再给人授权新的权益
+func (s *ResourceServer) CrReEmpower(ctx context.Context, in *pb.CrReEmpowerReq) (*pb.Resp, error) {
+	l := logic.NewCrReEmpowerLogic(ctx, s.svcCtx)
+	return l.CrReEmpower(in)
+}
+
 // 授权
 func (s *ResourceServer) Empower(ctx context.Context, in *pb.EmpowerReq) (*pb.Resp, error) {
 	l := logic.NewEmpowerLogic(ctx, s.svcCtx)

+ 273 - 165
rpc/pb/resource.pb.go

@@ -589,6 +589,85 @@ func (x *AllEmpowerReq) GetEntUserId() []int64 {
 	return nil
 }
 
+type CrReEmpowerReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Appid          string   `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
+	FunctionModule []string `protobuf:"bytes,2,rep,name=function_module,json=functionModule,proto3" json:"function_module,omitempty"` //功能分类
+	FunctionCode   []string `protobuf:"bytes,3,rep,name=function_code,json=functionCode,proto3" json:"function_code,omitempty"`       //功能代码
+	EntId          int64    `protobuf:"varint,4,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                           //企业id
+	EntUserId      []int64  `protobuf:"varint,5,rep,packed,name=ent_user_id,json=entUserId,proto3" json:"ent_user_id,omitempty"`      //企业用户id
+}
+
+func (x *CrReEmpowerReq) Reset() {
+	*x = CrReEmpowerReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_resource_proto_msgTypes[7]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *CrReEmpowerReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CrReEmpowerReq) ProtoMessage() {}
+
+func (x *CrReEmpowerReq) ProtoReflect() protoreflect.Message {
+	mi := &file_resource_proto_msgTypes[7]
+	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 CrReEmpowerReq.ProtoReflect.Descriptor instead.
+func (*CrReEmpowerReq) Descriptor() ([]byte, []int) {
+	return file_resource_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *CrReEmpowerReq) GetAppid() string {
+	if x != nil {
+		return x.Appid
+	}
+	return ""
+}
+
+func (x *CrReEmpowerReq) GetFunctionModule() []string {
+	if x != nil {
+		return x.FunctionModule
+	}
+	return nil
+}
+
+func (x *CrReEmpowerReq) GetFunctionCode() []string {
+	if x != nil {
+		return x.FunctionCode
+	}
+	return nil
+}
+
+func (x *CrReEmpowerReq) GetEntId() int64 {
+	if x != nil {
+		return x.EntId
+	}
+	return 0
+}
+
+func (x *CrReEmpowerReq) GetEntUserId() []int64 {
+	if x != nil {
+		return x.EntUserId
+	}
+	return nil
+}
+
 type EmpowerListReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -604,7 +683,7 @@ type EmpowerListReq struct {
 func (x *EmpowerListReq) Reset() {
 	*x = EmpowerListReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[7]
+		mi := &file_resource_proto_msgTypes[8]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -617,7 +696,7 @@ func (x *EmpowerListReq) String() string {
 func (*EmpowerListReq) ProtoMessage() {}
 
 func (x *EmpowerListReq) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[7]
+	mi := &file_resource_proto_msgTypes[8]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -630,7 +709,7 @@ func (x *EmpowerListReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use EmpowerListReq.ProtoReflect.Descriptor instead.
 func (*EmpowerListReq) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{7}
+	return file_resource_proto_rawDescGZIP(), []int{8}
 }
 
 func (x *EmpowerListReq) GetAppid() string {
@@ -680,7 +759,7 @@ type EmpowerListResp struct {
 func (x *EmpowerListResp) Reset() {
 	*x = EmpowerListResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[8]
+		mi := &file_resource_proto_msgTypes[9]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -693,7 +772,7 @@ func (x *EmpowerListResp) String() string {
 func (*EmpowerListResp) ProtoMessage() {}
 
 func (x *EmpowerListResp) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[8]
+	mi := &file_resource_proto_msgTypes[9]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -706,7 +785,7 @@ func (x *EmpowerListResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use EmpowerListResp.ProtoReflect.Descriptor instead.
 func (*EmpowerListResp) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{8}
+	return file_resource_proto_rawDescGZIP(), []int{9}
 }
 
 func (x *EmpowerListResp) GetCount() int64 {
@@ -738,7 +817,7 @@ type Resp struct {
 func (x *Resp) Reset() {
 	*x = Resp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[9]
+		mi := &file_resource_proto_msgTypes[10]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -751,7 +830,7 @@ func (x *Resp) String() string {
 func (*Resp) ProtoMessage() {}
 
 func (x *Resp) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[9]
+	mi := &file_resource_proto_msgTypes[10]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -764,7 +843,7 @@ func (x *Resp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use Resp.ProtoReflect.Descriptor instead.
 func (*Resp) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{9}
+	return file_resource_proto_rawDescGZIP(), []int{10}
 }
 
 func (x *Resp) GetStatus() int64 {
@@ -817,7 +896,7 @@ type HaspowersReq struct {
 func (x *HaspowersReq) Reset() {
 	*x = HaspowersReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[10]
+		mi := &file_resource_proto_msgTypes[11]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -830,7 +909,7 @@ func (x *HaspowersReq) String() string {
 func (*HaspowersReq) ProtoMessage() {}
 
 func (x *HaspowersReq) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[10]
+	mi := &file_resource_proto_msgTypes[11]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -843,7 +922,7 @@ func (x *HaspowersReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use HaspowersReq.ProtoReflect.Descriptor instead.
 func (*HaspowersReq) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{10}
+	return file_resource_proto_rawDescGZIP(), []int{11}
 }
 
 func (x *HaspowersReq) GetAppid() string {
@@ -892,7 +971,7 @@ type HaspowersResp struct {
 func (x *HaspowersResp) Reset() {
 	*x = HaspowersResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[11]
+		mi := &file_resource_proto_msgTypes[12]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -905,7 +984,7 @@ func (x *HaspowersResp) String() string {
 func (*HaspowersResp) ProtoMessage() {}
 
 func (x *HaspowersResp) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[11]
+	mi := &file_resource_proto_msgTypes[12]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -918,7 +997,7 @@ func (x *HaspowersResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use HaspowersResp.ProtoReflect.Descriptor instead.
 func (*HaspowersResp) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{11}
+	return file_resource_proto_rawDescGZIP(), []int{12}
 }
 
 func (x *HaspowersResp) GetPowers() []string {
@@ -941,7 +1020,7 @@ type WaitEmpowerDetailReq struct {
 func (x *WaitEmpowerDetailReq) Reset() {
 	*x = WaitEmpowerDetailReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[12]
+		mi := &file_resource_proto_msgTypes[13]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -954,7 +1033,7 @@ func (x *WaitEmpowerDetailReq) String() string {
 func (*WaitEmpowerDetailReq) ProtoMessage() {}
 
 func (x *WaitEmpowerDetailReq) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[12]
+	mi := &file_resource_proto_msgTypes[13]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -967,7 +1046,7 @@ func (x *WaitEmpowerDetailReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use WaitEmpowerDetailReq.ProtoReflect.Descriptor instead.
 func (*WaitEmpowerDetailReq) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{12}
+	return file_resource_proto_rawDescGZIP(), []int{13}
 }
 
 func (x *WaitEmpowerDetailReq) GetAppid() string {
@@ -1004,7 +1083,7 @@ type WaitEmpowerDetailBySpecIdReq struct {
 func (x *WaitEmpowerDetailBySpecIdReq) Reset() {
 	*x = WaitEmpowerDetailBySpecIdReq{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[13]
+		mi := &file_resource_proto_msgTypes[14]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -1017,7 +1096,7 @@ func (x *WaitEmpowerDetailBySpecIdReq) String() string {
 func (*WaitEmpowerDetailBySpecIdReq) ProtoMessage() {}
 
 func (x *WaitEmpowerDetailBySpecIdReq) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[13]
+	mi := &file_resource_proto_msgTypes[14]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -1030,7 +1109,7 @@ func (x *WaitEmpowerDetailBySpecIdReq) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use WaitEmpowerDetailBySpecIdReq.ProtoReflect.Descriptor instead.
 func (*WaitEmpowerDetailBySpecIdReq) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{13}
+	return file_resource_proto_rawDescGZIP(), []int{14}
 }
 
 func (x *WaitEmpowerDetailBySpecIdReq) GetAppid() string {
@@ -1065,7 +1144,7 @@ type WaitEmpowerDetailsResp struct {
 func (x *WaitEmpowerDetailsResp) Reset() {
 	*x = WaitEmpowerDetailsResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[14]
+		mi := &file_resource_proto_msgTypes[15]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -1078,7 +1157,7 @@ func (x *WaitEmpowerDetailsResp) String() string {
 func (*WaitEmpowerDetailsResp) ProtoMessage() {}
 
 func (x *WaitEmpowerDetailsResp) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[14]
+	mi := &file_resource_proto_msgTypes[15]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -1091,7 +1170,7 @@ func (x *WaitEmpowerDetailsResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use WaitEmpowerDetailsResp.ProtoReflect.Descriptor instead.
 func (*WaitEmpowerDetailsResp) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{14}
+	return file_resource_proto_rawDescGZIP(), []int{15}
 }
 
 func (x *WaitEmpowerDetailsResp) GetWaitEmpowerDetails() []*WaitEmpowerDetailResp {
@@ -1117,7 +1196,7 @@ type WaitEmpowerDetailResp struct {
 func (x *WaitEmpowerDetailResp) Reset() {
 	*x = WaitEmpowerDetailResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[15]
+		mi := &file_resource_proto_msgTypes[16]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -1130,7 +1209,7 @@ func (x *WaitEmpowerDetailResp) String() string {
 func (*WaitEmpowerDetailResp) ProtoMessage() {}
 
 func (x *WaitEmpowerDetailResp) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[15]
+	mi := &file_resource_proto_msgTypes[16]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -1143,7 +1222,7 @@ func (x *WaitEmpowerDetailResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use WaitEmpowerDetailResp.ProtoReflect.Descriptor instead.
 func (*WaitEmpowerDetailResp) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{15}
+	return file_resource_proto_rawDescGZIP(), []int{16}
 }
 
 func (x *WaitEmpowerDetailResp) GetId() int64 {
@@ -1265,110 +1344,124 @@ var file_resource_proto_rawDesc = []byte{
 	0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
 	0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73,
 	0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74,
-	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x45, 0x6d, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70,
+	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xab, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x52, 0x65, 0x45,
+	0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70,
+	0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12,
+	0x27, 0x0a, 0x0f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x75,
+	0x6c, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+	0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63,
+	0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52,
+	0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a,
+	0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65,
+	0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72,
+	0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73,
+	0x65, 0x72, 0x49, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72,
+	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x23, 0x0a,
+	0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f,
+	0x64, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x61, 0x67,
+	0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70, 0x61, 0x67,
+	0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a,
+	0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
+	0x65, 0x22, 0x45, 0x0a, 0x0f, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x04, 0x6c, 0x69,
+	0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77,
+	0x65, 0x72, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x04, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65,
+	0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73,
+	0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x72, 0x70, 0x6c, 0x75,
+	0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x73,
+	0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73,
+	0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e,
+	0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e,
+	0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x70, 0x6f, 0x77,
+	0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a,
+	0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x65,
+	0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x0c, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49,
+	0x64, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x5f,
+	0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65,
+	0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0d, 0x48, 0x61, 0x73, 0x70,
+	0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6f, 0x77,
+	0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x77, 0x65, 0x72,
+	0x73, 0x22, 0x68, 0x0a, 0x14, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72,
+	0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70,
 	0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12,
 	0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65,
 	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
 	0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70,
-	0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70,
-	0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73,
-	0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53,
-	0x69, 0x7a, 0x65, 0x22, 0x45, 0x0a, 0x0f, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69,
-	0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x04,
-	0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x45, 0x6d, 0x70,
-	0x6f, 0x77, 0x65, 0x72, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x9a, 0x01, 0x0a, 0x04, 0x52,
-	0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x75,
-	0x73, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
-	0x75, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x72, 0x70,
-	0x6c, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x0c, 0x73, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a,
-	0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08,
-	0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
-	0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x70,
-	0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69,
-	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x1d,
-	0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a,
-	0x0e, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18,
-	0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e,
-	0x74, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e,
-	0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0d, 0x48, 0x61,
-	0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70,
-	0x6f, 0x77, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x73, 0x22, 0x68, 0x0a, 0x14, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x64, 0x0a, 0x1c, 0x57,
+	0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c,
+	0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x49, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61,
 	0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69,
-	0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f,
-	0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
-	0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x64, 0x0a,
-	0x1c, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61,
-	0x69, 0x6c, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x49, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a,
-	0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70,
-	0x70, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06,
-	0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e,
-	0x74, 0x49, 0x64, 0x22, 0x60, 0x0a, 0x16, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a,
-	0x12, 0x77, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61,
-	0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x57, 0x61, 0x69, 0x74,
-	0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73,
-	0x70, 0x52, 0x12, 0x77, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65,
-	0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xca, 0x01, 0x0a, 0x15, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d,
-	0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12,
-	0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19,
-	0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6d, 0x70,
-	0x6f, 0x77, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x0c, 0x65, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b,
-	0x0a, 0x09, 0x75, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x08, 0x75, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x6c,
-	0x69, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x06, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65,
-	0x67, 0x79, 0x32, 0x9b, 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12,
-	0x1f, 0x0a, 0x0b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x09,
-	0x2e, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x23, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0e,
-	0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05,
-	0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x09, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69,
-	0x6f, 0x6e, 0x12, 0x0d, 0x2e, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
-	0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x08, 0x52, 0x65, 0x63, 0x68,
-	0x61, 0x72, 0x67, 0x65, 0x12, 0x0c, 0x2e, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52,
-	0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x09, 0x52, 0x65, 0x45,
-	0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0b, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72,
-	0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x07, 0x45, 0x6d,
-	0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0b, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x52,
-	0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x43, 0x61, 0x6e,
-	0x63, 0x65, 0x6c, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0b, 0x2e, 0x45, 0x6d, 0x70,
-	0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x29,
-	0x0a, 0x10, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x6c, 0x6c, 0x45, 0x6d, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x12, 0x0e, 0x2e, 0x41, 0x6c, 0x6c, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x52,
-	0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b, 0x45, 0x6d, 0x70,
-	0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x45, 0x6d, 0x70, 0x6f,
-	0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x09, 0x48,
-	0x61, 0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x12, 0x0d, 0x2e, 0x48, 0x61, 0x73, 0x70, 0x6f,
-	0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x48, 0x61, 0x73, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x11, 0x57, 0x61, 0x69, 0x74, 0x45,
-	0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x15, 0x2e, 0x57,
+	0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x06, 0x73, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e,
+	0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49,
+	0x64, 0x22, 0x60, 0x0a, 0x16, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72,
+	0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x12, 0x77,
 	0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c,
-	0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65,
-	0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x53, 0x0a, 0x19, 0x57,
+	0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d,
+	0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x52,
+	0x12, 0x77, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61,
+	0x69, 0x6c, 0x73, 0x22, 0xca, 0x01, 0x0a, 0x15, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f,
+	0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a,
+	0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a,
+	0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08,
+	0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
+	0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6d, 0x70, 0x6f, 0x77,
+	0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c,
+	0x65, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09,
+	0x75, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x08, 0x75, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x69, 0x6d,
+	0x69, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x0d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79,
+	0x32, 0xc2, 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x0a,
+	0x0b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x09, 0x2e, 0x50,
+	0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23,
+	0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0e, 0x2e, 0x43,
+	0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52,
+	0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x09, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x12, 0x0d, 0x2e, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a,
+	0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x08, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72,
+	0x67, 0x65, 0x12, 0x0c, 0x2e, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x71,
+	0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x09, 0x52, 0x65, 0x45, 0x6d, 0x70,
+	0x6f, 0x77, 0x65, 0x72, 0x12, 0x0b, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65,
+	0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x0b, 0x43, 0x72, 0x52, 0x65,
+	0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0f, 0x2e, 0x43, 0x72, 0x52, 0x65, 0x45, 0x6d,
+	0x70, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x1d, 0x0a, 0x07, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0b, 0x2e, 0x45, 0x6d, 0x70,
+	0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23,
+	0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12,
+	0x0b, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52,
+	0x65, 0x73, 0x70, 0x12, 0x29, 0x0a, 0x10, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x6c, 0x6c,
+	0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0e, 0x2e, 0x41, 0x6c, 0x6c, 0x45, 0x6d, 0x70,
+	0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30,
+	0x0a, 0x0b, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f, 0x2e,
+	0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10,
+	0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x2a, 0x0a, 0x09, 0x48, 0x61, 0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x12, 0x0d, 0x2e,
+	0x48, 0x61, 0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x48,
+	0x61, 0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x11,
+	0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69,
+	0x6c, 0x12, 0x15, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44,
+	0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x45,
+	0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x53, 0x0a, 0x19, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44,
+	0x65, 0x74, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x1d, 0x2e,
+	0x57, 0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69,
+	0x6c, 0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x57,
 	0x61, 0x69, 0x74, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c,
-	0x42, 0x79, 0x53, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x1d, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x45,
-	0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x53, 0x70,
-	0x65, 0x63, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d,
-	0x70, 0x6f, 0x77, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70,
-	0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -1383,7 +1476,7 @@ func file_resource_proto_rawDescGZIP() []byte {
 	return file_resource_proto_rawDescData
 }
 
-var file_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
+var file_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
 var file_resource_proto_goTypes = []interface{}{
 	(*Empower)(nil),                      // 0: Empower
 	(*PowerReq)(nil),                     // 1: PowerReq
@@ -1392,45 +1485,48 @@ var file_resource_proto_goTypes = []interface{}{
 	(*RechargeReq)(nil),                  // 4: RechargeReq
 	(*EmpowerReq)(nil),                   // 5: EmpowerReq
 	(*AllEmpowerReq)(nil),                // 6: AllEmpowerReq
-	(*EmpowerListReq)(nil),               // 7: EmpowerListReq
-	(*EmpowerListResp)(nil),              // 8: EmpowerListResp
-	(*Resp)(nil),                         // 9: Resp
-	(*HaspowersReq)(nil),                 // 10: HaspowersReq
-	(*HaspowersResp)(nil),                // 11: HaspowersResp
-	(*WaitEmpowerDetailReq)(nil),         // 12: WaitEmpowerDetailReq
-	(*WaitEmpowerDetailBySpecIdReq)(nil), // 13: WaitEmpowerDetailBySpecIdReq
-	(*WaitEmpowerDetailsResp)(nil),       // 14: WaitEmpowerDetailsResp
-	(*WaitEmpowerDetailResp)(nil),        // 15: WaitEmpowerDetailResp
+	(*CrReEmpowerReq)(nil),               // 7: CrReEmpowerReq
+	(*EmpowerListReq)(nil),               // 8: EmpowerListReq
+	(*EmpowerListResp)(nil),              // 9: EmpowerListResp
+	(*Resp)(nil),                         // 10: Resp
+	(*HaspowersReq)(nil),                 // 11: HaspowersReq
+	(*HaspowersResp)(nil),                // 12: HaspowersResp
+	(*WaitEmpowerDetailReq)(nil),         // 13: WaitEmpowerDetailReq
+	(*WaitEmpowerDetailBySpecIdReq)(nil), // 14: WaitEmpowerDetailBySpecIdReq
+	(*WaitEmpowerDetailsResp)(nil),       // 15: WaitEmpowerDetailsResp
+	(*WaitEmpowerDetailResp)(nil),        // 16: WaitEmpowerDetailResp
 }
 var file_resource_proto_depIdxs = []int32{
 	0,  // 0: EmpowerListResp.list:type_name -> Empower
-	15, // 1: WaitEmpowerDetailsResp.waitEmpowerDetails:type_name -> WaitEmpowerDetailResp
+	16, // 1: WaitEmpowerDetailsResp.waitEmpowerDetails:type_name -> WaitEmpowerDetailResp
 	1,  // 2: Resource.PowerHandle:input_type -> PowerReq
 	2,  // 3: Resource.CheckPower:input_type -> CheckPowerReq
 	3,  // 4: Resource.Deduction:input_type -> DeductionReq
 	4,  // 5: Resource.Recharge:input_type -> RechargeReq
 	5,  // 6: Resource.ReEmpower:input_type -> EmpowerReq
-	5,  // 7: Resource.Empower:input_type -> EmpowerReq
-	5,  // 8: Resource.CancelEmpower:input_type -> EmpowerReq
-	6,  // 9: Resource.CancelAllEmpower:input_type -> AllEmpowerReq
-	7,  // 10: Resource.EmpowerList:input_type -> EmpowerListReq
-	10, // 11: Resource.Haspowers:input_type -> HaspowersReq
-	12, // 12: Resource.WaitEmpowerDetail:input_type -> WaitEmpowerDetailReq
-	13, // 13: Resource.WaitEmpowerDetailBySpecId:input_type -> WaitEmpowerDetailBySpecIdReq
-	9,  // 14: Resource.PowerHandle:output_type -> Resp
-	9,  // 15: Resource.CheckPower:output_type -> Resp
-	9,  // 16: Resource.Deduction:output_type -> Resp
-	9,  // 17: Resource.Recharge:output_type -> Resp
-	9,  // 18: Resource.ReEmpower:output_type -> Resp
-	9,  // 19: Resource.Empower:output_type -> Resp
-	9,  // 20: Resource.CancelEmpower:output_type -> Resp
-	9,  // 21: Resource.CancelAllEmpower:output_type -> Resp
-	8,  // 22: Resource.EmpowerList:output_type -> EmpowerListResp
-	11, // 23: Resource.Haspowers:output_type -> HaspowersResp
-	15, // 24: Resource.WaitEmpowerDetail:output_type -> WaitEmpowerDetailResp
-	14, // 25: Resource.WaitEmpowerDetailBySpecId:output_type -> WaitEmpowerDetailsResp
-	14, // [14:26] is the sub-list for method output_type
-	2,  // [2:14] is the sub-list for method input_type
+	7,  // 7: Resource.CrReEmpower:input_type -> CrReEmpowerReq
+	5,  // 8: Resource.Empower:input_type -> EmpowerReq
+	5,  // 9: Resource.CancelEmpower:input_type -> EmpowerReq
+	6,  // 10: Resource.CancelAllEmpower:input_type -> AllEmpowerReq
+	8,  // 11: Resource.EmpowerList:input_type -> EmpowerListReq
+	11, // 12: Resource.Haspowers:input_type -> HaspowersReq
+	13, // 13: Resource.WaitEmpowerDetail:input_type -> WaitEmpowerDetailReq
+	14, // 14: Resource.WaitEmpowerDetailBySpecId:input_type -> WaitEmpowerDetailBySpecIdReq
+	10, // 15: Resource.PowerHandle:output_type -> Resp
+	10, // 16: Resource.CheckPower:output_type -> Resp
+	10, // 17: Resource.Deduction:output_type -> Resp
+	10, // 18: Resource.Recharge:output_type -> Resp
+	10, // 19: Resource.ReEmpower:output_type -> Resp
+	10, // 20: Resource.CrReEmpower:output_type -> Resp
+	10, // 21: Resource.Empower:output_type -> Resp
+	10, // 22: Resource.CancelEmpower:output_type -> Resp
+	10, // 23: Resource.CancelAllEmpower:output_type -> Resp
+	9,  // 24: Resource.EmpowerList:output_type -> EmpowerListResp
+	12, // 25: Resource.Haspowers:output_type -> HaspowersResp
+	16, // 26: Resource.WaitEmpowerDetail:output_type -> WaitEmpowerDetailResp
+	15, // 27: Resource.WaitEmpowerDetailBySpecId:output_type -> WaitEmpowerDetailsResp
+	15, // [15:28] is the sub-list for method output_type
+	2,  // [2:15] is the sub-list for method input_type
 	2,  // [2:2] is the sub-list for extension type_name
 	2,  // [2:2] is the sub-list for extension extendee
 	0,  // [0:2] is the sub-list for field type_name
@@ -1527,7 +1623,7 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*EmpowerListReq); i {
+			switch v := v.(*CrReEmpowerReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1539,7 +1635,7 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*EmpowerListResp); i {
+			switch v := v.(*EmpowerListReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1551,7 +1647,7 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Resp); i {
+			switch v := v.(*EmpowerListResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1563,7 +1659,7 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*HaspowersReq); i {
+			switch v := v.(*Resp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1575,7 +1671,7 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*HaspowersResp); i {
+			switch v := v.(*HaspowersReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1587,7 +1683,7 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*WaitEmpowerDetailReq); i {
+			switch v := v.(*HaspowersResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1599,7 +1695,7 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*WaitEmpowerDetailBySpecIdReq); i {
+			switch v := v.(*WaitEmpowerDetailReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1611,7 +1707,7 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*WaitEmpowerDetailsResp); i {
+			switch v := v.(*WaitEmpowerDetailBySpecIdReq); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -1623,6 +1719,18 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*WaitEmpowerDetailsResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_resource_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*WaitEmpowerDetailResp); i {
 			case 0:
 				return &v.state
@@ -1641,7 +1749,7 @@ func file_resource_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_resource_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   16,
+			NumMessages:   17,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 40 - 2
rpc/pb/resource_grpc.pb.go

@@ -30,8 +30,10 @@ type ResourceClient interface {
 	Deduction(ctx context.Context, in *DeductionReq, opts ...grpc.CallOption) (*Resp, error)
 	//资源充值
 	Recharge(ctx context.Context, in *RechargeReq, opts ...grpc.CallOption) (*Resp, error)
-	//重新授权
+	//先把有权限的人清空,再把权益授权给新的人
 	ReEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
+	//先根据功能分类把人的权益清空,再给人授权新的权益
+	CrReEmpower(ctx context.Context, in *CrReEmpowerReq, opts ...grpc.CallOption) (*Resp, error)
 	//授权
 	Empower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
 	//根据功能代码取消授权
@@ -101,6 +103,15 @@ func (c *resourceClient) ReEmpower(ctx context.Context, in *EmpowerReq, opts ...
 	return out, nil
 }
 
+func (c *resourceClient) CrReEmpower(ctx context.Context, in *CrReEmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
+	err := c.cc.Invoke(ctx, "/Resource/CrReEmpower", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 func (c *resourceClient) Empower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
 	out := new(Resp)
 	err := c.cc.Invoke(ctx, "/Resource/Empower", in, out, opts...)
@@ -176,8 +187,10 @@ type ResourceServer interface {
 	Deduction(context.Context, *DeductionReq) (*Resp, error)
 	//资源充值
 	Recharge(context.Context, *RechargeReq) (*Resp, error)
-	//重新授权
+	//先把有权限的人清空,再把权益授权给新的人
 	ReEmpower(context.Context, *EmpowerReq) (*Resp, error)
+	//先根据功能分类把人的权益清空,再给人授权新的权益
+	CrReEmpower(context.Context, *CrReEmpowerReq) (*Resp, error)
 	//授权
 	Empower(context.Context, *EmpowerReq) (*Resp, error)
 	//根据功能代码取消授权
@@ -214,6 +227,9 @@ func (UnimplementedResourceServer) Recharge(context.Context, *RechargeReq) (*Res
 func (UnimplementedResourceServer) ReEmpower(context.Context, *EmpowerReq) (*Resp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ReEmpower not implemented")
 }
+func (UnimplementedResourceServer) CrReEmpower(context.Context, *CrReEmpowerReq) (*Resp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CrReEmpower not implemented")
+}
 func (UnimplementedResourceServer) Empower(context.Context, *EmpowerReq) (*Resp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method Empower not implemented")
 }
@@ -338,6 +354,24 @@ func _Resource_ReEmpower_Handler(srv interface{}, ctx context.Context, dec func(
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Resource_CrReEmpower_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CrReEmpowerReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ResourceServer).CrReEmpower(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/Resource/CrReEmpower",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ResourceServer).CrReEmpower(ctx, req.(*CrReEmpowerReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 func _Resource_Empower_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(EmpowerReq)
 	if err := dec(in); err != nil {
@@ -491,6 +525,10 @@ var Resource_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "ReEmpower",
 			Handler:    _Resource_ReEmpower_Handler,
 		},
+		{
+			MethodName: "CrReEmpower",
+			Handler:    _Resource_CrReEmpower_Handler,
+		},
 		{
 			MethodName: "Empower",
 			Handler:    _Resource_Empower_Handler,

+ 11 - 1
rpc/resource.proto

@@ -60,6 +60,14 @@ message AllEmpowerReq {
   repeated int64 ent_user_id = 4; 			//企业用户id
 }
 
+message CrReEmpowerReq {
+  string appid = 1;
+  repeated string function_module = 2;      //功能分类
+  repeated string function_code = 3;        //功能代码
+  int64 ent_id = 4;               			//企业id
+  repeated int64 ent_user_id = 5; 			//企业用户id
+}
+
 message EmpowerListReq {
   string appid = 1;
   string function_code = 2; //功能代码
@@ -127,8 +135,10 @@ service Resource {
   rpc Deduction(DeductionReq) returns(Resp);
   //资源充值
   rpc Recharge(RechargeReq) returns(Resp);
-  //重新授权
+  //先把有权限的人清空,再把权益授权给新的人
   rpc ReEmpower(EmpowerReq) returns(Resp);
+  //先根据功能分类把人的权益清空,再给人授权新的权益
+  rpc CrReEmpower(CrReEmpowerReq) returns(Resp);
   //授权
   rpc Empower(EmpowerReq) returns(Resp);
   //根据功能代码取消授权

+ 11 - 2
rpc/resource/resource.go

@@ -15,6 +15,7 @@ import (
 type (
 	AllEmpowerReq                = pb.AllEmpowerReq
 	CheckPowerReq                = pb.CheckPowerReq
+	CrReEmpowerReq               = pb.CrReEmpowerReq
 	DeductionReq                 = pb.DeductionReq
 	Empower                      = pb.Empower
 	EmpowerListReq               = pb.EmpowerListReq
@@ -39,8 +40,10 @@ type (
 		Deduction(ctx context.Context, in *DeductionReq, opts ...grpc.CallOption) (*Resp, error)
 		// 资源充值
 		Recharge(ctx context.Context, in *RechargeReq, opts ...grpc.CallOption) (*Resp, error)
-		// 重新授权
+		// 先把有权限的人清空,再把权益授权给新的人
 		ReEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
+		// 先根据功能分类把人的权益清空,再给人授权新的权益
+		CrReEmpower(ctx context.Context, in *CrReEmpowerReq, opts ...grpc.CallOption) (*Resp, error)
 		// 授权
 		Empower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
 		// 根据功能代码取消授权
@@ -92,12 +95,18 @@ func (m *defaultResource) Recharge(ctx context.Context, in *RechargeReq, opts ..
 	return client.Recharge(ctx, in, opts...)
 }
 
-// 重新授权
+// 先把有权限的人清空,再把权益授权给新的人
 func (m *defaultResource) ReEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
 	client := pb.NewResourceClient(m.cli.Conn())
 	return client.ReEmpower(ctx, in, opts...)
 }
 
+// 先根据功能分类把人的权益清空,再给人授权新的权益
+func (m *defaultResource) CrReEmpower(ctx context.Context, in *CrReEmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
+	client := pb.NewResourceClient(m.cli.Conn())
+	return client.CrReEmpower(ctx, in, opts...)
+}
+
 // 授权
 func (m *defaultResource) Empower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
 	client := pb.NewResourceClient(m.cli.Conn())