wfz 3 years ago
parent
commit
36b5e6d7c2
4 changed files with 101 additions and 29 deletions
  1. 84 21
      api/common/common.pb.go
  2. 5 0
      api/common/common.proto
  3. 9 8
      errors/common.go
  4. 3 0
      js/api/common/common_pb.ts

+ 84 - 21
api/common/common.pb.go

@@ -897,6 +897,53 @@ func (x *CheckPhoneCodeRequest) GetCode() string {
 	return ""
 }
 
+type UploadMaterialResponse struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Link string `protobuf:"bytes,1,opt,name=link,proto3" json:"link"`
+}
+
+func (x *UploadMaterialResponse) Reset() {
+	*x = UploadMaterialResponse{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_common_proto_msgTypes[13]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *UploadMaterialResponse) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UploadMaterialResponse) ProtoMessage() {}
+
+func (x *UploadMaterialResponse) ProtoReflect() protoreflect.Message {
+	mi := &file_common_proto_msgTypes[13]
+	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 UploadMaterialResponse.ProtoReflect.Descriptor instead.
+func (*UploadMaterialResponse) Descriptor() ([]byte, []int) {
+	return file_common_proto_rawDescGZIP(), []int{13}
+}
+
+func (x *UploadMaterialResponse) GetLink() string {
+	if x != nil {
+		return x.Link
+	}
+	return ""
+}
+
 var File_common_proto protoreflect.FileDescriptor
 
 var file_common_proto_rawDesc = []byte{
@@ -992,12 +1039,15 @@ var file_common_proto_rawDesc = []byte{
 	0x65, 0x63, 0x6b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75,
 	0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01,
 	0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64,
-	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x43, 0x0a,
-	0x0a, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x01, 0x5a, 0x33, 0x67,
-	0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65,
-	0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
-	0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3b, 0x63, 0x6f, 0x6d, 0x6d,
-	0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x2c, 0x0a,
+	0x16, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x52,
+	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x42, 0x43, 0x0a, 0x0a, 0x61,
+	0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74,
+	0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76,
+	0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61,
+	0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
+	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -1012,21 +1062,22 @@ func file_common_proto_rawDescGZIP() []byte {
 	return file_common_proto_rawDescData
 }
 
-var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
+var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
 var file_common_proto_goTypes = []interface{}{
-	(*UserAndPartnerIdParam)(nil), // 0: api.common.UserAndPartnerIdParam
-	(*User1AndUser2IdParam)(nil),  // 1: api.common.User1AndUser2IdParam
-	(*PartnerIDParam)(nil),        // 2: api.common.PartnerIDParam
-	(*PersonParam)(nil),           // 3: api.common.PersonParam
-	(*UserIDParam)(nil),           // 4: api.common.UserIDParam
-	(*HomeInfo)(nil),              // 5: api.common.HomeInfo
-	(*AddFriendMessageInfo)(nil),  // 6: api.common.AddFriendMessageInfo
-	(*PersonIDList)(nil),          // 7: api.common.PersonIDList
-	(*PersonDBReply)(nil),         // 8: api.common.PersonDBReply
-	(*PersonDB)(nil),              // 9: api.common.PersonDB
-	(*ListPageRequest)(nil),       // 10: api.common.ListPageRequest
-	(*SendPhoneCodeRequest)(nil),  // 11: api.common.SendPhoneCodeRequest
-	(*CheckPhoneCodeRequest)(nil), // 12: api.common.CheckPhoneCodeRequest
+	(*UserAndPartnerIdParam)(nil),  // 0: api.common.UserAndPartnerIdParam
+	(*User1AndUser2IdParam)(nil),   // 1: api.common.User1AndUser2IdParam
+	(*PartnerIDParam)(nil),         // 2: api.common.PartnerIDParam
+	(*PersonParam)(nil),            // 3: api.common.PersonParam
+	(*UserIDParam)(nil),            // 4: api.common.UserIDParam
+	(*HomeInfo)(nil),               // 5: api.common.HomeInfo
+	(*AddFriendMessageInfo)(nil),   // 6: api.common.AddFriendMessageInfo
+	(*PersonIDList)(nil),           // 7: api.common.PersonIDList
+	(*PersonDBReply)(nil),          // 8: api.common.PersonDBReply
+	(*PersonDB)(nil),               // 9: api.common.PersonDB
+	(*ListPageRequest)(nil),        // 10: api.common.ListPageRequest
+	(*SendPhoneCodeRequest)(nil),   // 11: api.common.SendPhoneCodeRequest
+	(*CheckPhoneCodeRequest)(nil),  // 12: api.common.CheckPhoneCodeRequest
+	(*UploadMaterialResponse)(nil), // 13: api.common.UploadMaterialResponse
 }
 var file_common_proto_depIdxs = []int32{
 	9, // 0: api.common.PersonDBReply.list:type_name -> api.common.PersonDB
@@ -1199,6 +1250,18 @@ func file_common_proto_init() {
 				return nil
 			}
 		}
+		file_common_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*UploadMaterialResponse); 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{
@@ -1206,7 +1269,7 @@ func file_common_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_common_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   13,
+			NumMessages:   14,
 			NumExtensions: 0,
 			NumServices:   0,
 		},

+ 5 - 0
api/common/common.proto

@@ -91,7 +91,12 @@ message ListPageRequest{
 message SendPhoneCodeRequest {
   string phone = 1;
 }
+
 message CheckPhoneCodeRequest {
   string phone = 1;
   string code = 2;
+}
+
+message UploadMaterialResponse{
+  string link = 1;
 }

+ 9 - 8
errors/common.go

@@ -5,12 +5,13 @@ import (
 )
 
 var (
-	ErrorUserNotExist     = codes.Error(401, "用户不存在")
-	ErrorPhotoNotTrue     = codes.Error(10001, "手机号格式错误")
-	ErrorCodeNotMate      = codes.Error(10002, "验证码不匹配")
-	ErrorCodeSendFail     = codes.Error(10003, "验证码发送失败")
-	ErrorAuthFail         = codes.Error(10004, "授权类型错误")
-	ErrorNeedStatusAuth   = codes.Error(10005, "需要基本授权")
-	ErrorPlayerNotTrue    = codes.Error(10006, "用户类型不正确")
-	ErrorIdentifyNotExist = codes.Error(10007, "openID对应的身份不存在")
+	ErrorUserNotExist          = codes.Error(401, "用户不存在")
+	ErrorPhotoNotTrue          = codes.Error(10001, "手机号格式错误")
+	ErrorCodeNotMate           = codes.Error(10002, "验证码不匹配")
+	ErrorCodeSendFail          = codes.Error(10003, "验证码发送失败")
+	ErrorAuthFail              = codes.Error(10004, "授权类型错误")
+	ErrorNeedStatusAuth        = codes.Error(10005, "需要基本授权")
+	ErrorPlayerNotTrue         = codes.Error(10006, "用户类型不正确")
+	ErrorIdentifyNotExist      = codes.Error(10007, "openID对应的身份不存在")
+	ErrorMaterialFilenameEmpty = codes.Error(10008, "文件名不能为空")
 )

+ 3 - 0
js/api/common/common_pb.ts

@@ -103,4 +103,7 @@ export interface CheckPhoneCodeRequest{
     phone?:string;
     code?:string;
 }
+export interface UploadMaterialResponse{
+    link?:string;
+}