wangchuanjin 1 жил өмнө
parent
commit
89a687b9c0

+ 1 - 0
public/service/power.go

@@ -87,6 +87,7 @@ func WaitEmpowerDetail(appid, function_code string, ent_id int64) (*pb.WaitEmpow
 	bewes := Base_ent_wait_empower.WaitEmpowers(appid, function_code, ent_id)
 	if bewes != nil {
 		for _, v := range *bewes {
+			result.Id = v.Id
 			result.EmpowerCount = v.Empower_count
 			result.LimitStrategy = v.Limit_strategy
 			result.StartTime = v.Start_time

+ 7 - 4
rpc/internal/logic/waitempowerdetaillogic.go

@@ -2,10 +2,11 @@ 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"
 )
 
@@ -25,7 +26,9 @@ func NewWaitEmpowerDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 
 // 获取待授权详情
 func (l *WaitEmpowerDetailLogic) WaitEmpowerDetail(in *pb.WaitEmpowerDetailReq) (*pb.WaitEmpowerDetailResp, error) {
-	// todo: add your logic here and delete this line
-
-	return &pb.WaitEmpowerDetailResp{}, nil
+	resp, err := WaitEmpowerDetail(in.Appid, in.FunctionCode, in.EntId)
+	if err != nil {
+		l.Error(fmt.Sprintf("%+v", in), err)
+	}
+	return resp, nil
 }

+ 20 - 11
rpc/pb/resource.pb.go

@@ -925,11 +925,12 @@ type WaitEmpowerDetailResp struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	StartTime     string `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`             //开始时间
-	EndTime       string `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`                   //结束时间
-	EmpowerCount  int64  `protobuf:"varint,3,opt,name=empower_count,json=empowerCount,proto3" json:"empower_count,omitempty"`   //授权数量
-	UseCount      int64  `protobuf:"varint,4,opt,name=use_count,json=useCount,proto3" json:"use_count,omitempty"`               //使用数量
-	LimitStrategy string `protobuf:"bytes,5,opt,name=limit_strategy,json=limitStrategy,proto3" json:"limit_strategy,omitempty"` //频率限制
+	Id            int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`                                           //id
+	StartTime     string `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`             //开始时间
+	EndTime       string `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`                   //结束时间
+	EmpowerCount  int64  `protobuf:"varint,4,opt,name=empower_count,json=empowerCount,proto3" json:"empower_count,omitempty"`   //授权数量
+	UseCount      int64  `protobuf:"varint,5,opt,name=use_count,json=useCount,proto3" json:"use_count,omitempty"`               //使用数量
+	LimitStrategy string `protobuf:"bytes,6,opt,name=limit_strategy,json=limitStrategy,proto3" json:"limit_strategy,omitempty"` //频率限制
 }
 
 func (x *WaitEmpowerDetailResp) Reset() {
@@ -964,6 +965,13 @@ func (*WaitEmpowerDetailResp) Descriptor() ([]byte, []int) {
 	return file_resource_proto_rawDescGZIP(), []int{12}
 }
 
+func (x *WaitEmpowerDetailResp) GetId() int64 {
+	if x != nil {
+		return x.Id
+	}
+	return 0
+}
+
 func (x *WaitEmpowerDetailResp) GetStartTime() string {
 	if x != nil {
 		return x.StartTime
@@ -1111,17 +1119,18 @@ var file_resource_proto_rawDesc = []byte{
 	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
 	0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15,
 	0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
-	0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xba, 0x01, 0x0a, 0x15, 0x57, 0x61, 0x69, 0x74, 0x45, 0x6d,
+	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,
-	0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20,
+	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, 0x02, 0x20, 0x01, 0x28, 0x09,
+	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, 0x03, 0x20, 0x01, 0x28, 0x03,
+	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, 0x04, 0x20, 0x01, 0x28,
+	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, 0x05, 0x20,
+	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,

+ 6 - 5
rpc/resource.proto

@@ -93,11 +93,12 @@ message WaitEmpowerDetailReq {
 }
 
 message WaitEmpowerDetailResp {
-  string start_time = 1;      //开始时间
-  string end_time = 2;        //结束时间
-  int64 empower_count = 3;    //授权数量
-  int64 use_count = 4;        //使用数量
-  string limit_strategy = 5;  //频率限制
+  int64 id = 1;               //id
+  string start_time = 2;      //开始时间
+  string end_time = 3;        //结束时间
+  int64 empower_count = 4;    //授权数量
+  int64 use_count = 5;        //使用数量
+  string limit_strategy = 6;  //频率限制
 }
 
 service Resource {