Browse Source

feat:新增方法

wangchuanjin 1 year ago
parent
commit
86c53d7454

+ 9 - 1
public/entity/base_ent_wait_empower.go

@@ -23,7 +23,15 @@ type base_ent_wait_empower struct {
 	Limit_strategy      string //限制频率;1d:1天 1m:1个月
 	Limit_strategy      string //限制频率;1d:1天 1m:1个月
 }
 }
 
 
-//待授权记录
+//根据商品规格获取待授权记录
+func (b *base_ent_wait_empower) WaitEmpowersBySpecId(appid string, spec_id, ent_id int64) *[]*base_ent_wait_empower {
+	list := Mysql_BaseService.SelectBySql(`SELECT c.* FROM base_goods_spec a
+	INNER JOIN base_goods_spec_power b ON (a.id=? AND a.appid=? AND a.id=b.spec_id)
+	INNER JOIN base_ent_wait_empower c ON (c.ent_id=? AND c.end_time>? AND b.id=c.goods_spec_power_id)`, spec_id, appid, ent_id, NowFormat(Date_Full_Layout))
+	return JsonUnmarshal(list, &[]*base_ent_wait_empower{}).(*[]*base_ent_wait_empower)
+}
+
+//根据功能代码获取待授权记录
 func (b *base_ent_wait_empower) WaitEmpowers(appid, function_code string, ent_id int64) *[]*base_ent_wait_empower {
 func (b *base_ent_wait_empower) WaitEmpowers(appid, function_code string, ent_id int64) *[]*base_ent_wait_empower {
 	list := Mysql_BaseService.SelectBySql(`select * from base_ent_wait_empower where appid=? and function_code=? and ent_id=? and end_time>?`, appid, function_code, ent_id, NowFormat(Date_Full_Layout))
 	list := Mysql_BaseService.SelectBySql(`select * from base_ent_wait_empower where appid=? and function_code=? and ent_id=? and end_time>?`, appid, function_code, ent_id, NowFormat(Date_Full_Layout))
 	return JsonUnmarshal(list, &[]*base_ent_wait_empower{}).(*[]*base_ent_wait_empower)
 	return JsonUnmarshal(list, &[]*base_ent_wait_empower{}).(*[]*base_ent_wait_empower)

+ 32 - 1
public/service/power.go

@@ -69,7 +69,7 @@ func CancelPower(appid, goods_code string, goods_spec_id, account_id, ent_accoun
 }
 }
 
 
 /*
 /*
- * 获取待授权详情
+ * 根据功能代码获取待授权详情
  * @param appid
  * @param appid
  * @param function_code 功能代码
  * @param function_code 功能代码
  * @param ent_id 企业id
  * @param ent_id 企业id
@@ -98,6 +98,37 @@ func WaitEmpowerDetail(appid, function_code string, ent_id int64) (*pb.WaitEmpow
 	return result, nil
 	return result, nil
 }
 }
 
 
+/*
+ * 根据商品规格获取待授权详情
+ * @param appid
+ * @param function_code 功能代码
+ * @param ent_id 企业id
+ * @return 待授权详情
+ */
+func WaitEmpowerDetailBySpecId(appid string, spec_id, ent_id int64) (*pb.WaitEmpowerDetailsResp, error) {
+	result := &pb.WaitEmpowerDetailsResp{}
+	if appid == "" {
+		return result, errors.New("无效的参数appid")
+	} else if spec_id == 0 {
+		return result, errors.New("无效的参数spec_id")
+	} else if ent_id == 0 {
+		return result, errors.New("无效的参数ent_id")
+	}
+	bewes := Base_ent_wait_empower.WaitEmpowersBySpecId(appid, spec_id, ent_id)
+	if bewes != nil {
+		for _, v := range *bewes {
+			result.WaitEmpowerDetails = append(result.WaitEmpowerDetails, &pb.WaitEmpowerDetailResp{
+				Id:            v.Id,
+				EmpowerCount:  v.Empower_count,
+				LimitStrategy: v.Limit_strategy,
+				StartTime:     v.Start_time,
+				EndTime:       v.End_time,
+			})
+		}
+	}
+	return result, nil
+}
+
 /*
 /*
  * 获取已有的权益
  * 获取已有的权益
  * @param appid
  * @param appid

+ 34 - 0
rpc/internal/logic/waitempowerdetailbyspecidlogic.go

@@ -0,0 +1,34 @@
+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 WaitEmpowerDetailBySpecIdLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewWaitEmpowerDetailBySpecIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WaitEmpowerDetailBySpecIdLogic {
+	return &WaitEmpowerDetailBySpecIdLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 根据商品规格获取待授权详情
+func (l *WaitEmpowerDetailBySpecIdLogic) WaitEmpowerDetailBySpecId(in *pb.WaitEmpowerDetailBySpecIdReq) (*pb.WaitEmpowerDetailsResp, error) {
+	resp, err := WaitEmpowerDetailBySpecId(in.Appid, in.SpecId, in.EntId)
+	if err != nil {
+		l.Error(fmt.Sprintf("%+v", in), err)
+	}
+	return resp, nil
+}

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

@@ -76,8 +76,14 @@ func (s *ResourceServer) Haspowers(ctx context.Context, in *pb.HaspowersReq) (*p
 	return l.Haspowers(in)
 	return l.Haspowers(in)
 }
 }
 
 
-// 获取待授权详情
+// 根据功能代码获取待授权详情
 func (s *ResourceServer) WaitEmpowerDetail(ctx context.Context, in *pb.WaitEmpowerDetailReq) (*pb.WaitEmpowerDetailResp, error) {
 func (s *ResourceServer) WaitEmpowerDetail(ctx context.Context, in *pb.WaitEmpowerDetailReq) (*pb.WaitEmpowerDetailResp, error) {
 	l := logic.NewWaitEmpowerDetailLogic(ctx, s.svcCtx)
 	l := logic.NewWaitEmpowerDetailLogic(ctx, s.svcCtx)
 	return l.WaitEmpowerDetail(in)
 	return l.WaitEmpowerDetail(in)
 }
 }
+
+// 根据商品规格获取待授权详情
+func (s *ResourceServer) WaitEmpowerDetailBySpecId(ctx context.Context, in *pb.WaitEmpowerDetailBySpecIdReq) (*pb.WaitEmpowerDetailsResp, error) {
+	l := logic.NewWaitEmpowerDetailBySpecIdLogic(ctx, s.svcCtx)
+	return l.WaitEmpowerDetailBySpecId(in)
+}

+ 242 - 85
rpc/pb/resource.pb.go

@@ -864,7 +864,7 @@ type WaitEmpowerDetailReq struct {
 
 
 	Appid        string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
 	Appid        string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
 	FunctionCode string `protobuf:"bytes,2,opt,name=function_code,json=functionCode,proto3" json:"function_code,omitempty"` //功能代码
 	FunctionCode string `protobuf:"bytes,2,opt,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
+	EntId        int64  `protobuf:"varint,3,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                     //企业id
 }
 }
 
 
 func (x *WaitEmpowerDetailReq) Reset() {
 func (x *WaitEmpowerDetailReq) Reset() {
@@ -920,6 +920,116 @@ func (x *WaitEmpowerDetailReq) GetEntId() int64 {
 	return 0
 	return 0
 }
 }
 
 
+type WaitEmpowerDetailBySpecIdReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Appid  string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
+	SpecId int64  `protobuf:"varint,2,opt,name=spec_id,json=specId,proto3" json:"spec_id,omitempty"` //功能代码
+	EntId  int64  `protobuf:"varint,3,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`    //企业id
+}
+
+func (x *WaitEmpowerDetailBySpecIdReq) Reset() {
+	*x = WaitEmpowerDetailBySpecIdReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_resource_proto_msgTypes[12]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *WaitEmpowerDetailBySpecIdReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*WaitEmpowerDetailBySpecIdReq) ProtoMessage() {}
+
+func (x *WaitEmpowerDetailBySpecIdReq) ProtoReflect() protoreflect.Message {
+	mi := &file_resource_proto_msgTypes[12]
+	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 WaitEmpowerDetailBySpecIdReq.ProtoReflect.Descriptor instead.
+func (*WaitEmpowerDetailBySpecIdReq) Descriptor() ([]byte, []int) {
+	return file_resource_proto_rawDescGZIP(), []int{12}
+}
+
+func (x *WaitEmpowerDetailBySpecIdReq) GetAppid() string {
+	if x != nil {
+		return x.Appid
+	}
+	return ""
+}
+
+func (x *WaitEmpowerDetailBySpecIdReq) GetSpecId() int64 {
+	if x != nil {
+		return x.SpecId
+	}
+	return 0
+}
+
+func (x *WaitEmpowerDetailBySpecIdReq) GetEntId() int64 {
+	if x != nil {
+		return x.EntId
+	}
+	return 0
+}
+
+type WaitEmpowerDetailsResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	WaitEmpowerDetails []*WaitEmpowerDetailResp `protobuf:"bytes,1,rep,name=waitEmpowerDetails,proto3" json:"waitEmpowerDetails,omitempty"`
+}
+
+func (x *WaitEmpowerDetailsResp) Reset() {
+	*x = WaitEmpowerDetailsResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_resource_proto_msgTypes[13]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *WaitEmpowerDetailsResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*WaitEmpowerDetailsResp) ProtoMessage() {}
+
+func (x *WaitEmpowerDetailsResp) ProtoReflect() protoreflect.Message {
+	mi := &file_resource_proto_msgTypes[13]
+	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 WaitEmpowerDetailsResp.ProtoReflect.Descriptor instead.
+func (*WaitEmpowerDetailsResp) Descriptor() ([]byte, []int) {
+	return file_resource_proto_rawDescGZIP(), []int{13}
+}
+
+func (x *WaitEmpowerDetailsResp) GetWaitEmpowerDetails() []*WaitEmpowerDetailResp {
+	if x != nil {
+		return x.WaitEmpowerDetails
+	}
+	return nil
+}
+
 type WaitEmpowerDetailResp struct {
 type WaitEmpowerDetailResp struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -936,7 +1046,7 @@ type WaitEmpowerDetailResp struct {
 func (x *WaitEmpowerDetailResp) Reset() {
 func (x *WaitEmpowerDetailResp) Reset() {
 	*x = WaitEmpowerDetailResp{}
 	*x = WaitEmpowerDetailResp{}
 	if protoimpl.UnsafeEnabled {
 	if protoimpl.UnsafeEnabled {
-		mi := &file_resource_proto_msgTypes[12]
+		mi := &file_resource_proto_msgTypes[14]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 		ms.StoreMessageInfo(mi)
 	}
 	}
@@ -949,7 +1059,7 @@ func (x *WaitEmpowerDetailResp) String() string {
 func (*WaitEmpowerDetailResp) ProtoMessage() {}
 func (*WaitEmpowerDetailResp) ProtoMessage() {}
 
 
 func (x *WaitEmpowerDetailResp) ProtoReflect() protoreflect.Message {
 func (x *WaitEmpowerDetailResp) ProtoReflect() protoreflect.Message {
-	mi := &file_resource_proto_msgTypes[12]
+	mi := &file_resource_proto_msgTypes[14]
 	if protoimpl.UnsafeEnabled && x != nil {
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
 		if ms.LoadMessageInfo() == nil {
@@ -962,7 +1072,7 @@ func (x *WaitEmpowerDetailResp) ProtoReflect() protoreflect.Message {
 
 
 // Deprecated: Use WaitEmpowerDetailResp.ProtoReflect.Descriptor instead.
 // Deprecated: Use WaitEmpowerDetailResp.ProtoReflect.Descriptor instead.
 func (*WaitEmpowerDetailResp) Descriptor() ([]byte, []int) {
 func (*WaitEmpowerDetailResp) Descriptor() ([]byte, []int) {
-	return file_resource_proto_rawDescGZIP(), []int{12}
+	return file_resource_proto_rawDescGZIP(), []int{14}
 }
 }
 
 
 func (x *WaitEmpowerDetailResp) GetId() int64 {
 func (x *WaitEmpowerDetailResp) GetId() int64 {
@@ -1118,47 +1228,65 @@ var file_resource_proto_rawDesc = []byte{
 	0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e,
 	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,
 	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,
 	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, 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, 0x03, 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, 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,
-	0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	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, 0xf0, 0x03, 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, 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 (
 var (
@@ -1173,49 +1301,54 @@ func file_resource_proto_rawDescGZIP() []byte {
 	return file_resource_proto_rawDescData
 	return file_resource_proto_rawDescData
 }
 }
 
 
-var file_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
+var file_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
 var file_resource_proto_goTypes = []interface{}{
 var file_resource_proto_goTypes = []interface{}{
-	(*Empower)(nil),               // 0: Empower
-	(*PowerReq)(nil),              // 1: PowerReq
-	(*CheckPowerReq)(nil),         // 2: CheckPowerReq
-	(*DeductionReq)(nil),          // 3: DeductionReq
-	(*RechargeReq)(nil),           // 4: RechargeReq
-	(*EmpowerReq)(nil),            // 5: EmpowerReq
-	(*EmpowerListReq)(nil),        // 6: EmpowerListReq
-	(*EmpowerListResp)(nil),       // 7: EmpowerListResp
-	(*Resp)(nil),                  // 8: Resp
-	(*HaspowersReq)(nil),          // 9: HaspowersReq
-	(*HaspowersResp)(nil),         // 10: HaspowersResp
-	(*WaitEmpowerDetailReq)(nil),  // 11: WaitEmpowerDetailReq
-	(*WaitEmpowerDetailResp)(nil), // 12: WaitEmpowerDetailResp
+	(*Empower)(nil),                      // 0: Empower
+	(*PowerReq)(nil),                     // 1: PowerReq
+	(*CheckPowerReq)(nil),                // 2: CheckPowerReq
+	(*DeductionReq)(nil),                 // 3: DeductionReq
+	(*RechargeReq)(nil),                  // 4: RechargeReq
+	(*EmpowerReq)(nil),                   // 5: EmpowerReq
+	(*EmpowerListReq)(nil),               // 6: EmpowerListReq
+	(*EmpowerListResp)(nil),              // 7: EmpowerListResp
+	(*Resp)(nil),                         // 8: Resp
+	(*HaspowersReq)(nil),                 // 9: HaspowersReq
+	(*HaspowersResp)(nil),                // 10: HaspowersResp
+	(*WaitEmpowerDetailReq)(nil),         // 11: WaitEmpowerDetailReq
+	(*WaitEmpowerDetailBySpecIdReq)(nil), // 12: WaitEmpowerDetailBySpecIdReq
+	(*WaitEmpowerDetailsResp)(nil),       // 13: WaitEmpowerDetailsResp
+	(*WaitEmpowerDetailResp)(nil),        // 14: WaitEmpowerDetailResp
 }
 }
 var file_resource_proto_depIdxs = []int32{
 var file_resource_proto_depIdxs = []int32{
 	0,  // 0: EmpowerListResp.list:type_name -> Empower
 	0,  // 0: EmpowerListResp.list:type_name -> Empower
-	1,  // 1: Resource.PowerHandle:input_type -> PowerReq
-	2,  // 2: Resource.CheckPower:input_type -> CheckPowerReq
-	3,  // 3: Resource.Deduction:input_type -> DeductionReq
-	4,  // 4: Resource.Recharge:input_type -> RechargeReq
-	5,  // 5: Resource.ReEmpower:input_type -> EmpowerReq
-	5,  // 6: Resource.Empower:input_type -> EmpowerReq
-	5,  // 7: Resource.CancelEmpower:input_type -> EmpowerReq
-	6,  // 8: Resource.EmpowerList:input_type -> EmpowerListReq
-	9,  // 9: Resource.Haspowers:input_type -> HaspowersReq
-	11, // 10: Resource.WaitEmpowerDetail:input_type -> WaitEmpowerDetailReq
-	8,  // 11: Resource.PowerHandle:output_type -> Resp
-	8,  // 12: Resource.CheckPower:output_type -> Resp
-	8,  // 13: Resource.Deduction:output_type -> Resp
-	8,  // 14: Resource.Recharge:output_type -> Resp
-	8,  // 15: Resource.ReEmpower:output_type -> Resp
-	8,  // 16: Resource.Empower:output_type -> Resp
-	8,  // 17: Resource.CancelEmpower:output_type -> Resp
-	7,  // 18: Resource.EmpowerList:output_type -> EmpowerListResp
-	10, // 19: Resource.Haspowers:output_type -> HaspowersResp
-	12, // 20: Resource.WaitEmpowerDetail:output_type -> WaitEmpowerDetailResp
-	11, // [11:21] is the sub-list for method output_type
-	1,  // [1:11] is the sub-list for method input_type
-	1,  // [1:1] is the sub-list for extension type_name
-	1,  // [1:1] is the sub-list for extension extendee
-	0,  // [0:1] is the sub-list for field type_name
+	14, // 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.EmpowerList:input_type -> EmpowerListReq
+	9,  // 10: Resource.Haspowers:input_type -> HaspowersReq
+	11, // 11: Resource.WaitEmpowerDetail:input_type -> WaitEmpowerDetailReq
+	12, // 12: Resource.WaitEmpowerDetailBySpecId:input_type -> WaitEmpowerDetailBySpecIdReq
+	8,  // 13: Resource.PowerHandle:output_type -> Resp
+	8,  // 14: Resource.CheckPower:output_type -> Resp
+	8,  // 15: Resource.Deduction:output_type -> Resp
+	8,  // 16: Resource.Recharge:output_type -> Resp
+	8,  // 17: Resource.ReEmpower:output_type -> Resp
+	8,  // 18: Resource.Empower:output_type -> Resp
+	8,  // 19: Resource.CancelEmpower:output_type -> Resp
+	7,  // 20: Resource.EmpowerList:output_type -> EmpowerListResp
+	10, // 21: Resource.Haspowers:output_type -> HaspowersResp
+	14, // 22: Resource.WaitEmpowerDetail:output_type -> WaitEmpowerDetailResp
+	13, // 23: Resource.WaitEmpowerDetailBySpecId:output_type -> WaitEmpowerDetailsResp
+	13, // [13:24] is the sub-list for method output_type
+	2,  // [2:13] 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
 }
 }
 
 
 func init() { file_resource_proto_init() }
 func init() { file_resource_proto_init() }
@@ -1369,6 +1502,30 @@ func file_resource_proto_init() {
 			}
 			}
 		}
 		}
 		file_resource_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
 		file_resource_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*WaitEmpowerDetailBySpecIdReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_resource_proto_msgTypes[13].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[14].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*WaitEmpowerDetailResp); i {
 			switch v := v.(*WaitEmpowerDetailResp); i {
 			case 0:
 			case 0:
 				return &v.state
 				return &v.state
@@ -1387,7 +1544,7 @@ func file_resource_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_resource_proto_rawDesc,
 			RawDescriptor: file_resource_proto_rawDesc,
 			NumEnums:      0,
 			NumEnums:      0,
-			NumMessages:   13,
+			NumMessages:   15,
 			NumExtensions: 0,
 			NumExtensions: 0,
 			NumServices:   1,
 			NumServices:   1,
 		},
 		},

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

@@ -40,8 +40,10 @@ type ResourceClient interface {
 	EmpowerList(ctx context.Context, in *EmpowerListReq, opts ...grpc.CallOption) (*EmpowerListResp, error)
 	EmpowerList(ctx context.Context, in *EmpowerListReq, opts ...grpc.CallOption) (*EmpowerListResp, error)
 	//所有的权益
 	//所有的权益
 	Haspowers(ctx context.Context, in *HaspowersReq, opts ...grpc.CallOption) (*HaspowersResp, error)
 	Haspowers(ctx context.Context, in *HaspowersReq, opts ...grpc.CallOption) (*HaspowersResp, error)
-	//获取待授权详情
+	//根据功能代码获取待授权详情
 	WaitEmpowerDetail(ctx context.Context, in *WaitEmpowerDetailReq, opts ...grpc.CallOption) (*WaitEmpowerDetailResp, error)
 	WaitEmpowerDetail(ctx context.Context, in *WaitEmpowerDetailReq, opts ...grpc.CallOption) (*WaitEmpowerDetailResp, error)
+	//根据商品规格获取待授权详情
+	WaitEmpowerDetailBySpecId(ctx context.Context, in *WaitEmpowerDetailBySpecIdReq, opts ...grpc.CallOption) (*WaitEmpowerDetailsResp, error)
 }
 }
 
 
 type resourceClient struct {
 type resourceClient struct {
@@ -142,6 +144,15 @@ func (c *resourceClient) WaitEmpowerDetail(ctx context.Context, in *WaitEmpowerD
 	return out, nil
 	return out, nil
 }
 }
 
 
+func (c *resourceClient) WaitEmpowerDetailBySpecId(ctx context.Context, in *WaitEmpowerDetailBySpecIdReq, opts ...grpc.CallOption) (*WaitEmpowerDetailsResp, error) {
+	out := new(WaitEmpowerDetailsResp)
+	err := c.cc.Invoke(ctx, "/Resource/WaitEmpowerDetailBySpecId", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // ResourceServer is the server API for Resource service.
 // ResourceServer is the server API for Resource service.
 // All implementations must embed UnimplementedResourceServer
 // All implementations must embed UnimplementedResourceServer
 // for forward compatibility
 // for forward compatibility
@@ -164,8 +175,10 @@ type ResourceServer interface {
 	EmpowerList(context.Context, *EmpowerListReq) (*EmpowerListResp, error)
 	EmpowerList(context.Context, *EmpowerListReq) (*EmpowerListResp, error)
 	//所有的权益
 	//所有的权益
 	Haspowers(context.Context, *HaspowersReq) (*HaspowersResp, error)
 	Haspowers(context.Context, *HaspowersReq) (*HaspowersResp, error)
-	//获取待授权详情
+	//根据功能代码获取待授权详情
 	WaitEmpowerDetail(context.Context, *WaitEmpowerDetailReq) (*WaitEmpowerDetailResp, error)
 	WaitEmpowerDetail(context.Context, *WaitEmpowerDetailReq) (*WaitEmpowerDetailResp, error)
+	//根据商品规格获取待授权详情
+	WaitEmpowerDetailBySpecId(context.Context, *WaitEmpowerDetailBySpecIdReq) (*WaitEmpowerDetailsResp, error)
 	mustEmbedUnimplementedResourceServer()
 	mustEmbedUnimplementedResourceServer()
 }
 }
 
 
@@ -203,6 +216,9 @@ func (UnimplementedResourceServer) Haspowers(context.Context, *HaspowersReq) (*H
 func (UnimplementedResourceServer) WaitEmpowerDetail(context.Context, *WaitEmpowerDetailReq) (*WaitEmpowerDetailResp, error) {
 func (UnimplementedResourceServer) WaitEmpowerDetail(context.Context, *WaitEmpowerDetailReq) (*WaitEmpowerDetailResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method WaitEmpowerDetail not implemented")
 	return nil, status.Errorf(codes.Unimplemented, "method WaitEmpowerDetail not implemented")
 }
 }
+func (UnimplementedResourceServer) WaitEmpowerDetailBySpecId(context.Context, *WaitEmpowerDetailBySpecIdReq) (*WaitEmpowerDetailsResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method WaitEmpowerDetailBySpecId not implemented")
+}
 func (UnimplementedResourceServer) mustEmbedUnimplementedResourceServer() {}
 func (UnimplementedResourceServer) mustEmbedUnimplementedResourceServer() {}
 
 
 // UnsafeResourceServer may be embedded to opt out of forward compatibility for this service.
 // UnsafeResourceServer may be embedded to opt out of forward compatibility for this service.
@@ -396,6 +412,24 @@ func _Resource_WaitEmpowerDetail_Handler(srv interface{}, ctx context.Context, d
 	return interceptor(ctx, in, info, handler)
 	return interceptor(ctx, in, info, handler)
 }
 }
 
 
+func _Resource_WaitEmpowerDetailBySpecId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(WaitEmpowerDetailBySpecIdReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ResourceServer).WaitEmpowerDetailBySpecId(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/Resource/WaitEmpowerDetailBySpecId",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ResourceServer).WaitEmpowerDetailBySpecId(ctx, req.(*WaitEmpowerDetailBySpecIdReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // Resource_ServiceDesc is the grpc.ServiceDesc for Resource service.
 // Resource_ServiceDesc is the grpc.ServiceDesc for Resource service.
 // It's only intended for direct use with grpc.RegisterService,
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
 // and not to be introspected or modified (even as a copy)
@@ -443,6 +477,10 @@ var Resource_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "WaitEmpowerDetail",
 			MethodName: "WaitEmpowerDetail",
 			Handler:    _Resource_WaitEmpowerDetail_Handler,
 			Handler:    _Resource_WaitEmpowerDetail_Handler,
 		},
 		},
+		{
+			MethodName: "WaitEmpowerDetailBySpecId",
+			Handler:    _Resource_WaitEmpowerDetailBySpecId_Handler,
+		},
 	},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "resource.proto",
 	Metadata: "resource.proto",

+ 14 - 2
rpc/resource.proto

@@ -89,7 +89,17 @@ message HaspowersResp {
 message WaitEmpowerDetailReq {
 message WaitEmpowerDetailReq {
   string appid = 1;
   string appid = 1;
   string function_code = 2; //功能代码
   string function_code = 2; //功能代码
-  int64 ent_id = 4;         //企业id
+  int64 ent_id = 3;         //企业id
+}
+
+message WaitEmpowerDetailBySpecIdReq {
+  string appid = 1;
+  int64 spec_id = 2; //功能代码
+  int64 ent_id = 3;         //企业id
+}
+
+message WaitEmpowerDetailsResp {
+  repeated WaitEmpowerDetailResp waitEmpowerDetails = 1;
 }
 }
 
 
 message WaitEmpowerDetailResp {
 message WaitEmpowerDetailResp {
@@ -120,6 +130,8 @@ service Resource {
   rpc EmpowerList(EmpowerListReq) returns(EmpowerListResp);
   rpc EmpowerList(EmpowerListReq) returns(EmpowerListResp);
   //所有的权益
   //所有的权益
   rpc Haspowers(HaspowersReq) returns(HaspowersResp);
   rpc Haspowers(HaspowersReq) returns(HaspowersResp);
-  //获取待授权详情
+  //根据功能代码获取待授权详情
   rpc WaitEmpowerDetail(WaitEmpowerDetailReq) returns(WaitEmpowerDetailResp);
   rpc WaitEmpowerDetail(WaitEmpowerDetailReq) returns(WaitEmpowerDetailResp);
+  //根据商品规格获取待授权详情
+  rpc WaitEmpowerDetailBySpecId(WaitEmpowerDetailBySpecIdReq) returns(WaitEmpowerDetailsResp);
 }
 }

+ 25 - 15
rpc/resource/resource.go

@@ -13,19 +13,21 @@ import (
 )
 )
 
 
 type (
 type (
-	CheckPowerReq         = pb.CheckPowerReq
-	DeductionReq          = pb.DeductionReq
-	Empower               = pb.Empower
-	EmpowerListReq        = pb.EmpowerListReq
-	EmpowerListResp       = pb.EmpowerListResp
-	EmpowerReq            = pb.EmpowerReq
-	HaspowersReq          = pb.HaspowersReq
-	HaspowersResp         = pb.HaspowersResp
-	PowerReq              = pb.PowerReq
-	RechargeReq           = pb.RechargeReq
-	Resp                  = pb.Resp
-	WaitEmpowerDetailReq  = pb.WaitEmpowerDetailReq
-	WaitEmpowerDetailResp = pb.WaitEmpowerDetailResp
+	CheckPowerReq                = pb.CheckPowerReq
+	DeductionReq                 = pb.DeductionReq
+	Empower                      = pb.Empower
+	EmpowerListReq               = pb.EmpowerListReq
+	EmpowerListResp              = pb.EmpowerListResp
+	EmpowerReq                   = pb.EmpowerReq
+	HaspowersReq                 = pb.HaspowersReq
+	HaspowersResp                = pb.HaspowersResp
+	PowerReq                     = pb.PowerReq
+	RechargeReq                  = pb.RechargeReq
+	Resp                         = pb.Resp
+	WaitEmpowerDetailBySpecIdReq = pb.WaitEmpowerDetailBySpecIdReq
+	WaitEmpowerDetailReq         = pb.WaitEmpowerDetailReq
+	WaitEmpowerDetailResp        = pb.WaitEmpowerDetailResp
+	WaitEmpowerDetailsResp       = pb.WaitEmpowerDetailsResp
 
 
 	Resource interface {
 	Resource interface {
 		// 开通或者取消用户/企业权益
 		// 开通或者取消用户/企业权益
@@ -46,8 +48,10 @@ type (
 		EmpowerList(ctx context.Context, in *EmpowerListReq, opts ...grpc.CallOption) (*EmpowerListResp, error)
 		EmpowerList(ctx context.Context, in *EmpowerListReq, opts ...grpc.CallOption) (*EmpowerListResp, error)
 		// 所有的权益
 		// 所有的权益
 		Haspowers(ctx context.Context, in *HaspowersReq, opts ...grpc.CallOption) (*HaspowersResp, error)
 		Haspowers(ctx context.Context, in *HaspowersReq, opts ...grpc.CallOption) (*HaspowersResp, error)
-		// 获取待授权详情
+		// 根据功能代码获取待授权详情
 		WaitEmpowerDetail(ctx context.Context, in *WaitEmpowerDetailReq, opts ...grpc.CallOption) (*WaitEmpowerDetailResp, error)
 		WaitEmpowerDetail(ctx context.Context, in *WaitEmpowerDetailReq, opts ...grpc.CallOption) (*WaitEmpowerDetailResp, error)
+		// 根据商品规格获取待授权详情
+		WaitEmpowerDetailBySpecId(ctx context.Context, in *WaitEmpowerDetailBySpecIdReq, opts ...grpc.CallOption) (*WaitEmpowerDetailsResp, error)
 	}
 	}
 
 
 	defaultResource struct {
 	defaultResource struct {
@@ -115,8 +119,14 @@ func (m *defaultResource) Haspowers(ctx context.Context, in *HaspowersReq, opts
 	return client.Haspowers(ctx, in, opts...)
 	return client.Haspowers(ctx, in, opts...)
 }
 }
 
 
-// 获取待授权详情
+// 根据功能代码获取待授权详情
 func (m *defaultResource) WaitEmpowerDetail(ctx context.Context, in *WaitEmpowerDetailReq, opts ...grpc.CallOption) (*WaitEmpowerDetailResp, error) {
 func (m *defaultResource) WaitEmpowerDetail(ctx context.Context, in *WaitEmpowerDetailReq, opts ...grpc.CallOption) (*WaitEmpowerDetailResp, error) {
 	client := pb.NewResourceClient(m.cli.Conn())
 	client := pb.NewResourceClient(m.cli.Conn())
 	return client.WaitEmpowerDetail(ctx, in, opts...)
 	return client.WaitEmpowerDetail(ctx, in, opts...)
 }
 }
+
+// 根据商品规格获取待授权详情
+func (m *defaultResource) WaitEmpowerDetailBySpecId(ctx context.Context, in *WaitEmpowerDetailBySpecIdReq, opts ...grpc.CallOption) (*WaitEmpowerDetailsResp, error) {
+	client := pb.NewResourceClient(m.cli.Conn())
+	return client.WaitEmpowerDetailBySpecId(ctx, in, opts...)
+}