瀏覽代碼

增加接口

wangchuanjin 2 年之前
父節點
當前提交
e2660a93b9

+ 1 - 1
go.mod

@@ -1,6 +1,6 @@
 module bp.jydev.jianyu360.cn/BaseService/entManageApplication
 
-go 1.17
+go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196

+ 5 - 0
rpc/entManageApplication.proto

@@ -62,9 +62,14 @@ message DelUsePersonReq {
 	int64 entniche_power_id = 1;
 }
 
+message EmpowerUserIds {
+	repeated int64 ids = 1;
+}
+
 service EntManageApplication {
 	rpc buyProductList (BuyProductListReq) returns (BuyProductListResp); //已购产品列表
 	rpc usePersonList (UsePersonListReq) returns (UsePersonListResp); //使用人员列表
 	rpc addUsePerson (AddUsePersonReq) returns (AddUsePersonResp); //添加使用人员
 	rpc delUsePerson (DelUsePersonReq) returns (AddUsePersonResp); //删除使用人员
+	rpc empowerUserIds (EmpowerUserIds) returns (EmpowerUserIds); //获取指定用户中的已授权用户
 }

+ 26 - 20
rpc/entmanageapplication/entmanageapplication.go

@@ -1,8 +1,6 @@
 // Code generated by goctl. DO NOT EDIT!
 // Source: entManageApplication.proto
 
-//go:generate mockgen -destination ./entmanageapplication_mock.go -package entmanageapplication -source $GOFILE
-
 package entmanageapplication
 
 import (
@@ -11,25 +9,28 @@ import (
 	"bp.jydev.jianyu360.cn/BaseService/entManageApplication/rpc/pb"
 
 	"github.com/zeromicro/go-zero/zrpc"
+	"google.golang.org/grpc"
 )
 
 type (
+	AddUsePerson       = pb.AddUsePerson
+	AddUsePersonReq    = pb.AddUsePersonReq
+	AddUsePersonResp   = pb.AddUsePersonResp
+	BuyProductList     = pb.BuyProductList
 	BuyProductListReq  = pb.BuyProductListReq
 	BuyProductListResp = pb.BuyProductListResp
-	BuyProductList     = pb.BuyProductList
-	UsePersonListReq   = pb.UsePersonListReq
+	DelUsePersonReq    = pb.DelUsePersonReq
+	EmpowerUserIds     = pb.EmpowerUserIds
 	UsePersonList      = pb.UsePersonList
+	UsePersonListReq   = pb.UsePersonListReq
 	UsePersonListResp  = pb.UsePersonListResp
-	AddUsePersonReq    = pb.AddUsePersonReq
-	AddUsePersonResp   = pb.AddUsePersonResp
-	AddUsePerson       = pb.AddUsePerson
-	DelUsePersonReq    = pb.DelUsePersonReq
 
 	EntManageApplication interface {
-		BuyProductList(ctx context.Context, in *BuyProductListReq) (*BuyProductListResp, error)
-		UsePersonList(ctx context.Context, in *UsePersonListReq) (*UsePersonListResp, error)
-		AddUsePerson(ctx context.Context, in *AddUsePersonReq) (*AddUsePersonResp, error)
-		DelUsePerson(ctx context.Context, in *DelUsePersonReq) (*AddUsePersonResp, error)
+		BuyProductList(ctx context.Context, in *BuyProductListReq, opts ...grpc.CallOption) (*BuyProductListResp, error)
+		UsePersonList(ctx context.Context, in *UsePersonListReq, opts ...grpc.CallOption) (*UsePersonListResp, error)
+		AddUsePerson(ctx context.Context, in *AddUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error)
+		DelUsePerson(ctx context.Context, in *DelUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error)
+		EmpowerUserIds(ctx context.Context, in *EmpowerUserIds, opts ...grpc.CallOption) (*EmpowerUserIds, error)
 	}
 
 	defaultEntManageApplication struct {
@@ -43,22 +44,27 @@ func NewEntManageApplication(cli zrpc.Client) EntManageApplication {
 	}
 }
 
-func (m *defaultEntManageApplication) BuyProductList(ctx context.Context, in *BuyProductListReq) (*BuyProductListResp, error) {
+func (m *defaultEntManageApplication) BuyProductList(ctx context.Context, in *BuyProductListReq, opts ...grpc.CallOption) (*BuyProductListResp, error) {
+	client := pb.NewEntManageApplicationClient(m.cli.Conn())
+	return client.BuyProductList(ctx, in, opts...)
+}
+
+func (m *defaultEntManageApplication) UsePersonList(ctx context.Context, in *UsePersonListReq, opts ...grpc.CallOption) (*UsePersonListResp, error) {
 	client := pb.NewEntManageApplicationClient(m.cli.Conn())
-	return client.BuyProductList(ctx, in)
+	return client.UsePersonList(ctx, in, opts...)
 }
 
-func (m *defaultEntManageApplication) UsePersonList(ctx context.Context, in *UsePersonListReq) (*UsePersonListResp, error) {
+func (m *defaultEntManageApplication) AddUsePerson(ctx context.Context, in *AddUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error) {
 	client := pb.NewEntManageApplicationClient(m.cli.Conn())
-	return client.UsePersonList(ctx, in)
+	return client.AddUsePerson(ctx, in, opts...)
 }
 
-func (m *defaultEntManageApplication) AddUsePerson(ctx context.Context, in *AddUsePersonReq) (*AddUsePersonResp, error) {
+func (m *defaultEntManageApplication) DelUsePerson(ctx context.Context, in *DelUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error) {
 	client := pb.NewEntManageApplicationClient(m.cli.Conn())
-	return client.AddUsePerson(ctx, in)
+	return client.DelUsePerson(ctx, in, opts...)
 }
 
-func (m *defaultEntManageApplication) DelUsePerson(ctx context.Context, in *DelUsePersonReq) (*AddUsePersonResp, error) {
+func (m *defaultEntManageApplication) EmpowerUserIds(ctx context.Context, in *EmpowerUserIds, opts ...grpc.CallOption) (*EmpowerUserIds, error) {
 	client := pb.NewEntManageApplicationClient(m.cli.Conn())
-	return client.DelUsePerson(ctx, in)
+	return client.EmpowerUserIds(ctx, in, opts...)
 }

+ 30 - 0
rpc/internal/logic/empoweruseridslogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"bp.jydev.jianyu360.cn/BaseService/entManageApplication/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/entManageApplication/rpc/pb"
+	"bp.jydev.jianyu360.cn/BaseService/entManageApplication/service"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type EmpowerUserIdsLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewEmpowerUserIdsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EmpowerUserIdsLogic {
+	return &EmpowerUserIdsLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *EmpowerUserIdsLogic) EmpowerUserIds(in *pb.EmpowerUserIds) (*pb.EmpowerUserIds, error) {
+	// todo: add your logic here and delete this line
+
+	return service.EmpowerUserIds(in.id), nil
+}

+ 6 - 0
rpc/internal/server/entmanageapplicationserver.go

@@ -13,6 +13,7 @@ import (
 
 type EntManageApplicationServer struct {
 	svcCtx *svc.ServiceContext
+	pb.UnimplementedEntManageApplicationServer
 }
 
 func NewEntManageApplicationServer(svcCtx *svc.ServiceContext) *EntManageApplicationServer {
@@ -40,3 +41,8 @@ func (s *EntManageApplicationServer) DelUsePerson(ctx context.Context, in *pb.De
 	l := logic.NewDelUsePersonLogic(ctx, s.svcCtx)
 	return l.DelUsePerson(in)
 }
+
+func (s *EntManageApplicationServer) EmpowerUserIds(ctx context.Context, in *pb.EmpowerUserIds) (*pb.EmpowerUserIds, error) {
+	l := logic.NewEmpowerUserIdsLogic(ctx, s.svcCtx)
+	return l.EmpowerUserIds(in)
+}

+ 105 - 235
rpc/pb/entManageApplication.pb.go

@@ -1,17 +1,12 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.23.0
-// 	protoc        v3.11.4
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.20.0--rc2
 // source: entManageApplication.proto
 
 package pb
 
 import (
-	context "context"
-	proto "github.com/golang/protobuf/proto"
-	grpc "google.golang.org/grpc"
-	codes "google.golang.org/grpc/codes"
-	status "google.golang.org/grpc/status"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	reflect "reflect"
@@ -25,10 +20,6 @@ const (
 	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
 )
 
-// This is a compile-time assertion that a sufficiently up-to-date version
-// of the legacy proto package is being used.
-const _ = proto.ProtoPackageIsVersion4
-
 type BuyProductListReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -659,6 +650,53 @@ func (x *DelUsePersonReq) GetEntnichePowerId() int64 {
 	return 0
 }
 
+type EmpowerUserIds struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"`
+}
+
+func (x *EmpowerUserIds) Reset() {
+	*x = EmpowerUserIds{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_entManageApplication_proto_msgTypes[10]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *EmpowerUserIds) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EmpowerUserIds) ProtoMessage() {}
+
+func (x *EmpowerUserIds) ProtoReflect() protoreflect.Message {
+	mi := &file_entManageApplication_proto_msgTypes[10]
+	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 EmpowerUserIds.ProtoReflect.Descriptor instead.
+func (*EmpowerUserIds) Descriptor() ([]byte, []int) {
+	return file_entManageApplication_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *EmpowerUserIds) GetIds() []int64 {
+	if x != nil {
+		return x.Ids
+	}
+	return nil
+}
+
 var File_entManageApplication_proto protoreflect.FileDescriptor
 
 var file_entManageApplication_proto_rawDesc = []byte{
@@ -733,24 +771,29 @@ var file_entManageApplication_proto_rawDesc = []byte{
 	0x0f, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71,
 	0x12, 0x2a, 0x0a, 0x11, 0x65, 0x6e, 0x74, 0x6e, 0x69, 0x63, 0x68, 0x65, 0x5f, 0x70, 0x6f, 0x77,
 	0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x65, 0x6e, 0x74,
-	0x6e, 0x69, 0x63, 0x68, 0x65, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x49, 0x64, 0x32, 0xf3, 0x01, 0x0a,
-	0x14, 0x45, 0x6e, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63,
-	0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0e, 0x62, 0x75, 0x79, 0x50, 0x72, 0x6f, 0x64,
-	0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x2e, 0x42, 0x75, 0x79, 0x50, 0x72, 0x6f,
-	0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x42, 0x75,
-	0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x36, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x4c, 0x69, 0x73,
-	0x74, 0x12, 0x11, 0x2e, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x4c, 0x69, 0x73,
-	0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e,
-	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x0c, 0x61, 0x64, 0x64, 0x55,
-	0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x10, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73,
-	0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x41, 0x64, 0x64,
-	0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a,
-	0x0c, 0x64, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x10, 0x2e,
-	0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a,
-	0x11, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65,
-	0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x33,
+	0x6e, 0x69, 0x63, 0x68, 0x65, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x49, 0x64, 0x22, 0x22, 0x0a, 0x0e,
+	0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x10,
+	0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, 0x73,
+	0x32, 0xa7, 0x02, 0x0a, 0x14, 0x45, 0x6e, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x41, 0x70,
+	0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0e, 0x62, 0x75, 0x79,
+	0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x2e, 0x42, 0x75,
+	0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a,
+	0x13, 0x2e, 0x42, 0x75, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f,
+	0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f,
+	0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x55, 0x73, 0x65, 0x50, 0x65,
+	0x72, 0x73, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x0c,
+	0x61, 0x64, 0x64, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x10, 0x2e, 0x41,
+	0x64, 0x64, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x11,
+	0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x33, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f,
+	0x6e, 0x12, 0x10, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e,
+	0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x50, 0x65, 0x72, 0x73,
+	0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x0e, 0x65, 0x6d, 0x70, 0x6f, 0x77, 0x65,
+	0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x0f, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77,
+	0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x1a, 0x0f, 0x2e, 0x45, 0x6d, 0x70, 0x6f,
+	0x77, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
+	0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -765,7 +808,7 @@ func file_entManageApplication_proto_rawDescGZIP() []byte {
 	return file_entManageApplication_proto_rawDescData
 }
 
-var file_entManageApplication_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
+var file_entManageApplication_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
 var file_entManageApplication_proto_goTypes = []interface{}{
 	(*BuyProductListReq)(nil),  // 0: BuyProductListReq
 	(*BuyProductListResp)(nil), // 1: BuyProductListResp
@@ -777,24 +820,27 @@ var file_entManageApplication_proto_goTypes = []interface{}{
 	(*AddUsePersonResp)(nil),   // 7: AddUsePersonResp
 	(*AddUsePerson)(nil),       // 8: AddUsePerson
 	(*DelUsePersonReq)(nil),    // 9: DelUsePersonReq
+	(*EmpowerUserIds)(nil),     // 10: EmpowerUserIds
 }
 var file_entManageApplication_proto_depIdxs = []int32{
-	2, // 0: BuyProductListResp.data:type_name -> BuyProductList
-	5, // 1: UsePersonListResp.data:type_name -> UsePersonList
-	8, // 2: AddUsePersonResp.data:type_name -> AddUsePerson
-	0, // 3: EntManageApplication.buyProductList:input_type -> BuyProductListReq
-	3, // 4: EntManageApplication.usePersonList:input_type -> UsePersonListReq
-	6, // 5: EntManageApplication.addUsePerson:input_type -> AddUsePersonReq
-	9, // 6: EntManageApplication.delUsePerson:input_type -> DelUsePersonReq
-	1, // 7: EntManageApplication.buyProductList:output_type -> BuyProductListResp
-	4, // 8: EntManageApplication.usePersonList:output_type -> UsePersonListResp
-	7, // 9: EntManageApplication.addUsePerson:output_type -> AddUsePersonResp
-	7, // 10: EntManageApplication.delUsePerson:output_type -> AddUsePersonResp
-	7, // [7:11] is the sub-list for method output_type
-	3, // [3:7] 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
+	2,  // 0: BuyProductListResp.data:type_name -> BuyProductList
+	5,  // 1: UsePersonListResp.data:type_name -> UsePersonList
+	8,  // 2: AddUsePersonResp.data:type_name -> AddUsePerson
+	0,  // 3: EntManageApplication.buyProductList:input_type -> BuyProductListReq
+	3,  // 4: EntManageApplication.usePersonList:input_type -> UsePersonListReq
+	6,  // 5: EntManageApplication.addUsePerson:input_type -> AddUsePersonReq
+	9,  // 6: EntManageApplication.delUsePerson:input_type -> DelUsePersonReq
+	10, // 7: EntManageApplication.empowerUserIds:input_type -> EmpowerUserIds
+	1,  // 8: EntManageApplication.buyProductList:output_type -> BuyProductListResp
+	4,  // 9: EntManageApplication.usePersonList:output_type -> UsePersonListResp
+	7,  // 10: EntManageApplication.addUsePerson:output_type -> AddUsePersonResp
+	7,  // 11: EntManageApplication.delUsePerson:output_type -> AddUsePersonResp
+	10, // 12: EntManageApplication.empowerUserIds:output_type -> EmpowerUserIds
+	8,  // [8:13] is the sub-list for method output_type
+	3,  // [3:8] 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
 }
 
 func init() { file_entManageApplication_proto_init() }
@@ -923,6 +969,18 @@ func file_entManageApplication_proto_init() {
 				return nil
 			}
 		}
+		file_entManageApplication_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*EmpowerUserIds); 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{
@@ -930,7 +988,7 @@ func file_entManageApplication_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_entManageApplication_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   10,
+			NumMessages:   11,
 			NumExtensions: 0,
 			NumServices:   1,
 		},
@@ -943,191 +1001,3 @@ func file_entManageApplication_proto_init() {
 	file_entManageApplication_proto_goTypes = nil
 	file_entManageApplication_proto_depIdxs = nil
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// EntManageApplicationClient is the client API for EntManageApplication service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type EntManageApplicationClient interface {
-	BuyProductList(ctx context.Context, in *BuyProductListReq, opts ...grpc.CallOption) (*BuyProductListResp, error)
-	UsePersonList(ctx context.Context, in *UsePersonListReq, opts ...grpc.CallOption) (*UsePersonListResp, error)
-	AddUsePerson(ctx context.Context, in *AddUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error)
-	DelUsePerson(ctx context.Context, in *DelUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error)
-}
-
-type entManageApplicationClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewEntManageApplicationClient(cc grpc.ClientConnInterface) EntManageApplicationClient {
-	return &entManageApplicationClient{cc}
-}
-
-func (c *entManageApplicationClient) BuyProductList(ctx context.Context, in *BuyProductListReq, opts ...grpc.CallOption) (*BuyProductListResp, error) {
-	out := new(BuyProductListResp)
-	err := c.cc.Invoke(ctx, "/EntManageApplication/buyProductList", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *entManageApplicationClient) UsePersonList(ctx context.Context, in *UsePersonListReq, opts ...grpc.CallOption) (*UsePersonListResp, error) {
-	out := new(UsePersonListResp)
-	err := c.cc.Invoke(ctx, "/EntManageApplication/usePersonList", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *entManageApplicationClient) AddUsePerson(ctx context.Context, in *AddUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error) {
-	out := new(AddUsePersonResp)
-	err := c.cc.Invoke(ctx, "/EntManageApplication/addUsePerson", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *entManageApplicationClient) DelUsePerson(ctx context.Context, in *DelUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error) {
-	out := new(AddUsePersonResp)
-	err := c.cc.Invoke(ctx, "/EntManageApplication/delUsePerson", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-// EntManageApplicationServer is the server API for EntManageApplication service.
-type EntManageApplicationServer interface {
-	BuyProductList(context.Context, *BuyProductListReq) (*BuyProductListResp, error)
-	UsePersonList(context.Context, *UsePersonListReq) (*UsePersonListResp, error)
-	AddUsePerson(context.Context, *AddUsePersonReq) (*AddUsePersonResp, error)
-	DelUsePerson(context.Context, *DelUsePersonReq) (*AddUsePersonResp, error)
-}
-
-// UnimplementedEntManageApplicationServer can be embedded to have forward compatible implementations.
-type UnimplementedEntManageApplicationServer struct {
-}
-
-func (*UnimplementedEntManageApplicationServer) BuyProductList(context.Context, *BuyProductListReq) (*BuyProductListResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method BuyProductList not implemented")
-}
-func (*UnimplementedEntManageApplicationServer) UsePersonList(context.Context, *UsePersonListReq) (*UsePersonListResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method UsePersonList not implemented")
-}
-func (*UnimplementedEntManageApplicationServer) AddUsePerson(context.Context, *AddUsePersonReq) (*AddUsePersonResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method AddUsePerson not implemented")
-}
-func (*UnimplementedEntManageApplicationServer) DelUsePerson(context.Context, *DelUsePersonReq) (*AddUsePersonResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method DelUsePerson not implemented")
-}
-
-func RegisterEntManageApplicationServer(s *grpc.Server, srv EntManageApplicationServer) {
-	s.RegisterService(&_EntManageApplication_serviceDesc, srv)
-}
-
-func _EntManageApplication_BuyProductList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(BuyProductListReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(EntManageApplicationServer).BuyProductList(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/EntManageApplication/BuyProductList",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(EntManageApplicationServer).BuyProductList(ctx, req.(*BuyProductListReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _EntManageApplication_UsePersonList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(UsePersonListReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(EntManageApplicationServer).UsePersonList(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/EntManageApplication/UsePersonList",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(EntManageApplicationServer).UsePersonList(ctx, req.(*UsePersonListReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _EntManageApplication_AddUsePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(AddUsePersonReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(EntManageApplicationServer).AddUsePerson(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/EntManageApplication/AddUsePerson",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(EntManageApplicationServer).AddUsePerson(ctx, req.(*AddUsePersonReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _EntManageApplication_DelUsePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(DelUsePersonReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(EntManageApplicationServer).DelUsePerson(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/EntManageApplication/DelUsePerson",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(EntManageApplicationServer).DelUsePerson(ctx, req.(*DelUsePersonReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-var _EntManageApplication_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "EntManageApplication",
-	HandlerType: (*EntManageApplicationServer)(nil),
-	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "buyProductList",
-			Handler:    _EntManageApplication_BuyProductList_Handler,
-		},
-		{
-			MethodName: "usePersonList",
-			Handler:    _EntManageApplication_UsePersonList_Handler,
-		},
-		{
-			MethodName: "addUsePerson",
-			Handler:    _EntManageApplication_AddUsePerson_Handler,
-		},
-		{
-			MethodName: "delUsePerson",
-			Handler:    _EntManageApplication_DelUsePerson_Handler,
-		},
-	},
-	Streams:  []grpc.StreamDesc{},
-	Metadata: "entManageApplication.proto",
-}

+ 249 - 0
rpc/pb/entManageApplication_grpc.pb.go

@@ -0,0 +1,249 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.2.0
+// - protoc             v3.20.0--rc2
+// source: entManageApplication.proto
+
+package pb
+
+import (
+	context "context"
+	grpc "google.golang.org/grpc"
+	codes "google.golang.org/grpc/codes"
+	status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+// EntManageApplicationClient is the client API for EntManageApplication service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type EntManageApplicationClient interface {
+	BuyProductList(ctx context.Context, in *BuyProductListReq, opts ...grpc.CallOption) (*BuyProductListResp, error)
+	UsePersonList(ctx context.Context, in *UsePersonListReq, opts ...grpc.CallOption) (*UsePersonListResp, error)
+	AddUsePerson(ctx context.Context, in *AddUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error)
+	DelUsePerson(ctx context.Context, in *DelUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error)
+	EmpowerUserIds(ctx context.Context, in *EmpowerUserIds, opts ...grpc.CallOption) (*EmpowerUserIds, error)
+}
+
+type entManageApplicationClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewEntManageApplicationClient(cc grpc.ClientConnInterface) EntManageApplicationClient {
+	return &entManageApplicationClient{cc}
+}
+
+func (c *entManageApplicationClient) BuyProductList(ctx context.Context, in *BuyProductListReq, opts ...grpc.CallOption) (*BuyProductListResp, error) {
+	out := new(BuyProductListResp)
+	err := c.cc.Invoke(ctx, "/EntManageApplication/buyProductList", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *entManageApplicationClient) UsePersonList(ctx context.Context, in *UsePersonListReq, opts ...grpc.CallOption) (*UsePersonListResp, error) {
+	out := new(UsePersonListResp)
+	err := c.cc.Invoke(ctx, "/EntManageApplication/usePersonList", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *entManageApplicationClient) AddUsePerson(ctx context.Context, in *AddUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error) {
+	out := new(AddUsePersonResp)
+	err := c.cc.Invoke(ctx, "/EntManageApplication/addUsePerson", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *entManageApplicationClient) DelUsePerson(ctx context.Context, in *DelUsePersonReq, opts ...grpc.CallOption) (*AddUsePersonResp, error) {
+	out := new(AddUsePersonResp)
+	err := c.cc.Invoke(ctx, "/EntManageApplication/delUsePerson", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *entManageApplicationClient) EmpowerUserIds(ctx context.Context, in *EmpowerUserIds, opts ...grpc.CallOption) (*EmpowerUserIds, error) {
+	out := new(EmpowerUserIds)
+	err := c.cc.Invoke(ctx, "/EntManageApplication/empowerUserIds", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+// EntManageApplicationServer is the server API for EntManageApplication service.
+// All implementations must embed UnimplementedEntManageApplicationServer
+// for forward compatibility
+type EntManageApplicationServer interface {
+	BuyProductList(context.Context, *BuyProductListReq) (*BuyProductListResp, error)
+	UsePersonList(context.Context, *UsePersonListReq) (*UsePersonListResp, error)
+	AddUsePerson(context.Context, *AddUsePersonReq) (*AddUsePersonResp, error)
+	DelUsePerson(context.Context, *DelUsePersonReq) (*AddUsePersonResp, error)
+	EmpowerUserIds(context.Context, *EmpowerUserIds) (*EmpowerUserIds, error)
+	mustEmbedUnimplementedEntManageApplicationServer()
+}
+
+// UnimplementedEntManageApplicationServer must be embedded to have forward compatible implementations.
+type UnimplementedEntManageApplicationServer struct {
+}
+
+func (UnimplementedEntManageApplicationServer) BuyProductList(context.Context, *BuyProductListReq) (*BuyProductListResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method BuyProductList not implemented")
+}
+func (UnimplementedEntManageApplicationServer) UsePersonList(context.Context, *UsePersonListReq) (*UsePersonListResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method UsePersonList not implemented")
+}
+func (UnimplementedEntManageApplicationServer) AddUsePerson(context.Context, *AddUsePersonReq) (*AddUsePersonResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method AddUsePerson not implemented")
+}
+func (UnimplementedEntManageApplicationServer) DelUsePerson(context.Context, *DelUsePersonReq) (*AddUsePersonResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method DelUsePerson not implemented")
+}
+func (UnimplementedEntManageApplicationServer) EmpowerUserIds(context.Context, *EmpowerUserIds) (*EmpowerUserIds, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method EmpowerUserIds not implemented")
+}
+func (UnimplementedEntManageApplicationServer) mustEmbedUnimplementedEntManageApplicationServer() {}
+
+// UnsafeEntManageApplicationServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to EntManageApplicationServer will
+// result in compilation errors.
+type UnsafeEntManageApplicationServer interface {
+	mustEmbedUnimplementedEntManageApplicationServer()
+}
+
+func RegisterEntManageApplicationServer(s grpc.ServiceRegistrar, srv EntManageApplicationServer) {
+	s.RegisterService(&EntManageApplication_ServiceDesc, srv)
+}
+
+func _EntManageApplication_BuyProductList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(BuyProductListReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(EntManageApplicationServer).BuyProductList(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/EntManageApplication/buyProductList",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(EntManageApplicationServer).BuyProductList(ctx, req.(*BuyProductListReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _EntManageApplication_UsePersonList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(UsePersonListReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(EntManageApplicationServer).UsePersonList(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/EntManageApplication/usePersonList",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(EntManageApplicationServer).UsePersonList(ctx, req.(*UsePersonListReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _EntManageApplication_AddUsePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(AddUsePersonReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(EntManageApplicationServer).AddUsePerson(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/EntManageApplication/addUsePerson",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(EntManageApplicationServer).AddUsePerson(ctx, req.(*AddUsePersonReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _EntManageApplication_DelUsePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(DelUsePersonReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(EntManageApplicationServer).DelUsePerson(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/EntManageApplication/delUsePerson",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(EntManageApplicationServer).DelUsePerson(ctx, req.(*DelUsePersonReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _EntManageApplication_EmpowerUserIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(EmpowerUserIds)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(EntManageApplicationServer).EmpowerUserIds(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/EntManageApplication/empowerUserIds",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(EntManageApplicationServer).EmpowerUserIds(ctx, req.(*EmpowerUserIds))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+// EntManageApplication_ServiceDesc is the grpc.ServiceDesc for EntManageApplication service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var EntManageApplication_ServiceDesc = grpc.ServiceDesc{
+	ServiceName: "EntManageApplication",
+	HandlerType: (*EntManageApplicationServer)(nil),
+	Methods: []grpc.MethodDesc{
+		{
+			MethodName: "buyProductList",
+			Handler:    _EntManageApplication_BuyProductList_Handler,
+		},
+		{
+			MethodName: "usePersonList",
+			Handler:    _EntManageApplication_UsePersonList_Handler,
+		},
+		{
+			MethodName: "addUsePerson",
+			Handler:    _EntManageApplication_AddUsePerson_Handler,
+		},
+		{
+			MethodName: "delUsePerson",
+			Handler:    _EntManageApplication_DelUsePerson_Handler,
+		},
+		{
+			MethodName: "empowerUserIds",
+			Handler:    _EntManageApplication_EmpowerUserIds_Handler,
+		},
+	},
+	Streams:  []grpc.StreamDesc{},
+	Metadata: "entManageApplication.proto",
+}

+ 17 - 0
service/service.go

@@ -10,6 +10,7 @@ import (
 
 	"context"
 
+	. "app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/mongodb"
 	. "bp.jydev.jianyu360.cn/BaseService/entManageApplication/entity"
 	"bp.jydev.jianyu360.cn/BaseService/entManageApplication/rpc/entmanageapplication"
@@ -717,3 +718,19 @@ func memberSetMap(userId int64, orderData map[string]interface{}) (set map[strin
 	}
 	return
 }
+
+//
+func EmpowerUserIds(ids []int64) *entmanageapplication.EmpowerUserIds {
+	result := &entmanageapplication.EmpowerUserIds{}
+	array := []string{}
+	for _, v := range ids {
+		array = append(array, fmt.Sprint(v))
+	}
+	list := JyMysql.SelectBySql(`SELECT a.ent_user_id from entniche_power a inner join entniche_wait_empower b on (a.ent_user_id in (`+strings.Join(array, ",")+`) and a.status=1 and b.end_time>? and a.wait_empower_id=b.id) ORDER BY a.create_time desc`, NowFormat(Date_Full_Layout))
+	if list != nil {
+		for _, v := range *list {
+			result.Ids = append(result.Ids, common.Int64All(v["ent_user_id"]))
+		}
+	}
+	return result
+}

+ 5 - 1
service/service_test.go

@@ -29,7 +29,7 @@ func init() {
 	//用户中台配置
 	userClient := zrpc.MustNewClient(zrpc.RpcClientConf{
 		Etcd: discov.EtcdConf{
-			Hosts: []string{"127.0.0.1:2379"},
+			Hosts: []string{"192.168.3.149:2379"},
 			Key:   "usercenter.rpc",
 		},
 	})
@@ -135,3 +135,7 @@ func TestUsePersonList(t *testing.T) {
 		})
 	}
 }
+
+func TestEmpowerUserIds(t *testing.T) {
+	t.Log(EmpowerUserIds([]int64{5388, 5391}).Ids)
+}