Browse Source

Merge branch 'feature/v1.0.1_ws' of moapp/jyfs into feature/v1.0.1

wangshan 1 year ago
parent
commit
f330ca6510

+ 3 - 0
README.md

@@ -1,3 +1,6 @@
 # 剑鱼文件系统
 ## 说明
 对阿里云OSS进行封装;对外提供统一文件操作服务。
+
+
+#### goctl rpc protoc filesystem.proto --go_out=. --go-grpc_out=. --zrpc_out=.

+ 1 - 1
rpc/etc/filesystem.yaml

@@ -19,4 +19,4 @@ FileSystemConf:
 RedisAddress: "jyfs=192.168.3.149:1712"
 FileSize: 41943040
 ContentType:
-  txt: utf-8
+  txt: "GB 2312"

+ 2 - 1
rpc/filesystem.proto

@@ -1,6 +1,6 @@
 syntax = "proto3";
-
 package filesystem;
+option go_package = "./filesystem";
 
 message DomainReq {
   string name = 1;
@@ -16,6 +16,7 @@ message SaveFileReq {
   string fileId = 2;
   map<string, string> meta = 3;//元数据
   bytes rawFileContent = 4;//文件内容
+  string source = 5;//文件来源
 }
 //
 message FileOpResp {

+ 97 - 482
rpc/filesystem/filesystem.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.28.0
+// 	protoc        v3.15.5
 // source: filesystem.proto
 
 package filesystem
 
 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 DomainReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -141,6 +132,7 @@ type SaveFileReq struct {
 	FileId         string            `protobuf:"bytes,2,opt,name=fileId,proto3" json:"fileId,omitempty"`
 	Meta           map[string]string `protobuf:"bytes,3,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //元数据
 	RawFileContent []byte            `protobuf:"bytes,4,opt,name=rawFileContent,proto3" json:"rawFileContent,omitempty"`                                                                     //文件内容
+	Source         string            `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"`                                                                                     //文件来源
 }
 
 func (x *SaveFileReq) Reset() {
@@ -203,6 +195,13 @@ func (x *SaveFileReq) GetRawFileContent() []byte {
 	return nil
 }
 
+func (x *SaveFileReq) GetSource() string {
+	if x != nil {
+		return x.Source
+	}
+	return ""
+}
+
 //
 type FileOpResp struct {
 	state         protoimpl.MessageState
@@ -338,7 +337,7 @@ type LoadFileReq struct {
 	unknownFields protoimpl.UnknownFields
 
 	Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` //存入哪个buckets
-	FileId string `protobuf:"bytes,2,opt,name=fileId,proto3" json:"fileId,omitempty"`
+	FileId string `protobuf:"bytes,2,opt,name=fileId,proto3" json:"fileId,omitempty"` //objectName
 }
 
 func (x *LoadFileReq) Reset() {
@@ -549,7 +548,7 @@ var file_filesystem_proto_rawDesc = []byte{
 	0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22,
 	0x22, 0x0a, 0x0a, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a,
 	0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74,
-	0x61, 0x74, 0x65, 0x22, 0xd5, 0x01, 0x0a, 0x0b, 0x53, 0x61, 0x76, 0x65, 0x46, 0x69, 0x6c, 0x65,
+	0x61, 0x74, 0x65, 0x22, 0xed, 0x01, 0x0a, 0x0b, 0x53, 0x61, 0x76, 0x65, 0x46, 0x69, 0x6c, 0x65,
 	0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20,
 	0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66,
 	0x69, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c,
@@ -559,91 +558,93 @@ var file_filesystem_proto_rawDesc = []byte{
 	0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x61,
 	0x77, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01,
 	0x28, 0x0c, 0x52, 0x0e, 0x72, 0x61, 0x77, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65,
-	0x6e, 0x74, 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, 0x22, 0x52, 0x0a, 0x0a, 0x46,
-	0x69, 0x6c, 0x65, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61,
-	0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12,
-	0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49,
-	0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x22,
-	0xb9, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65,
-	0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a,
-	0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66,
-	0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20,
-	0x03, 0x28, 0x0b, 0x32, 0x27, 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, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 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, 0x22, 0x3d, 0x0a, 0x0b, 0x4c,
-	0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f,
-	0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61,
-	0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x22, 0xa7, 0x01, 0x0a, 0x0c, 0x4c,
-	0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x04, 0x6d,
-	0x65, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x69, 0x6c, 0x65,
-	0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52,
-	0x65, 0x73, 0x70, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d,
-	0x65, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x61, 0x77, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f,
-	0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x72, 0x61, 0x77,
-	0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 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, 0x22, 0x87, 0x01, 0x0a, 0x10, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c,
-	0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x04, 0x6d, 0x65, 0x74,
-	0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 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, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
-	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, 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, 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,
+	0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 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, 0x22, 0x52, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
+	0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69,
+	0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12,
+	0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x22, 0xb9, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61,
+	0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a,
+	0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
+	0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a,
+	0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 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, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45,
+	0x6e, 0x74, 0x72, 0x79, 0x52, 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, 0x22, 0x3d, 0x0a, 0x0b, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52,
+	0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69,
+	0x6c, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65,
+	0x49, 0x64, 0x22, 0xa7, 0x01, 0x0a, 0x0c, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52,
+	0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28,
+	0x0b, 0x32, 0x22, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x4c,
+	0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x4d, 0x65, 0x74, 0x61,
+	0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x26, 0x0a, 0x0e, 0x72,
+	0x61, 0x77, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x0c, 0x52, 0x0e, 0x72, 0x61, 0x77, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74,
+	0x65, 0x6e, 0x74, 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, 0x22, 0x87, 0x01, 0x0a,
+	0x10, 0x4c, 0x6f, 0x61, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x3a, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
+	0x26, 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, 0x2e, 0x4d, 0x65,
+	0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 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, 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,
-	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,
+	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, 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,
+	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, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79,
+	0x73, 0x74, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -838,389 +839,3 @@ func file_filesystem_proto_init() {
 	file_filesystem_proto_goTypes = nil
 	file_filesystem_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
-
-// FileSystemClient is the client API for FileSystem service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type FileSystemClient interface {
-	//创建域
-	CreateDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error)
-	//更新域
-	UpdateDomainMeta(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error)
-	//删除域
-	DeleteDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error)
-	//保存文件
-	SaveFile(ctx context.Context, in *SaveFileReq, opts ...grpc.CallOption) (*FileOpResp, error)
-	//更新文件元数据
-	UpdateFileMeta(ctx context.Context, in *UpdateFileMetaReq, opts ...grpc.CallOption) (*FileOpResp, error)
-	//删除文件
-	DeleteFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*FileOpResp, error)
-	//获取文件
-	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 {
-	cc grpc.ClientConnInterface
-}
-
-func NewFileSystemClient(cc grpc.ClientConnInterface) FileSystemClient {
-	return &fileSystemClient{cc}
-}
-
-func (c *fileSystemClient) CreateDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error) {
-	out := new(DomainResp)
-	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/CreateDomain", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *fileSystemClient) UpdateDomainMeta(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error) {
-	out := new(DomainResp)
-	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/UpdateDomainMeta", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *fileSystemClient) DeleteDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error) {
-	out := new(DomainResp)
-	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/DeleteDomain", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *fileSystemClient) SaveFile(ctx context.Context, in *SaveFileReq, opts ...grpc.CallOption) (*FileOpResp, error) {
-	out := new(FileOpResp)
-	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/SaveFile", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *fileSystemClient) UpdateFileMeta(ctx context.Context, in *UpdateFileMetaReq, opts ...grpc.CallOption) (*FileOpResp, error) {
-	out := new(FileOpResp)
-	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/UpdateFileMeta", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *fileSystemClient) DeleteFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*FileOpResp, error) {
-	out := new(FileOpResp)
-	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/DeleteFile", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *fileSystemClient) GetFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileResp, error) {
-	out := new(LoadFileResp)
-	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/GetFile", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *fileSystemClient) GetFileMeta(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileMetaResp, error) {
-	out := new(LoadFileMetaResp)
-	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/GetFileMeta", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	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 {
-	//创建域
-	CreateDomain(context.Context, *DomainReq) (*DomainResp, error)
-	//更新域
-	UpdateDomainMeta(context.Context, *DomainReq) (*DomainResp, error)
-	//删除域
-	DeleteDomain(context.Context, *DomainReq) (*DomainResp, error)
-	//保存文件
-	SaveFile(context.Context, *SaveFileReq) (*FileOpResp, error)
-	//更新文件元数据
-	UpdateFileMeta(context.Context, *UpdateFileMetaReq) (*FileOpResp, error)
-	//删除文件
-	DeleteFile(context.Context, *LoadFileReq) (*FileOpResp, error)
-	//获取文件
-	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.
-type UnimplementedFileSystemServer struct {
-}
-
-func (*UnimplementedFileSystemServer) CreateDomain(context.Context, *DomainReq) (*DomainResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method CreateDomain not implemented")
-}
-func (*UnimplementedFileSystemServer) UpdateDomainMeta(context.Context, *DomainReq) (*DomainResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method UpdateDomainMeta not implemented")
-}
-func (*UnimplementedFileSystemServer) DeleteDomain(context.Context, *DomainReq) (*DomainResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method DeleteDomain not implemented")
-}
-func (*UnimplementedFileSystemServer) SaveFile(context.Context, *SaveFileReq) (*FileOpResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method SaveFile not implemented")
-}
-func (*UnimplementedFileSystemServer) UpdateFileMeta(context.Context, *UpdateFileMetaReq) (*FileOpResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method UpdateFileMeta not implemented")
-}
-func (*UnimplementedFileSystemServer) DeleteFile(context.Context, *LoadFileReq) (*FileOpResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method DeleteFile not implemented")
-}
-func (*UnimplementedFileSystemServer) GetFile(context.Context, *LoadFileReq) (*LoadFileResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method GetFile not implemented")
-}
-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)
-}
-
-func _FileSystem_CreateDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(DomainReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(FileSystemServer).CreateDomain(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/filesystem.FileSystem/CreateDomain",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(FileSystemServer).CreateDomain(ctx, req.(*DomainReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _FileSystem_UpdateDomainMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(DomainReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(FileSystemServer).UpdateDomainMeta(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/filesystem.FileSystem/UpdateDomainMeta",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(FileSystemServer).UpdateDomainMeta(ctx, req.(*DomainReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _FileSystem_DeleteDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(DomainReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(FileSystemServer).DeleteDomain(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/filesystem.FileSystem/DeleteDomain",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(FileSystemServer).DeleteDomain(ctx, req.(*DomainReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _FileSystem_SaveFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(SaveFileReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(FileSystemServer).SaveFile(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/filesystem.FileSystem/SaveFile",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(FileSystemServer).SaveFile(ctx, req.(*SaveFileReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _FileSystem_UpdateFileMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(UpdateFileMetaReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(FileSystemServer).UpdateFileMeta(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/filesystem.FileSystem/UpdateFileMeta",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(FileSystemServer).UpdateFileMeta(ctx, req.(*UpdateFileMetaReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _FileSystem_DeleteFile_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).DeleteFile(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/filesystem.FileSystem/DeleteFile",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(FileSystemServer).DeleteFile(ctx, req.(*LoadFileReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _FileSystem_GetFile_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).GetFile(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/filesystem.FileSystem/GetFile",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(FileSystemServer).GetFile(ctx, req.(*LoadFileReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _FileSystem_GetFileMeta_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).GetFileMeta(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/filesystem.FileSystem/GetFileMeta",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(FileSystemServer).GetFileMeta(ctx, req.(*LoadFileReq))
-	}
-	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),
-	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "CreateDomain",
-			Handler:    _FileSystem_CreateDomain_Handler,
-		},
-		{
-			MethodName: "UpdateDomainMeta",
-			Handler:    _FileSystem_UpdateDomainMeta_Handler,
-		},
-		{
-			MethodName: "DeleteDomain",
-			Handler:    _FileSystem_DeleteDomain_Handler,
-		},
-		{
-			MethodName: "SaveFile",
-			Handler:    _FileSystem_SaveFile_Handler,
-		},
-		{
-			MethodName: "UpdateFileMeta",
-			Handler:    _FileSystem_UpdateFileMeta_Handler,
-		},
-		{
-			MethodName: "DeleteFile",
-			Handler:    _FileSystem_DeleteFile_Handler,
-		},
-		{
-			MethodName: "GetFile",
-			Handler:    _FileSystem_GetFile_Handler,
-		},
-		{
-			MethodName: "GetFileMeta",
-			Handler:    _FileSystem_GetFileMeta_Handler,
-		},
-		{
-			MethodName: "GetOssUril",
-			Handler:    _FileSystem_GetOssUril_Handler,
-		},
-	},
-	Streams:  []grpc.StreamDesc{},
-	Metadata: "filesystem.proto",
-}

+ 411 - 0
rpc/filesystem/filesystem_grpc.pb.go

@@ -0,0 +1,411 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.2.0
+// - protoc             v3.15.5
+// source: filesystem.proto
+
+package filesystem
+
+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
+
+// FileSystemClient is the client API for FileSystem 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 FileSystemClient interface {
+	//创建域
+	CreateDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error)
+	//更新域
+	UpdateDomainMeta(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error)
+	//删除域
+	DeleteDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error)
+	//保存文件
+	SaveFile(ctx context.Context, in *SaveFileReq, opts ...grpc.CallOption) (*FileOpResp, error)
+	//更新文件元数据
+	UpdateFileMeta(ctx context.Context, in *UpdateFileMetaReq, opts ...grpc.CallOption) (*FileOpResp, error)
+	//删除文件
+	DeleteFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*FileOpResp, error)
+	//获取文件
+	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 {
+	cc grpc.ClientConnInterface
+}
+
+func NewFileSystemClient(cc grpc.ClientConnInterface) FileSystemClient {
+	return &fileSystemClient{cc}
+}
+
+func (c *fileSystemClient) CreateDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error) {
+	out := new(DomainResp)
+	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/CreateDomain", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *fileSystemClient) UpdateDomainMeta(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error) {
+	out := new(DomainResp)
+	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/UpdateDomainMeta", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *fileSystemClient) DeleteDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error) {
+	out := new(DomainResp)
+	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/DeleteDomain", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *fileSystemClient) SaveFile(ctx context.Context, in *SaveFileReq, opts ...grpc.CallOption) (*FileOpResp, error) {
+	out := new(FileOpResp)
+	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/SaveFile", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *fileSystemClient) UpdateFileMeta(ctx context.Context, in *UpdateFileMetaReq, opts ...grpc.CallOption) (*FileOpResp, error) {
+	out := new(FileOpResp)
+	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/UpdateFileMeta", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *fileSystemClient) DeleteFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*FileOpResp, error) {
+	out := new(FileOpResp)
+	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/DeleteFile", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *fileSystemClient) GetFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileResp, error) {
+	out := new(LoadFileResp)
+	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/GetFile", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *fileSystemClient) GetFileMeta(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileMetaResp, error) {
+	out := new(LoadFileMetaResp)
+	err := c.cc.Invoke(ctx, "/filesystem.FileSystem/GetFileMeta", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	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.
+// All implementations must embed UnimplementedFileSystemServer
+// for forward compatibility
+type FileSystemServer interface {
+	//创建域
+	CreateDomain(context.Context, *DomainReq) (*DomainResp, error)
+	//更新域
+	UpdateDomainMeta(context.Context, *DomainReq) (*DomainResp, error)
+	//删除域
+	DeleteDomain(context.Context, *DomainReq) (*DomainResp, error)
+	//保存文件
+	SaveFile(context.Context, *SaveFileReq) (*FileOpResp, error)
+	//更新文件元数据
+	UpdateFileMeta(context.Context, *UpdateFileMetaReq) (*FileOpResp, error)
+	//删除文件
+	DeleteFile(context.Context, *LoadFileReq) (*FileOpResp, error)
+	//获取文件
+	GetFile(context.Context, *LoadFileReq) (*LoadFileResp, error)
+	//获取文件元数据
+	GetFileMeta(context.Context, *LoadFileReq) (*LoadFileMetaResp, error)
+	//获取签名OSSURL
+	GetOssUril(context.Context, *LoadFileReq) (*OssUrlResp, error)
+	mustEmbedUnimplementedFileSystemServer()
+}
+
+// UnimplementedFileSystemServer must be embedded to have forward compatible implementations.
+type UnimplementedFileSystemServer struct {
+}
+
+func (UnimplementedFileSystemServer) CreateDomain(context.Context, *DomainReq) (*DomainResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CreateDomain not implemented")
+}
+func (UnimplementedFileSystemServer) UpdateDomainMeta(context.Context, *DomainReq) (*DomainResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method UpdateDomainMeta not implemented")
+}
+func (UnimplementedFileSystemServer) DeleteDomain(context.Context, *DomainReq) (*DomainResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method DeleteDomain not implemented")
+}
+func (UnimplementedFileSystemServer) SaveFile(context.Context, *SaveFileReq) (*FileOpResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method SaveFile not implemented")
+}
+func (UnimplementedFileSystemServer) UpdateFileMeta(context.Context, *UpdateFileMetaReq) (*FileOpResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method UpdateFileMeta not implemented")
+}
+func (UnimplementedFileSystemServer) DeleteFile(context.Context, *LoadFileReq) (*FileOpResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method DeleteFile not implemented")
+}
+func (UnimplementedFileSystemServer) GetFile(context.Context, *LoadFileReq) (*LoadFileResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetFile not implemented")
+}
+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 (UnimplementedFileSystemServer) mustEmbedUnimplementedFileSystemServer() {}
+
+// UnsafeFileSystemServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to FileSystemServer will
+// result in compilation errors.
+type UnsafeFileSystemServer interface {
+	mustEmbedUnimplementedFileSystemServer()
+}
+
+func RegisterFileSystemServer(s grpc.ServiceRegistrar, srv FileSystemServer) {
+	s.RegisterService(&FileSystem_ServiceDesc, srv)
+}
+
+func _FileSystem_CreateDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(DomainReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(FileSystemServer).CreateDomain(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/filesystem.FileSystem/CreateDomain",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(FileSystemServer).CreateDomain(ctx, req.(*DomainReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _FileSystem_UpdateDomainMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(DomainReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(FileSystemServer).UpdateDomainMeta(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/filesystem.FileSystem/UpdateDomainMeta",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(FileSystemServer).UpdateDomainMeta(ctx, req.(*DomainReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _FileSystem_DeleteDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(DomainReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(FileSystemServer).DeleteDomain(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/filesystem.FileSystem/DeleteDomain",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(FileSystemServer).DeleteDomain(ctx, req.(*DomainReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _FileSystem_SaveFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(SaveFileReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(FileSystemServer).SaveFile(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/filesystem.FileSystem/SaveFile",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(FileSystemServer).SaveFile(ctx, req.(*SaveFileReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _FileSystem_UpdateFileMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(UpdateFileMetaReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(FileSystemServer).UpdateFileMeta(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/filesystem.FileSystem/UpdateFileMeta",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(FileSystemServer).UpdateFileMeta(ctx, req.(*UpdateFileMetaReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _FileSystem_DeleteFile_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).DeleteFile(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/filesystem.FileSystem/DeleteFile",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(FileSystemServer).DeleteFile(ctx, req.(*LoadFileReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _FileSystem_GetFile_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).GetFile(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/filesystem.FileSystem/GetFile",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(FileSystemServer).GetFile(ctx, req.(*LoadFileReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _FileSystem_GetFileMeta_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).GetFileMeta(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/filesystem.FileSystem/GetFileMeta",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(FileSystemServer).GetFileMeta(ctx, req.(*LoadFileReq))
+	}
+	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)
+}
+
+// FileSystem_ServiceDesc is the grpc.ServiceDesc for FileSystem service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var FileSystem_ServiceDesc = grpc.ServiceDesc{
+	ServiceName: "filesystem.FileSystem",
+	HandlerType: (*FileSystemServer)(nil),
+	Methods: []grpc.MethodDesc{
+		{
+			MethodName: "CreateDomain",
+			Handler:    _FileSystem_CreateDomain_Handler,
+		},
+		{
+			MethodName: "UpdateDomainMeta",
+			Handler:    _FileSystem_UpdateDomainMeta_Handler,
+		},
+		{
+			MethodName: "DeleteDomain",
+			Handler:    _FileSystem_DeleteDomain_Handler,
+		},
+		{
+			MethodName: "SaveFile",
+			Handler:    _FileSystem_SaveFile_Handler,
+		},
+		{
+			MethodName: "UpdateFileMeta",
+			Handler:    _FileSystem_UpdateFileMeta_Handler,
+		},
+		{
+			MethodName: "DeleteFile",
+			Handler:    _FileSystem_DeleteFile_Handler,
+		},
+		{
+			MethodName: "GetFile",
+			Handler:    _FileSystem_GetFile_Handler,
+		},
+		{
+			MethodName: "GetFileMeta",
+			Handler:    _FileSystem_GetFileMeta_Handler,
+		},
+		{
+			MethodName: "GetOssUril",
+			Handler:    _FileSystem_GetOssUril_Handler,
+		},
+	},
+	Streams:  []grpc.StreamDesc{},
+	Metadata: "filesystem.proto",
+}

+ 34 - 35
rpc/filesystemclient/filesystem.go

@@ -1,8 +1,6 @@
 // Code generated by goctl. DO NOT EDIT!
 // Source: filesystem.proto
 
-//go:generate mockgen -destination ./filesystem_mock.go -package filesystemclient -source $GOFILE
-
 package filesystemclient
 
 import (
@@ -11,38 +9,39 @@ import (
 	"app.yhyue.com/moapp/jyfs/rpc/filesystem"
 
 	"github.com/zeromicro/go-zero/zrpc"
+	"google.golang.org/grpc"
 )
 
 type (
-	UpdateFileMetaReq = filesystem.UpdateFileMetaReq
-	LoadFileReq       = filesystem.LoadFileReq
-	LoadFileResp      = filesystem.LoadFileResp
-	SaveFileReq       = filesystem.SaveFileReq
+	DomainReq         = filesystem.DomainReq
+	DomainResp        = filesystem.DomainResp
 	FileOpResp        = filesystem.FileOpResp
 	LoadFileMetaResp  = filesystem.LoadFileMetaResp
+	LoadFileReq       = filesystem.LoadFileReq
+	LoadFileResp      = filesystem.LoadFileResp
 	OssUrlResp        = filesystem.OssUrlResp
-	DomainReq         = filesystem.DomainReq
-	DomainResp        = filesystem.DomainResp
+	SaveFileReq       = filesystem.SaveFileReq
+	UpdateFileMetaReq = filesystem.UpdateFileMetaReq
 
 	FileSystem interface {
 		// 创建域
-		CreateDomain(ctx context.Context, in *DomainReq) (*DomainResp, error)
+		CreateDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error)
 		// 更新域
-		UpdateDomainMeta(ctx context.Context, in *DomainReq) (*DomainResp, error)
+		UpdateDomainMeta(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error)
 		// 删除域
-		DeleteDomain(ctx context.Context, in *DomainReq) (*DomainResp, error)
+		DeleteDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error)
 		// 保存文件
-		SaveFile(ctx context.Context, in *SaveFileReq) (*FileOpResp, error)
+		SaveFile(ctx context.Context, in *SaveFileReq, opts ...grpc.CallOption) (*FileOpResp, error)
 		// 更新文件元数据
-		UpdateFileMeta(ctx context.Context, in *UpdateFileMetaReq) (*FileOpResp, error)
+		UpdateFileMeta(ctx context.Context, in *UpdateFileMetaReq, opts ...grpc.CallOption) (*FileOpResp, error)
 		// 删除文件
-		DeleteFile(ctx context.Context, in *LoadFileReq) (*FileOpResp, error)
+		DeleteFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*FileOpResp, error)
 		// 获取文件
-		GetFile(ctx context.Context, in *LoadFileReq) (*LoadFileResp, error)
+		GetFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileResp, error)
 		// 获取文件元数据
-		GetFileMeta(ctx context.Context, in *LoadFileReq) (*LoadFileMetaResp, error)
+		GetFileMeta(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileMetaResp, error)
 		// 获取签名OSSURL
-		GetOssUril(ctx context.Context, in *LoadFileReq) (*OssUrlResp, error)
+		GetOssUril(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*OssUrlResp, error)
 	}
 
 	defaultFileSystem struct {
@@ -57,55 +56,55 @@ func NewFileSystem(cli zrpc.Client) FileSystem {
 }
 
 // 创建域
-func (m *defaultFileSystem) CreateDomain(ctx context.Context, in *DomainReq) (*DomainResp, error) {
+func (m *defaultFileSystem) CreateDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error) {
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
-	return client.CreateDomain(ctx, in)
+	return client.CreateDomain(ctx, in, opts...)
 }
 
 // 更新域
-func (m *defaultFileSystem) UpdateDomainMeta(ctx context.Context, in *DomainReq) (*DomainResp, error) {
+func (m *defaultFileSystem) UpdateDomainMeta(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error) {
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
-	return client.UpdateDomainMeta(ctx, in)
+	return client.UpdateDomainMeta(ctx, in, opts...)
 }
 
 // 删除域
-func (m *defaultFileSystem) DeleteDomain(ctx context.Context, in *DomainReq) (*DomainResp, error) {
+func (m *defaultFileSystem) DeleteDomain(ctx context.Context, in *DomainReq, opts ...grpc.CallOption) (*DomainResp, error) {
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
-	return client.DeleteDomain(ctx, in)
+	return client.DeleteDomain(ctx, in, opts...)
 }
 
 // 保存文件
-func (m *defaultFileSystem) SaveFile(ctx context.Context, in *SaveFileReq) (*FileOpResp, error) {
+func (m *defaultFileSystem) SaveFile(ctx context.Context, in *SaveFileReq, opts ...grpc.CallOption) (*FileOpResp, error) {
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
-	return client.SaveFile(ctx, in)
+	return client.SaveFile(ctx, in, opts...)
 }
 
 // 更新文件元数据
-func (m *defaultFileSystem) UpdateFileMeta(ctx context.Context, in *UpdateFileMetaReq) (*FileOpResp, error) {
+func (m *defaultFileSystem) UpdateFileMeta(ctx context.Context, in *UpdateFileMetaReq, opts ...grpc.CallOption) (*FileOpResp, error) {
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
-	return client.UpdateFileMeta(ctx, in)
+	return client.UpdateFileMeta(ctx, in, opts...)
 }
 
 // 删除文件
-func (m *defaultFileSystem) DeleteFile(ctx context.Context, in *LoadFileReq) (*FileOpResp, error) {
+func (m *defaultFileSystem) DeleteFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*FileOpResp, error) {
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
-	return client.DeleteFile(ctx, in)
+	return client.DeleteFile(ctx, in, opts...)
 }
 
 // 获取文件
-func (m *defaultFileSystem) GetFile(ctx context.Context, in *LoadFileReq) (*LoadFileResp, error) {
+func (m *defaultFileSystem) GetFile(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileResp, error) {
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
-	return client.GetFile(ctx, in)
+	return client.GetFile(ctx, in, opts...)
 }
 
 // 获取文件元数据
-func (m *defaultFileSystem) GetFileMeta(ctx context.Context, in *LoadFileReq) (*LoadFileMetaResp, error) {
+func (m *defaultFileSystem) GetFileMeta(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*LoadFileMetaResp, error) {
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
-	return client.GetFileMeta(ctx, in)
+	return client.GetFileMeta(ctx, in, opts...)
 }
 
 // 获取签名OSSURL
-func (m *defaultFileSystem) GetOssUril(ctx context.Context, in *LoadFileReq) (*OssUrlResp, error) {
+func (m *defaultFileSystem) GetOssUril(ctx context.Context, in *LoadFileReq, opts ...grpc.CallOption) (*OssUrlResp, error) {
 	client := filesystem.NewFileSystemClient(m.cli.Conn())
-	return client.GetOssUril(ctx, in)
+	return client.GetOssUril(ctx, in, opts...)
 }

+ 10 - 5
rpc/internal/logic/savefilelogic.go

@@ -50,7 +50,10 @@ func (l *SaveFileLogic) SaveFile(in *filesystem.SaveFileReq) (*filesystem.FileOp
 		}
 	}
 	if len(in.RawFileContent) > 0 {
-		in.RawFileContent, _ = decompress(in.RawFileContent)
+		content, _ := decompress(in.RawFileContent)
+		if len(content) > 0 {
+			in.RawFileContent = content
+		}
 	}
 	// 设置文件元信息:过期时间为2049年1月10日 23:00:00 GMT,访问权限为公共读,自定义元信息为MyProp(取值MyPropVal)。
 	// expires := time.Date(2049, time.January, 10, 23, 0, 0, 0, time.UTC)
@@ -59,10 +62,12 @@ func (l *SaveFileLogic) SaveFile(in *filesystem.SaveFileReq) (*filesystem.FileOp
 		// oss.ObjectACL(oss.ACLPublicRead),
 		// oss.Meta("MyProp", "MyPropVal"),
 	}
-	if fs := strings.Split(in.FileId, "."); len(fs) > 1 {
-		suffix := strings.ToLower(fs[1])
-		if charset := config.Cf.ContentType[suffix]; charset != "" {
-			options = append(options, oss.ContentType(fmt.Sprintf("text/plain; charset=%s", charset)))
+	if in.Source == "docin" {
+		if fs := strings.Split(in.FileId, "."); len(fs) > 1 {
+			suffix := strings.ToLower(fs[1])
+			if charset := config.Cf.ContentType[suffix]; charset != "" {
+				options = append(options, oss.ContentType(fmt.Sprintf("text/plain; charset=%s", charset)))
+			}
 		}
 	}
 	for k, v := range in.Meta {

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

@@ -13,6 +13,7 @@ import (
 
 type FileSystemServer struct {
 	svcCtx *svc.ServiceContext
+	filesystem.UnimplementedFileSystemServer
 }
 
 func NewFileSystemServer(svcCtx *svc.ServiceContext) *FileSystemServer {

+ 5 - 1
rpc/test/111.txt

@@ -1 +1,5 @@
-1111111111111
+概述
+在商业竞争激烈的市场环境中,恶意低价中标成为一种常见的手段。企业需要采取相应的措施来防止恶意低价中标,保护自身的利益和声誉。本文将介绍一些有效的方法来应对该问题。
+
+了解恶意低价中标的危害
+恶意低价中标是指一些企业故意以低于成本的价格中标,以获取项目或订单,并通过其他途径实施变相加价,最终获得利润。这种行为对正常竞争秩序和市场环境产生负面影响,对一家企业的经济利益和品牌形象造成严重损害。了解恶意低价中标的危害是制定防范措施的基础。

+ 13 - 5
rpc/test/filesystem.yaml

@@ -1,14 +1,22 @@
 Name: filesystem.rpc
-ListenOn: 192.168.20.36:8080
+ListenOn: 127.0.0.1:8086
+Timeout: 20000
 #阿里云OSS配置
 OssEndPoint: "oss-cn-beijing.aliyuncs.com"
-OssAccessKeyId: "LTAI4G4HRNnS7qeHwMRkzJ9k"
-OssAccessKeySecret: "rlUFOkaK4fAfLWxvKBORSwWhf75bQx"
+OssAccessKeyId: "LTAI4Fzf9BwiAxVm4NKnYai2"
+OssAccessKeySecret: "qf4Ic6OItmQXoGyUgvIlQ2BojjrpaV"
 #etcd配置
+Etcd:
+  Hosts:
+    - 127.0.0.1:2379
+  Key: moapp.filesystem.rpc
 FileSystemConf:
   Etcd:
     Hosts:
-      - 192.168.3.240:2379
+      - 127.0.0.1:2379
     Key: moapp.filesystem.rpc
 #redis
-RedisAddress: "jyfs=192.168.3.128:5002"
+RedisAddress: "jyfs=192.168.3.149:1712"
+FileSize: 41943040
+ContentType:
+  txt: "GB 2312"

+ 31 - 31
rpc/test/jyfs_rpc_test.go

@@ -81,37 +81,37 @@ func init() {
 // 	log.Println("req ", res)
 // }
 
-// // 保存文件
-// func Test_SaveFile(t *testing.T) {
-// 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
-// 	FileSystem := filesystemclient.NewFileSystem(zrpc.MustNewClient(C.FileSystemConf))
-// 	file, err := os.Open("./111.txt")
-// 	if err != nil {
-// 		return
-// 	}
-// 	defer file.Close()
-// 	// FileInfo:
-// 	stats, err := file.Stat()
-// 	if err != nil {
-// 		return
-// 	}
-// 	// []byte
-// 	data := make([]byte, stats.Size())
-// 	count, err := file.Read(data)
-// 	if err != nil {
-// 		return
-// 	}
-// 	log.Println(count)
-// 	req := &filesystem.SaveFileReq{
-// 		Domain:         "jy-oss-xzh",
-// 		FileId:         "111.txt",
-// 		Meta:           map[string]string{"docName": "111", "docSuffix": ".txt", "docSize": "1024"},
-// 		RawFileContent: data,
-// 	}
-// 	res, err := FileSystem.SaveFile(ctx, req)
-// 	log.Println("err ", err)
-// 	log.Println("req ", res)
-// }
+// 保存文件
+func Test_SaveFile(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+	FileSystem := filesystemclient.NewFileSystem(zrpc.MustNewClient(C.FileSystemConf))
+	file, err := os.Open("./111.txt")
+	if err != nil {
+		return
+	}
+	defer file.Close()
+	// FileInfo:
+	stats, err := file.Stat()
+	if err != nil {
+		return
+	}
+	// []byte
+	data := make([]byte, stats.Size())
+	count, err := file.Read(data)
+	if err != nil {
+		return
+	}
+	log.Println(count)
+	req := &filesystem.SaveFileReq{
+		Domain:         "jydocs-std",
+		FileId:         "111.txt",
+		Meta:           map[string]string{"docName": "111", "docSuffix": ".txt", "docSize": "1024"},
+		RawFileContent: data,
+	}
+	res, err := FileSystem.SaveFile(ctx, req)
+	log.Println("err ", err)
+	log.Println("req ", res)
+}
 
 // // 更新文件元数据
 // func Test_UpdateFileMeta(t *testing.T) {