瀏覽代碼

feat:批量删除

wangchuanjin 1 年之前
父節點
當前提交
54b8dc4f61

+ 11 - 5
rpc/internal/logic/cancelallempowerlogic.go

@@ -2,7 +2,9 @@ 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"
 
@@ -23,9 +25,13 @@ func NewCancelAllEmpowerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
 	}
 }
 
-// 取消授权
-func (l *CancelAllEmpowerLogic) CancelAllEmpower(in *pb.EmpowerReq) (*pb.Resp, error) {
-	// todo: add your logic here and delete this line
-
-	return &pb.Resp{}, nil
+// 根据功能分类取消授权
+func (l *CancelAllEmpowerLogic) CancelAllEmpower(in *pb.AllEmpowerReq) (*pb.Resp, error) {
+	resp := &pb.Resp{}
+	status, err := CancelEmpower(in.Appid, in.FunctionModule, in.EntId, in.EntUserId)
+	if err != nil {
+		l.Error(fmt.Sprintf("%+v", in), err)
+	}
+	resp.Status = status
+	return resp, nil
 }

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

@@ -26,7 +26,7 @@ func NewCancelEmpowerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Can
 	}
 }
 
-// 取消授权
+// 根据功能代码取消授权
 func (l *CancelEmpowerLogic) CancelEmpower(in *pb.EmpowerReq) (*pb.Resp, error) {
 	resp := &pb.Resp{}
 	status, err := CancelEmpower(in.Appid, strings.Split(in.FunctionCode, ","), in.EntId, in.EntUserId)

+ 3 - 3
rpc/internal/server/resourceserver.go

@@ -58,14 +58,14 @@ func (s *ResourceServer) Empower(ctx context.Context, in *pb.EmpowerReq) (*pb.Re
 	return l.Empower(in)
 }
 
-// 取消授权
+// 根据功能代码取消授权
 func (s *ResourceServer) CancelEmpower(ctx context.Context, in *pb.EmpowerReq) (*pb.Resp, error) {
 	l := logic.NewCancelEmpowerLogic(ctx, s.svcCtx)
 	return l.CancelEmpower(in)
 }
 
-// 取消授权
-func (s *ResourceServer) CancelAllEmpower(ctx context.Context, in *pb.EmpowerReq) (*pb.Resp, error) {
+// 根据功能分类取消授权
+func (s *ResourceServer) CancelAllEmpower(ctx context.Context, in *pb.AllEmpowerReq) (*pb.Resp, error) {
 	l := logic.NewCancelAllEmpowerLogic(ctx, s.svcCtx)
 	return l.CancelAllEmpower(in)
 }

+ 42 - 42
rpc/pb/resource.pb.go

@@ -518,19 +518,19 @@ func (x *EmpowerReq) GetEntUserId() []int64 {
 	return nil
 }
 
-type EmpowerAllReq struct {
+type AllEmpowerReq 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,opt,name=function_module,json=functionModule,proto3" json:"function_module,omitempty"` //功能分类
-	EntId          int64   `protobuf:"varint,3,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                           //企业id
-	EntUserId      []int64 `protobuf:"varint,4,rep,packed,name=ent_user_id,json=entUserId,proto3" json:"ent_user_id,omitempty"`      //企业用户id
+	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"` //功能分类
+	EntId          int64    `protobuf:"varint,3,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                           //企业id
+	EntUserId      []int64  `protobuf:"varint,4,rep,packed,name=ent_user_id,json=entUserId,proto3" json:"ent_user_id,omitempty"`      //企业用户id
 }
 
-func (x *EmpowerAllReq) Reset() {
-	*x = EmpowerAllReq{}
+func (x *AllEmpowerReq) Reset() {
+	*x = AllEmpowerReq{}
 	if protoimpl.UnsafeEnabled {
 		mi := &file_resource_proto_msgTypes[6]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -538,13 +538,13 @@ func (x *EmpowerAllReq) Reset() {
 	}
 }
 
-func (x *EmpowerAllReq) String() string {
+func (x *AllEmpowerReq) String() string {
 	return protoimpl.X.MessageStringOf(x)
 }
 
-func (*EmpowerAllReq) ProtoMessage() {}
+func (*AllEmpowerReq) ProtoMessage() {}
 
-func (x *EmpowerAllReq) ProtoReflect() protoreflect.Message {
+func (x *AllEmpowerReq) ProtoReflect() protoreflect.Message {
 	mi := &file_resource_proto_msgTypes[6]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -556,33 +556,33 @@ func (x *EmpowerAllReq) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 }
 
-// Deprecated: Use EmpowerAllReq.ProtoReflect.Descriptor instead.
-func (*EmpowerAllReq) Descriptor() ([]byte, []int) {
+// Deprecated: Use AllEmpowerReq.ProtoReflect.Descriptor instead.
+func (*AllEmpowerReq) Descriptor() ([]byte, []int) {
 	return file_resource_proto_rawDescGZIP(), []int{6}
 }
 
-func (x *EmpowerAllReq) GetAppid() string {
+func (x *AllEmpowerReq) GetAppid() string {
 	if x != nil {
 		return x.Appid
 	}
 	return ""
 }
 
-func (x *EmpowerAllReq) GetFunctionModule() string {
+func (x *AllEmpowerReq) GetFunctionModule() []string {
 	if x != nil {
 		return x.FunctionModule
 	}
-	return ""
+	return nil
 }
 
-func (x *EmpowerAllReq) GetEntId() int64 {
+func (x *AllEmpowerReq) GetEntId() int64 {
 	if x != nil {
 		return x.EntId
 	}
 	return 0
 }
 
-func (x *EmpowerAllReq) GetEntUserId() []int64 {
+func (x *AllEmpowerReq) GetEntUserId() []int64 {
 	if x != nil {
 		return x.EntUserId
 	}
@@ -1257,10 +1257,10 @@ var file_resource_proto_rawDesc = []byte{
 	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, 0x85,
-	0x01, 0x0a, 0x0d, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71,
+	0x01, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 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, 0x01, 0x28, 0x09, 0x52,
+	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,
 	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,
@@ -1334,7 +1334,7 @@ var file_resource_proto_rawDesc = []byte{
 	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, 0x98, 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12,
+	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,
@@ -1349,26 +1349,26 @@ var file_resource_proto_rawDesc = []byte{
 	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, 0x26,
+	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, 0x0b, 0x2e, 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, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a,
-	0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	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, 0x73, 0x52, 0x65, 0x73, 0x70,
+	0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -1391,7 +1391,7 @@ var file_resource_proto_goTypes = []interface{}{
 	(*DeductionReq)(nil),                 // 3: DeductionReq
 	(*RechargeReq)(nil),                  // 4: RechargeReq
 	(*EmpowerReq)(nil),                   // 5: EmpowerReq
-	(*EmpowerAllReq)(nil),                // 6: EmpowerAllReq
+	(*AllEmpowerReq)(nil),                // 6: AllEmpowerReq
 	(*EmpowerListReq)(nil),               // 7: EmpowerListReq
 	(*EmpowerListResp)(nil),              // 8: EmpowerListResp
 	(*Resp)(nil),                         // 9: Resp
@@ -1412,7 +1412,7 @@ var file_resource_proto_depIdxs = []int32{
 	5,  // 6: Resource.ReEmpower:input_type -> EmpowerReq
 	5,  // 7: Resource.Empower:input_type -> EmpowerReq
 	5,  // 8: Resource.CancelEmpower:input_type -> EmpowerReq
-	5,  // 9: Resource.CancelAllEmpower: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
@@ -1515,7 +1515,7 @@ func file_resource_proto_init() {
 			}
 		}
 		file_resource_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*EmpowerAllReq); i {
+			switch v := v.(*AllEmpowerReq); i {
 			case 0:
 				return &v.state
 			case 1:

+ 10 - 10
rpc/pb/resource_grpc.pb.go

@@ -34,10 +34,10 @@ type ResourceClient interface {
 	ReEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
 	//授权
 	Empower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
-	//取消授权
+	//根据功能代码取消授权
 	CancelEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
-	//取消授权
-	CancelAllEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
+	//根据功能分类取消授权
+	CancelAllEmpower(ctx context.Context, in *AllEmpowerReq, opts ...grpc.CallOption) (*Resp, error)
 	//授权列表
 	EmpowerList(ctx context.Context, in *EmpowerListReq, opts ...grpc.CallOption) (*EmpowerListResp, error)
 	//所有的权益
@@ -119,7 +119,7 @@ func (c *resourceClient) CancelEmpower(ctx context.Context, in *EmpowerReq, opts
 	return out, nil
 }
 
-func (c *resourceClient) CancelAllEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
+func (c *resourceClient) CancelAllEmpower(ctx context.Context, in *AllEmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
 	out := new(Resp)
 	err := c.cc.Invoke(ctx, "/Resource/CancelAllEmpower", in, out, opts...)
 	if err != nil {
@@ -180,10 +180,10 @@ type ResourceServer interface {
 	ReEmpower(context.Context, *EmpowerReq) (*Resp, error)
 	//授权
 	Empower(context.Context, *EmpowerReq) (*Resp, error)
-	//取消授权
+	//根据功能代码取消授权
 	CancelEmpower(context.Context, *EmpowerReq) (*Resp, error)
-	//取消授权
-	CancelAllEmpower(context.Context, *EmpowerReq) (*Resp, error)
+	//根据功能分类取消授权
+	CancelAllEmpower(context.Context, *AllEmpowerReq) (*Resp, error)
 	//授权列表
 	EmpowerList(context.Context, *EmpowerListReq) (*EmpowerListResp, error)
 	//所有的权益
@@ -220,7 +220,7 @@ func (UnimplementedResourceServer) Empower(context.Context, *EmpowerReq) (*Resp,
 func (UnimplementedResourceServer) CancelEmpower(context.Context, *EmpowerReq) (*Resp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method CancelEmpower not implemented")
 }
-func (UnimplementedResourceServer) CancelAllEmpower(context.Context, *EmpowerReq) (*Resp, error) {
+func (UnimplementedResourceServer) CancelAllEmpower(context.Context, *AllEmpowerReq) (*Resp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method CancelAllEmpower not implemented")
 }
 func (UnimplementedResourceServer) EmpowerList(context.Context, *EmpowerListReq) (*EmpowerListResp, error) {
@@ -375,7 +375,7 @@ func _Resource_CancelEmpower_Handler(srv interface{}, ctx context.Context, dec f
 }
 
 func _Resource_CancelAllEmpower_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(EmpowerReq)
+	in := new(AllEmpowerReq)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
@@ -387,7 +387,7 @@ func _Resource_CancelAllEmpower_Handler(srv interface{}, ctx context.Context, de
 		FullMethod: "/Resource/CancelAllEmpower",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ResourceServer).CancelAllEmpower(ctx, req.(*EmpowerReq))
+		return srv.(ResourceServer).CancelAllEmpower(ctx, req.(*AllEmpowerReq))
 	}
 	return interceptor(ctx, in, info, handler)
 }

+ 7 - 7
rpc/resource.proto

@@ -53,11 +53,11 @@ message EmpowerReq {
   repeated int64 ent_user_id = 4; //企业用户id
 }
 
-message EmpowerAllReq {
+message AllEmpowerReq {
   string appid = 1;
-  string function_module = 2;     //功能分类
-  int64 ent_id = 3;               //企业id
-  repeated int64 ent_user_id = 4; //企业用户id
+  repeated string function_module = 2;      //功能分类
+  int64 ent_id = 3;               			//企业id
+  repeated int64 ent_user_id = 4; 			//企业用户id
 }
 
 message EmpowerListReq {
@@ -131,10 +131,10 @@ service Resource {
   rpc ReEmpower(EmpowerReq) returns(Resp);
   //授权
   rpc Empower(EmpowerReq) returns(Resp);
-  //取消授权
+  //根据功能代码取消授权
   rpc CancelEmpower(EmpowerReq) returns(Resp);
-  //取消授权
-  rpc CancelAllEmpower(EmpowerReq) returns(Resp);
+  //根据功能分类取消授权
+  rpc CancelAllEmpower(AllEmpowerReq) returns(Resp);
   //授权列表
   rpc EmpowerList(EmpowerListReq) returns(EmpowerListResp);
   //所有的权益

+ 7 - 7
rpc/resource/resource.go

@@ -13,10 +13,10 @@ import (
 )
 
 type (
+	AllEmpowerReq                = pb.AllEmpowerReq
 	CheckPowerReq                = pb.CheckPowerReq
 	DeductionReq                 = pb.DeductionReq
 	Empower                      = pb.Empower
-	EmpowerAllReq                = pb.EmpowerAllReq
 	EmpowerListReq               = pb.EmpowerListReq
 	EmpowerListResp              = pb.EmpowerListResp
 	EmpowerReq                   = pb.EmpowerReq
@@ -43,10 +43,10 @@ type (
 		ReEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
 		// 授权
 		Empower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
-		// 取消授权
+		// 根据功能代码取消授权
 		CancelEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
-		// 取消授权
-		CancelAllEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error)
+		// 根据功能分类取消授权
+		CancelAllEmpower(ctx context.Context, in *AllEmpowerReq, opts ...grpc.CallOption) (*Resp, error)
 		// 授权列表
 		EmpowerList(ctx context.Context, in *EmpowerListReq, opts ...grpc.CallOption) (*EmpowerListResp, error)
 		// 所有的权益
@@ -104,14 +104,14 @@ func (m *defaultResource) Empower(ctx context.Context, in *EmpowerReq, opts ...g
 	return client.Empower(ctx, in, opts...)
 }
 
-// 取消授权
+// 根据功能代码取消授权
 func (m *defaultResource) CancelEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
 	client := pb.NewResourceClient(m.cli.Conn())
 	return client.CancelEmpower(ctx, in, opts...)
 }
 
-// 取消授权
-func (m *defaultResource) CancelAllEmpower(ctx context.Context, in *EmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
+// 根据功能分类取消授权
+func (m *defaultResource) CancelAllEmpower(ctx context.Context, in *AllEmpowerReq, opts ...grpc.CallOption) (*Resp, error) {
 	client := pb.NewResourceClient(m.cli.Conn())
 	return client.CancelAllEmpower(ctx, in, opts...)
 }