From 9c2603d9a2b3fc2d61660bcbeb2d2a16cae851a0 Mon Sep 17 00:00:00 2001 From: jinronga <1460595002@qq.com> Date: Sun, 20 Oct 2024 11:23:40 +0800 Subject: [PATCH 1/2] -sfeat:Optimize registration logic --- .../shortVideoApiService/api/svapi/user.pb.go | 264 +++++++++--------- .../shortVideoApiService/api/svapi/user.proto | 1 + .../applications/userapp/application.go | 12 + 3 files changed, 149 insertions(+), 128 deletions(-) diff --git a/backend/shortVideoApiService/api/svapi/user.pb.go b/backend/shortVideoApiService/api/svapi/user.pb.go index 68152d6..b8921ba 100644 --- a/backend/shortVideoApiService/api/svapi/user.pb.go +++ b/backend/shortVideoApiService/api/svapi/user.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.12.4 +// protoc-gen-go v1.34.2 +// protoc v5.27.1 // source: svapi/user.proto package svapi @@ -74,7 +74,7 @@ type User struct { unknownFields protoimpl.UnknownFields // @gotags: json:"id,omitempty,string" - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty,string"` // 用户id + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty,string"` // 用户id Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // 用户名称 Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` // 用户头像Url BackgroundImage string `protobuf:"bytes,4,opt,name=background_image,json=backgroundImage,proto3" json:"background_image,omitempty"` // 用户个人页顶部大图 @@ -398,7 +398,8 @@ type RegisterResponse struct { unknownFields protoimpl.UnknownFields // @gotags: json:"user_id,omitempty,string" - UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty,string"` + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty,string"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` } func (x *RegisterResponse) Reset() { @@ -440,6 +441,13 @@ func (x *RegisterResponse) GetUserId() int64 { return 0 } +func (x *RegisterResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + type LoginRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -989,118 +997,118 @@ var file_svapi_user_proto_rawDesc = []byte{ 0x69, 0x6c, 0x22, 0x36, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x52, + 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2a, 0x0a, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, - 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x06, 0xba, 0x48, 0x04, 0x72, 0x02, 0x18, 0x32, 0x52, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6f, 0x64, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x64, 0x65, 0x49, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x2b, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x19, 0xba, 0x48, 0x16, 0x72, 0x14, 0x32, 0x12, 0x5e, 0x5c, 0x2b, 0x3f, - 0x5b, 0x31, 0x2d, 0x39, 0x5d, 0x5c, 0x64, 0x7b, 0x31, 0x2c, 0x31, 0x34, 0x7d, 0x24, 0x52, 0x06, - 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x60, 0x01, 0x52, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x08, - 0xba, 0x48, 0x04, 0x72, 0x02, 0x18, 0x32, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x22, 0x25, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2d, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, - 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, - 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x73, - 0x76, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, - 0xbe, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xba, 0x48, 0x04, 0x22, - 0x02, 0x20, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xba, 0x48, 0x04, 0x72, 0x02, - 0x10, 0x01, 0xba, 0x48, 0x04, 0x72, 0x02, 0x18, 0x32, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x62, 0x61, 0x63, 0x6b, 0x67, - 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6d, 0x61, - 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x22, 0x18, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x69, 0x0a, 0x16, 0x42, 0x69, - 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0c, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x76, 0x61, - 0x70, 0x69, 0x2e, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, - 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x6f, - 0x75, 0x63, 0x68, 0x65, 0x72, 0x22, 0x19, 0x0a, 0x17, 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, - 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x6b, 0x0a, 0x18, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, - 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0c, - 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x56, 0x6f, 0x75, 0x63, 0x68, - 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x22, 0x1b, 0x0a, - 0x19, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x23, 0x0a, 0x0b, 0x56, 0x6f, - 0x75, 0x63, 0x68, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x48, 0x4f, - 0x4e, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x10, 0x01, 0x32, - 0xc4, 0x05, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x73, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x47, - 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x76, 0x61, 0x70, - 0x69, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x22, 0x0a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, - 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x56, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x12, 0x16, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x0e, 0x2f, 0x75, 0x73, 0x65, 0x72, - 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x4a, 0x0a, 0x05, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x13, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x73, 0x76, 0x61, - 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x22, 0x0b, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, - 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x58, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x69, 0x6e, - 0x66, 0x6f, 0x12, 0x64, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x25, 0x0a, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, + 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x06, 0x18, 0x32, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x22, 0x41, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x22, 0x87, 0x01, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xba, 0x48, 0x16, 0x72, 0x14, 0x32, 0x12, 0x5e, 0x5c, 0x2b, + 0x3f, 0x5b, 0x31, 0x2d, 0x39, 0x5d, 0x5c, 0x64, 0x7b, 0x31, 0x2c, 0x31, 0x34, 0x7d, 0x24, 0x52, + 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x60, 0x01, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x25, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, + 0x08, 0x18, 0x32, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x25, 0x0a, + 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2d, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xb9, 0x01, 0x0a, 0x15, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xba, 0x48, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x32, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x29, + 0x0a, 0x10, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, + 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x1a, 0x0a, 0x2f, 0x75, 0x73, 0x65, 0x72, - 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x3a, 0x01, 0x2a, 0x12, 0x6a, 0x0a, 0x0f, 0x42, 0x69, 0x6e, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x73, 0x76, - 0x61, 0x70, 0x69, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, - 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x76, 0x61, - 0x70, 0x69, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, - 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x70, 0x0a, 0x11, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x73, 0x76, 0x61, 0x70, - 0x69, 0x2e, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, - 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x76, 0x61, - 0x70, 0x69, 0x2e, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, - 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x12, 0x2a, 0x0d, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x6f, 0x75, 0x63, - 0x68, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x7a, 0x65, 0x6e, 0x69, 0x74, 0x68, - 0x2f, 0x44, 0x6f, 0x75, 0x54, 0x6f, 0x6b, 0x2f, 0x2e, 0x2e, 0x2e, 0x3b, 0x73, 0x76, 0x61, 0x70, - 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x22, 0x69, 0x0a, 0x16, 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, + 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0c, 0x76, + 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x22, 0x19, 0x0a, 0x17, + 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6b, 0x0a, 0x18, 0x55, 0x6e, 0x62, 0x69, 0x6e, + 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0c, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x76, 0x61, 0x70, + 0x69, 0x2e, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x76, + 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x6f, + 0x75, 0x63, 0x68, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x6f, 0x75, + 0x63, 0x68, 0x65, 0x72, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2a, 0x23, 0x0a, 0x0b, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x09, 0x0a, 0x05, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, + 0x4d, 0x41, 0x49, 0x4c, 0x10, 0x01, 0x32, 0xc4, 0x05, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x73, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x2e, + 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x22, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x3a, 0x01, 0x2a, 0x22, + 0x0a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x56, 0x0a, 0x08, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x17, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, + 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x13, 0x2e, 0x73, + 0x76, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x14, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, + 0x01, 0x2a, 0x22, 0x0b, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, + 0x58, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, + 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x76, 0x61, 0x70, + 0x69, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, + 0x75, 0x73, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x64, 0x0a, 0x0e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x2e, 0x73, 0x76, + 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x76, 0x61, 0x70, + 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, + 0x3a, 0x01, 0x2a, 0x1a, 0x0a, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x12, + 0x6a, 0x0a, 0x0f, 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, + 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x2f, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x12, 0x70, 0x0a, 0x11, 0x55, + 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, + 0x12, 0x1f, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x76, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x56, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x2a, 0x0d, + 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x72, 0x42, 0x29, 0x5a, + 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x7a, 0x65, 0x6e, 0x69, 0x74, 0x68, 0x2f, 0x44, 0x6f, 0x75, 0x54, 0x6f, 0x6b, 0x2f, 0x2e, + 0x2e, 0x2e, 0x3b, 0x73, 0x76, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1117,7 +1125,7 @@ func file_svapi_user_proto_rawDescGZIP() []byte { var file_svapi_user_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_svapi_user_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_svapi_user_proto_goTypes = []interface{}{ +var file_svapi_user_proto_goTypes = []any{ (VoucherType)(0), // 0: svapi.VoucherType (*User)(nil), // 1: svapi.User (*GetVerificationCodeRequest)(nil), // 2: svapi.GetVerificationCodeRequest @@ -1167,7 +1175,7 @@ func file_svapi_user_proto_init() { } file_svapi_base_proto_init() if !protoimpl.UnsafeEnabled { - file_svapi_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*User); i { case 0: return &v.state @@ -1179,7 +1187,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*GetVerificationCodeRequest); i { case 0: return &v.state @@ -1191,7 +1199,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*GetVerificationCodeResponse); i { case 0: return &v.state @@ -1203,7 +1211,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*RegisterRequest); i { case 0: return &v.state @@ -1215,7 +1223,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*RegisterResponse); i { case 0: return &v.state @@ -1227,7 +1235,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*LoginRequest); i { case 0: return &v.state @@ -1239,7 +1247,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*LoginResponse); i { case 0: return &v.state @@ -1251,7 +1259,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*GetUserInfoRequest); i { case 0: return &v.state @@ -1263,7 +1271,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*GetUserInfoResponse); i { case 0: return &v.state @@ -1275,7 +1283,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*UpdateUserInfoRequest); i { case 0: return &v.state @@ -1287,7 +1295,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*UpdateUserInfoResponse); i { case 0: return &v.state @@ -1299,7 +1307,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*BindUserVoucherRequest); i { case 0: return &v.state @@ -1311,7 +1319,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*BindUserVoucherResponse); i { case 0: return &v.state @@ -1323,7 +1331,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*UnbindUserVoucherRequest); i { case 0: return &v.state @@ -1335,7 +1343,7 @@ func file_svapi_user_proto_init() { return nil } } - file_svapi_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_svapi_user_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*UnbindUserVoucherResponse); i { case 0: return &v.state diff --git a/backend/shortVideoApiService/api/svapi/user.proto b/backend/shortVideoApiService/api/svapi/user.proto index 6e72e81..97a8fc3 100644 --- a/backend/shortVideoApiService/api/svapi/user.proto +++ b/backend/shortVideoApiService/api/svapi/user.proto @@ -108,6 +108,7 @@ message RegisterRequest { message RegisterResponse { // @gotags: json:"user_id,omitempty,string" int64 user_id = 1; + string token = 2; } message LoginRequest { diff --git a/backend/shortVideoApiService/internal/applications/userapp/application.go b/backend/shortVideoApiService/internal/applications/userapp/application.go index d402b44..e259ab3 100644 --- a/backend/shortVideoApiService/internal/applications/userapp/application.go +++ b/backend/shortVideoApiService/internal/applications/userapp/application.go @@ -145,6 +145,10 @@ func (a *Application) Register(ctx context.Context, request *svapi.RegisterReque return nil, errorx.New(1, "invalid verification code") } + if request.Mobile == "" && request.Email == "" { + return nil, errorx.New(1, "Please enter your phone number or email address to register!") + } + var options []accountoptions.RegisterOptions if request.Mobile != "" { options = append(options, accountoptions.RegisterWithMobile(request.Mobile)) @@ -170,8 +174,16 @@ func (a *Application) Register(ctx context.Context, request *svapi.RegisterReque log.Context(ctx).Error(fmt.Sprintf("failed to create user: %v", err)) return nil, errorx.New(1, fmt.Sprintf("failed to create user: %v", err)) } + + // 返回token + token, err := a.setToken2Header(ctx, claims.New(userId)) + if err != nil { + log.Context(ctx).Error("failed to generate token: %v", err) + return nil, errorx.New(1, "failed to generate token") + } return &svapi.RegisterResponse{ UserId: userId, + Token: token, }, nil } From b51d779a4bb3890652e5f1fd0de878bbfe4fde5f Mon Sep 17 00:00:00 2001 From: jinronga <1460595002@qq.com> Date: Sun, 20 Oct 2024 17:06:54 +0800 Subject: [PATCH 2/2] fix:Registration token generation exception --- .../internal/applications/userapp/application.go | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/shortVideoApiService/internal/applications/userapp/application.go b/backend/shortVideoApiService/internal/applications/userapp/application.go index e259ab3..698b13b 100644 --- a/backend/shortVideoApiService/internal/applications/userapp/application.go +++ b/backend/shortVideoApiService/internal/applications/userapp/application.go @@ -179,7 +179,6 @@ func (a *Application) Register(ctx context.Context, request *svapi.RegisterReque token, err := a.setToken2Header(ctx, claims.New(userId)) if err != nil { log.Context(ctx).Error("failed to generate token: %v", err) - return nil, errorx.New(1, "failed to generate token") } return &svapi.RegisterResponse{ UserId: userId,