Quellcode durchsuchen

feat: 附件上传字段调整

zhangxinlei1996 vor 1 Jahr
Ursprung
Commit
fc8712dbdf
3 geänderte Dateien mit 21 neuen und 9 gelöschten Zeilen
  1. 1 0
      rpc/fileCenter.proto
  2. 1 0
      rpc/internal/logic/uploadlogic.go
  3. 19 9
      rpc/pb/fileCenter.pb.go

+ 1 - 0
rpc/fileCenter.proto

@@ -21,6 +21,7 @@ message UploadResp{
 	string error_msg =1;
 	int64 error_code=2;
 	string  url=3;
+	string key =4;
 }
 
 

+ 1 - 0
rpc/internal/logic/uploadlogic.go

@@ -36,6 +36,7 @@ func (l *UploadLogic) Upload(in *pb.UploadReq) (*pb.UploadResp, error) {
 	if err == nil && b {
 		return &pb.UploadResp{
 			Url: in.OssUrl + "/" + key,
+			Key: key,
 		}, nil
 	}
 	return &pb.UploadResp{

+ 19 - 9
rpc/pb/fileCenter.pb.go

@@ -164,6 +164,7 @@ type UploadResp struct {
 	ErrorMsg  string `protobuf:"bytes,1,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
 	ErrorCode int64  `protobuf:"varint,2,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
 	Url       string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
+	Key       string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
 }
 
 func (x *UploadResp) Reset() {
@@ -219,6 +220,13 @@ func (x *UploadResp) GetUrl() string {
 	return ""
 }
 
+func (x *UploadResp) GetKey() string {
+	if x != nil {
+		return x.Key
+	}
+	return ""
+}
+
 type DeleteFileReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -274,19 +282,21 @@ var file_fileCenter_proto_rawDesc = []byte{
 	0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x73, 0x73, 0x55, 0x72, 0x6c, 0x18,
 	0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x73, 0x73, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a,
 	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
-	0x65, 0x22, 0x5a, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x65, 0x22, 0x6c, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12,
 	0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01,
 	0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1d, 0x0a, 0x0a,
 	0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
 	0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75,
-	0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x0f, 0x0a,
-	0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x32, 0x50,
-	0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x06,
-	0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x0a, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52,
-	0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x1f, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x0e, 0x2e, 0x44, 0x65, 0x6c, 0x65,
-	0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70,
-	0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a,
+	0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22,
+	0x0f, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71,
+	0x32, 0x50, 0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x21,
+	0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x0a, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61,
+	0x64, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x1f, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x0e, 0x2e, 0x44, 0x65,
+	0x6c, 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65,
+	0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x33,
 }
 
 var (