xuzhiheng vor 4 Jahren
Ursprung
Commit
387730363b

+ 7 - 1
rpc/filesystem.proto

@@ -32,7 +32,7 @@ message UpdateFileMetaReq{
 //
 message LoadFileReq{
   string domain = 1;//存入哪个buckets
-  string fileId = 2;
+  string fileId = 2;//objectName
 }
 //
 message LoadFileResp{
@@ -44,6 +44,10 @@ message LoadFileMetaResp{
   map<string, string> meta = 2;//元数据
 }
 
+message OssUrlResp{
+  string ossUrl = 1;
+}
+
 service FileSystem {
   //创建域
   rpc CreateDomain(DomainReq) returns(DomainResp);
@@ -61,4 +65,6 @@ service FileSystem {
   rpc GetFile(LoadFileReq)returns(LoadFileResp);
   //获取文件元数据
   rpc GetFileMeta(LoadFileReq)returns(LoadFileMetaResp);
+  //获取签名OSSURL
+  rpc GetOssUril(LoadFileReq)returns(OssUrlResp);
 }

+ 161 - 54
rpc/filesystem/filesystem.pb.go

@@ -491,6 +491,53 @@ func (x *LoadFileMetaResp) GetMeta() map[string]string {
 	return nil
 }
 
+type OssUrlResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	OssUrl string `protobuf:"bytes,1,opt,name=ossUrl,proto3" json:"ossUrl,omitempty"`
+}
+
+func (x *OssUrlResp) Reset() {
+	*x = OssUrlResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_filesystem_proto_msgTypes[8]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *OssUrlResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*OssUrlResp) ProtoMessage() {}
+
+func (x *OssUrlResp) ProtoReflect() protoreflect.Message {
+	mi := &file_filesystem_proto_msgTypes[8]
+	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 OssUrlResp.ProtoReflect.Descriptor instead.
+func (*OssUrlResp) Descriptor() ([]byte, []int) {
+	return file_filesystem_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *OssUrlResp) GetOssUrl() string {
+	if x != nil {
+		return x.OssUrl
+	}
+	return ""
+}
+
 var File_filesystem_proto protoreflect.FileDescriptor
 
 var file_filesystem_proto_rawDesc = []byte{
@@ -555,41 +602,48 @@ var file_filesystem_proto_rawDesc = []byte{
 	0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74,
 	0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
 	0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x96,
-	0x04, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x3d, 0x0a,
-	0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x15, 0x2e,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x24,
+	0x0a, 0x0a, 0x4f, 0x73, 0x73, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06,
+	0x6f, 0x73, 0x73, 0x55, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x73,
+	0x73, 0x55, 0x72, 0x6c, 0x32, 0xd5, 0x04, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x79, 0x73,
+	0x74, 0x65, 0x6d, 0x12, 0x3d, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d,
+	0x61, 0x69, 0x6e, 0x12, 0x15, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d,
+	0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69, 0x6c,
+	0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65,
+	0x73, 0x70, 0x12, 0x41, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61,
+	0x69, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x15, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73,
+	0x74, 0x65, 0x6d, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e,
 	0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69,
-	0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65,
-	0x6d, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x41, 0x0a, 0x10,
-	0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4d, 0x65, 0x74, 0x61,
-	0x12, 0x15, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x6f,
-	0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79,
-	0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x3d, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12,
-	0x15, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x6f, 0x6d,
-	0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73,
-	0x74, 0x65, 0x6d, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3b,
-	0x0a, 0x08, 0x53, 0x61, 0x76, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x66, 0x69, 0x6c,
-	0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x46, 0x69, 0x6c, 0x65,
-	0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d,
-	0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x47, 0x0a, 0x0e, 0x55,
-	0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x1d, 0x2e,
-	0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
-	0x65, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66,
-	0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69,
-	0x6c, 0x65, 0x12, 0x17, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e,
-	0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69,
-	0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x52,
-	0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x17,
-	0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f, 0x61, 0x64,
-	0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79,
-	0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73,
-	0x70, 0x12, 0x44, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61,
-	0x12, 0x17, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f,
-	0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x66, 0x69, 0x6c, 0x65,
-	0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x4d,
-	0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3d, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44,
+	0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x15, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74,
+	0x65, 0x6d, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66,
+	0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x3b, 0x0a, 0x08, 0x53, 0x61, 0x76, 0x65, 0x46, 0x69, 0x6c, 0x65,
+	0x12, 0x17, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x61,
+	0x76, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69, 0x6c, 0x65,
+	0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x47, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x4d,
+	0x65, 0x74, 0x61, 0x12, 0x1d, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d,
+	0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52,
+	0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e,
+	0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65,
+	0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73,
+	0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65,
+	0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x46,
+	0x69, 0x6c, 0x65, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74,
+	0x46, 0x69, 0x6c, 0x65, 0x12, 0x17, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65,
+	0x6d, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e,
+	0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x46,
+	0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x46, 0x69,
+	0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x17, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73,
+	0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a,
+	0x1c, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f, 0x61,
+	0x64, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3d, 0x0a,
+	0x0a, 0x47, 0x65, 0x74, 0x4f, 0x73, 0x73, 0x55, 0x72, 0x69, 0x6c, 0x12, 0x17, 0x2e, 0x66, 0x69,
+	0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c,
+	0x65, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65,
+	0x6d, 0x2e, 0x4f, 0x73, 0x73, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x62, 0x06, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -604,7 +658,7 @@ func file_filesystem_proto_rawDescGZIP() []byte {
 	return file_filesystem_proto_rawDescData
 }
 
-var file_filesystem_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
+var file_filesystem_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
 var file_filesystem_proto_goTypes = []interface{}{
 	(*DomainReq)(nil),         // 0: filesystem.DomainReq
 	(*DomainResp)(nil),        // 1: filesystem.DomainResp
@@ -614,16 +668,17 @@ var file_filesystem_proto_goTypes = []interface{}{
 	(*LoadFileReq)(nil),       // 5: filesystem.LoadFileReq
 	(*LoadFileResp)(nil),      // 6: filesystem.LoadFileResp
 	(*LoadFileMetaResp)(nil),  // 7: filesystem.LoadFileMetaResp
-	nil,                       // 8: filesystem.SaveFileReq.MetaEntry
-	nil,                       // 9: filesystem.UpdateFileMetaReq.MetaEntry
-	nil,                       // 10: filesystem.LoadFileResp.MetaEntry
-	nil,                       // 11: filesystem.LoadFileMetaResp.MetaEntry
+	(*OssUrlResp)(nil),        // 8: filesystem.OssUrlResp
+	nil,                       // 9: filesystem.SaveFileReq.MetaEntry
+	nil,                       // 10: filesystem.UpdateFileMetaReq.MetaEntry
+	nil,                       // 11: filesystem.LoadFileResp.MetaEntry
+	nil,                       // 12: filesystem.LoadFileMetaResp.MetaEntry
 }
 var file_filesystem_proto_depIdxs = []int32{
-	8,  // 0: filesystem.SaveFileReq.meta:type_name -> filesystem.SaveFileReq.MetaEntry
-	9,  // 1: filesystem.UpdateFileMetaReq.meta:type_name -> filesystem.UpdateFileMetaReq.MetaEntry
-	10, // 2: filesystem.LoadFileResp.meta:type_name -> filesystem.LoadFileResp.MetaEntry
-	11, // 3: filesystem.LoadFileMetaResp.meta:type_name -> filesystem.LoadFileMetaResp.MetaEntry
+	9,  // 0: filesystem.SaveFileReq.meta:type_name -> filesystem.SaveFileReq.MetaEntry
+	10, // 1: filesystem.UpdateFileMetaReq.meta:type_name -> filesystem.UpdateFileMetaReq.MetaEntry
+	11, // 2: filesystem.LoadFileResp.meta:type_name -> filesystem.LoadFileResp.MetaEntry
+	12, // 3: filesystem.LoadFileMetaResp.meta:type_name -> filesystem.LoadFileMetaResp.MetaEntry
 	0,  // 4: filesystem.FileSystem.CreateDomain:input_type -> filesystem.DomainReq
 	0,  // 5: filesystem.FileSystem.UpdateDomainMeta:input_type -> filesystem.DomainReq
 	0,  // 6: filesystem.FileSystem.DeleteDomain:input_type -> filesystem.DomainReq
@@ -632,16 +687,18 @@ var file_filesystem_proto_depIdxs = []int32{
 	5,  // 9: filesystem.FileSystem.DeleteFile:input_type -> filesystem.LoadFileReq
 	5,  // 10: filesystem.FileSystem.GetFile:input_type -> filesystem.LoadFileReq
 	5,  // 11: filesystem.FileSystem.GetFileMeta:input_type -> filesystem.LoadFileReq
-	1,  // 12: filesystem.FileSystem.CreateDomain:output_type -> filesystem.DomainResp
-	1,  // 13: filesystem.FileSystem.UpdateDomainMeta:output_type -> filesystem.DomainResp
-	1,  // 14: filesystem.FileSystem.DeleteDomain:output_type -> filesystem.DomainResp
-	3,  // 15: filesystem.FileSystem.SaveFile:output_type -> filesystem.FileOpResp
-	3,  // 16: filesystem.FileSystem.UpdateFileMeta:output_type -> filesystem.FileOpResp
-	3,  // 17: filesystem.FileSystem.DeleteFile:output_type -> filesystem.FileOpResp
-	6,  // 18: filesystem.FileSystem.GetFile:output_type -> filesystem.LoadFileResp
-	7,  // 19: filesystem.FileSystem.GetFileMeta:output_type -> filesystem.LoadFileMetaResp
-	12, // [12:20] is the sub-list for method output_type
-	4,  // [4:12] is the sub-list for method input_type
+	5,  // 12: filesystem.FileSystem.GetOssUril:input_type -> filesystem.LoadFileReq
+	1,  // 13: filesystem.FileSystem.CreateDomain:output_type -> filesystem.DomainResp
+	1,  // 14: filesystem.FileSystem.UpdateDomainMeta:output_type -> filesystem.DomainResp
+	1,  // 15: filesystem.FileSystem.DeleteDomain:output_type -> filesystem.DomainResp
+	3,  // 16: filesystem.FileSystem.SaveFile:output_type -> filesystem.FileOpResp
+	3,  // 17: filesystem.FileSystem.UpdateFileMeta:output_type -> filesystem.FileOpResp
+	3,  // 18: filesystem.FileSystem.DeleteFile:output_type -> filesystem.FileOpResp
+	6,  // 19: filesystem.FileSystem.GetFile:output_type -> filesystem.LoadFileResp
+	7,  // 20: filesystem.FileSystem.GetFileMeta:output_type -> filesystem.LoadFileMetaResp
+	8,  // 21: filesystem.FileSystem.GetOssUril:output_type -> filesystem.OssUrlResp
+	13, // [13:22] is the sub-list for method output_type
+	4,  // [4:13] is the sub-list for method input_type
 	4,  // [4:4] is the sub-list for extension type_name
 	4,  // [4:4] is the sub-list for extension extendee
 	0,  // [0:4] is the sub-list for field type_name
@@ -749,6 +806,18 @@ func file_filesystem_proto_init() {
 				return nil
 			}
 		}
+		file_filesystem_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*OssUrlResp); 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{
@@ -756,7 +825,7 @@ func file_filesystem_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_filesystem_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   12,
+			NumMessages:   13,
 			NumExtensions: 0,
 			NumServices:   1,
 		},
@@ -798,6 +867,8 @@ type FileSystemClient interface {
 	GetFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileResp, error)
 	//获取文件元数据
 	GetFileMeta(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileMetaResp, error)
+	//获取签名OSSURL
+	GetOssUril(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*OssUrlResp, error)
 }
 
 type fileSystemClient struct {
@@ -880,6 +951,15 @@ func (c *fileSystemClient) GetFileMeta(ctx context.Context, in *LoadFileReq, opt
 	return out, nil
 }
 
+func (c *fileSystemClient) GetOssUril(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*OssUrlResp, error) {
+	out := new(OssUrlResp)
+	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/GetOssUril", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // FileSystemServer is the server API for FileSystem service.
 type FileSystemServer interface {
 	//创建域
@@ -898,6 +978,8 @@ type FileSystemServer interface {
 	GetFile(context.Context, *LoadFileReq) (*LoadFileResp, error)
 	//获取文件元数据
 	GetFileMeta(context.Context, *LoadFileReq) (*LoadFileMetaResp, error)
+	//获取签名OSSURL
+	GetOssUril(context.Context, *LoadFileReq) (*OssUrlResp, error)
 }
 
 // UnimplementedFileSystemServer can be embedded to have forward compatible implementations.
@@ -928,6 +1010,9 @@ func (*UnimplementedFileSystemServer) GetFile(context.Context, *LoadFileReq) (*L
 func (*UnimplementedFileSystemServer) GetFileMeta(context.Context, *LoadFileReq) (*LoadFileMetaResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetFileMeta not implemented")
 }
+func (*UnimplementedFileSystemServer) GetOssUril(context.Context, *LoadFileReq) (*OssUrlResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetOssUril not implemented")
+}
 
 func RegisterFileSystemServer(s *grpc.Server, srv FileSystemServer) {
 	s.RegisterService(&_FileSystem_serviceDesc, srv)
@@ -1077,6 +1162,24 @@ func _FileSystem_GetFileMeta_Handler(srv interface{}, ctx context.Context, dec f
 	return interceptor(ctx, in, info, handler)
 }
 
+func _FileSystem_GetOssUril_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(LoadFileReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(FileSystemServer).GetOssUril(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/filesystem.FileSystem/GetOssUril",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(FileSystemServer).GetOssUril(ctx, req.(*LoadFileReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 var _FileSystem_serviceDesc = grpc.ServiceDesc{
 	ServiceName: "filesystem.FileSystem",
 	HandlerType: (*FileSystemServer)(nil),
@@ -1113,6 +1216,10 @@ var _FileSystem_serviceDesc = grpc.ServiceDesc{
 			MethodName: "GetFileMeta",
 			Handler:    _FileSystem_GetFileMeta_Handler,
 		},
+		{
+			MethodName: "GetOssUril",
+			Handler:    _FileSystem_GetOssUril_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "filesystem.proto",

+ 12 - 3
rpc/filesystemclient/filesystem.go

@@ -14,14 +14,15 @@ import (
 )
 
 type (
+	UpdateFileMetaReq = filesystem.UpdateFileMetaReq
 	LoadFileReq       = filesystem.LoadFileReq
 	LoadFileResp      = filesystem.LoadFileResp
+	SaveFileReq       = filesystem.SaveFileReq
+	FileOpResp        = filesystem.FileOpResp
 	LoadFileMetaResp  = filesystem.LoadFileMetaResp
+	OssUrlResp        = filesystem.OssUrlResp
 	DomainReq         = filesystem.DomainReq
 	DomainResp        = filesystem.DomainResp
-	SaveFileReq       = filesystem.SaveFileReq
-	FileOpResp        = filesystem.FileOpResp
-	UpdateFileMetaReq = filesystem.UpdateFileMetaReq
 
 	FileSystem interface {
 		// 创建域
@@ -40,6 +41,8 @@ type (
 		GetFile(ctx context.Context, in *LoadFileReq) (*LoadFileResp, error)
 		// 获取文件元数据
 		GetFileMeta(ctx context.Context, in *LoadFileReq) (*LoadFileMetaResp, error)
+		// 获取签名OSSURL
+		GetOssUril(ctx context.Context, in *LoadFileReq) (*OssUrlResp, error)
 	}
 
 	defaultFileSystem struct {
@@ -100,3 +103,9 @@ func (m *defaultFileSystem) GetFileMeta(ctx context.Context, in *LoadFileReq) (*
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
 	return client.GetFileMeta(ctx, in)
 }
+
+// 获取签名OSSURL
+func (m *defaultFileSystem) GetOssUril(ctx context.Context, in *LoadFileReq) (*OssUrlResp, error) {
+	client := filesystem.NewFileSystemClient(m.cli.Conn())
+	return client.GetOssUril(ctx, in)
+}

+ 40 - 0
rpc/internal/logic/getossurillogic.go

@@ -0,0 +1,40 @@
+package logic
+
+import (
+	"context"
+	"log"
+
+	"app.yhyue.com/moapp/jyfs/rpc/filesystem"
+	"app.yhyue.com/moapp/jyfs/rpc/internal/svc"
+	"github.com/aliyun/aliyun-oss-go-sdk/oss"
+	"github.com/tal-tech/go-zero/core/logx"
+)
+
+type GetOssUrilLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetOssUrilLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetOssUrilLogic {
+	return &GetOssUrilLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 获取签名OSSURL
+func (l *GetOssUrilLogic) GetOssUril(in *filesystem.LoadFileReq) (*filesystem.OssUrlResp, error) {
+	// todo: add your logic here and delete this line
+	bucket, err := l.svcCtx.OssClient.Bucket(in.Domain)
+	if err != nil {
+		return &filesystem.OssUrlResp{OssUrl: ""}, err
+	}
+	ossUrl, err := bucket.SignURL(in.FileId, oss.HTTPGet, 3600)
+	if err != nil {
+		return &filesystem.OssUrlResp{OssUrl: ""}, err
+	}
+	log.Println(ossUrl)
+	return &filesystem.OssUrlResp{OssUrl: ossUrl}, nil
+}

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

@@ -68,3 +68,9 @@ func (s *FileSystemServer) GetFileMeta(ctx context.Context, in *filesystem.LoadF
 	l := logic.NewGetFileMetaLogic(ctx, s.svcCtx)
 	return l.GetFileMeta(in)
 }
+
+// 获取签名OSSURL
+func (s *FileSystemServer) GetOssUril(ctx context.Context, in *filesystem.LoadFileReq) (*filesystem.OssUrlResp, error) {
+	l := logic.NewGetOssUrilLogic(ctx, s.svcCtx)
+	return l.GetOssUril(in)
+}