浏览代码

feat: 字段调整

zhangxinlei1996 1 年之前
父节点
当前提交
3bddb39789

+ 2 - 2
rpc/fileCenter.proto

@@ -3,7 +3,7 @@ syntax = "proto3";
 option go_package="./pb";
 
 //公共返回 status
-message Resp {
+message FileResp {
 	string error_msg =1;
 	int64 error_code=2;
 	int64 status =3;
@@ -33,5 +33,5 @@ service fileCenter {
     //文件上传
     rpc Upload(UploadReq) returns(UploadResp);
     //文件删除
-    rpc Delete(DeleteFileReq)returns(Resp);
+    rpc Delete(DeleteFileReq)returns(FileResp);
 }

+ 3 - 3
rpc/filecenter/filecenter.go

@@ -14,7 +14,7 @@ import (
 
 type (
 	DeleteFileReq = pb.DeleteFileReq
-	Resp          = pb.Resp
+	FileResp      = pb.FileResp
 	UploadReq     = pb.UploadReq
 	UploadResp    = pb.UploadResp
 
@@ -22,7 +22,7 @@ type (
 		// 文件上传
 		Upload(ctx context.Context, in *UploadReq, opts ...grpc.CallOption) (*UploadResp, error)
 		// 文件删除
-		Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*Resp, error)
+		Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*FileResp, error)
 	}
 
 	defaultFileCenter struct {
@@ -43,7 +43,7 @@ func (m *defaultFileCenter) Upload(ctx context.Context, in *UploadReq, opts ...g
 }
 
 // 文件删除
-func (m *defaultFileCenter) Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*Resp, error) {
+func (m *defaultFileCenter) Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*FileResp, error) {
 	client := pb.NewFileCenterClient(m.cli.Conn())
 	return client.Delete(ctx, in, opts...)
 }

+ 2 - 2
rpc/internal/logic/deletelogic.go

@@ -24,8 +24,8 @@ func NewDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteLogi
 }
 
 // 文件删除
-func (l *DeleteLogic) Delete(in *pb.DeleteFileReq) (*pb.Resp, error) {
+func (l *DeleteLogic) Delete(in *pb.DeleteFileReq) (*pb.FileResp, error) {
 	// todo: add your logic here and delete this line
 
-	return &pb.Resp{}, nil
+	return &pb.FileResp{}, nil
 }

+ 1 - 1
rpc/internal/server/filecenterserver.go

@@ -29,7 +29,7 @@ func (s *FileCenterServer) Upload(ctx context.Context, in *pb.UploadReq) (*pb.Up
 }
 
 // 文件删除
-func (s *FileCenterServer) Delete(ctx context.Context, in *pb.DeleteFileReq) (*pb.Resp, error) {
+func (s *FileCenterServer) Delete(ctx context.Context, in *pb.DeleteFileReq) (*pb.FileResp, error) {
 	l := logic.NewDeleteLogic(ctx, s.svcCtx)
 	return l.Delete(in)
 }

+ 42 - 42
rpc/pb/fileCenter.pb.go

@@ -21,7 +21,7 @@ const (
 )
 
 //公共返回 status
-type Resp struct {
+type FileResp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
@@ -31,8 +31,8 @@ type Resp struct {
 	Status    int64  `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"`
 }
 
-func (x *Resp) Reset() {
-	*x = Resp{}
+func (x *FileResp) Reset() {
+	*x = FileResp{}
 	if protoimpl.UnsafeEnabled {
 		mi := &file_fileCenter_proto_msgTypes[0]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -40,13 +40,13 @@ func (x *Resp) Reset() {
 	}
 }
 
-func (x *Resp) String() string {
+func (x *FileResp) String() string {
 	return protoimpl.X.MessageStringOf(x)
 }
 
-func (*Resp) ProtoMessage() {}
+func (*FileResp) ProtoMessage() {}
 
-func (x *Resp) ProtoReflect() protoreflect.Message {
+func (x *FileResp) ProtoReflect() protoreflect.Message {
 	mi := &file_fileCenter_proto_msgTypes[0]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -58,26 +58,26 @@ func (x *Resp) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 }
 
-// Deprecated: Use Resp.ProtoReflect.Descriptor instead.
-func (*Resp) Descriptor() ([]byte, []int) {
+// Deprecated: Use FileResp.ProtoReflect.Descriptor instead.
+func (*FileResp) Descriptor() ([]byte, []int) {
 	return file_fileCenter_proto_rawDescGZIP(), []int{0}
 }
 
-func (x *Resp) GetErrorMsg() string {
+func (x *FileResp) GetErrorMsg() string {
 	if x != nil {
 		return x.ErrorMsg
 	}
 	return ""
 }
 
-func (x *Resp) GetErrorCode() int64 {
+func (x *FileResp) GetErrorCode() int64 {
 	if x != nil {
 		return x.ErrorCode
 	}
 	return 0
 }
 
-func (x *Resp) GetStatus() int64 {
+func (x *FileResp) GetStatus() int64 {
 	if x != nil {
 		return x.Status
 	}
@@ -269,34 +269,34 @@ var File_fileCenter_proto protoreflect.FileDescriptor
 
 var file_fileCenter_proto_rawDesc = []byte{
 	0x0a, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
-	0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x04, 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, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x71,
-	0x0a, 0x09, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x66,
-	0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12,
-	0x24, 0x0a, 0x0d, 0x6f, 0x73, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65,
-	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x73, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65,
-	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, 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, 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,
+	0x74, 0x6f, 0x22, 0x5e, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 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, 0x16, 0x0a, 0x06, 0x73, 0x74,
+	0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74,
+	0x75, 0x73, 0x22, 0x71, 0x0a, 0x09, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x12,
+	0x12, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66,
+	0x69, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x73, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74,
+	0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x73, 0x73, 0x42,
+	0x75, 0x63, 0x6b, 0x65, 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, 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, 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, 0x54, 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, 0x23, 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,
+	0x09, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
+	0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -313,7 +313,7 @@ func file_fileCenter_proto_rawDescGZIP() []byte {
 
 var file_fileCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
 var file_fileCenter_proto_goTypes = []interface{}{
-	(*Resp)(nil),          // 0: Resp
+	(*FileResp)(nil),      // 0: FileResp
 	(*UploadReq)(nil),     // 1: UploadReq
 	(*UploadResp)(nil),    // 2: UploadResp
 	(*DeleteFileReq)(nil), // 3: DeleteFileReq
@@ -322,7 +322,7 @@ var file_fileCenter_proto_depIdxs = []int32{
 	1, // 0: fileCenter.Upload:input_type -> UploadReq
 	3, // 1: fileCenter.Delete:input_type -> DeleteFileReq
 	2, // 2: fileCenter.Upload:output_type -> UploadResp
-	0, // 3: fileCenter.Delete:output_type -> Resp
+	0, // 3: fileCenter.Delete:output_type -> FileResp
 	2, // [2:4] is the sub-list for method output_type
 	0, // [0:2] is the sub-list for method input_type
 	0, // [0:0] is the sub-list for extension type_name
@@ -337,7 +337,7 @@ func file_fileCenter_proto_init() {
 	}
 	if !protoimpl.UnsafeEnabled {
 		file_fileCenter_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Resp); i {
+			switch v := v.(*FileResp); i {
 			case 0:
 				return &v.state
 			case 1:

+ 5 - 5
rpc/pb/fileCenter_grpc.pb.go

@@ -25,7 +25,7 @@ type FileCenterClient interface {
 	//文件上传
 	Upload(ctx context.Context, in *UploadReq, opts ...grpc.CallOption) (*UploadResp, error)
 	//文件删除
-	Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*Resp, error)
+	Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*FileResp, error)
 }
 
 type fileCenterClient struct {
@@ -45,8 +45,8 @@ func (c *fileCenterClient) Upload(ctx context.Context, in *UploadReq, opts ...gr
 	return out, nil
 }
 
-func (c *fileCenterClient) Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*Resp, error) {
-	out := new(Resp)
+func (c *fileCenterClient) Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*FileResp, error) {
+	out := new(FileResp)
 	err := c.cc.Invoke(ctx, "/fileCenter/Delete", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -61,7 +61,7 @@ type FileCenterServer interface {
 	//文件上传
 	Upload(context.Context, *UploadReq) (*UploadResp, error)
 	//文件删除
-	Delete(context.Context, *DeleteFileReq) (*Resp, error)
+	Delete(context.Context, *DeleteFileReq) (*FileResp, error)
 	mustEmbedUnimplementedFileCenterServer()
 }
 
@@ -72,7 +72,7 @@ type UnimplementedFileCenterServer struct {
 func (UnimplementedFileCenterServer) Upload(context.Context, *UploadReq) (*UploadResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented")
 }
-func (UnimplementedFileCenterServer) Delete(context.Context, *DeleteFileReq) (*Resp, error) {
+func (UnimplementedFileCenterServer) Delete(context.Context, *DeleteFileReq) (*FileResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
 }
 func (UnimplementedFileCenterServer) mustEmbedUnimplementedFileCenterServer() {}