From a77ba04a79f912486ab6e6b92d4864d8ba6c5bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Tue, 15 Dec 2020 11:53:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B6=E6=AE=B5=E6=80=A7=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/rpc/pb/service_user.pb.go | 465 +++++++++++++++++++++++------- pkg/rpc/protos/service_user.proto | 25 +- 2 files changed, 378 insertions(+), 112 deletions(-) diff --git a/pkg/rpc/pb/service_user.pb.go b/pkg/rpc/pb/service_user.pb.go index a15efa4..692c055 100644 --- a/pkg/rpc/pb/service_user.pb.go +++ b/pkg/rpc/pb/service_user.pb.go @@ -579,7 +579,7 @@ func (x *FindEnabledUserResponse) GetUser() *User { } // 检查用户名是否存在 -type CheckUsernameRequest struct { +type CheckUserUsernameRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -588,8 +588,8 @@ type CheckUsernameRequest struct { Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` } -func (x *CheckUsernameRequest) Reset() { - *x = CheckUsernameRequest{} +func (x *CheckUserUsernameRequest) Reset() { + *x = CheckUserUsernameRequest{} if protoimpl.UnsafeEnabled { mi := &file_service_user_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -597,13 +597,13 @@ func (x *CheckUsernameRequest) Reset() { } } -func (x *CheckUsernameRequest) String() string { +func (x *CheckUserUsernameRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CheckUsernameRequest) ProtoMessage() {} +func (*CheckUserUsernameRequest) ProtoMessage() {} -func (x *CheckUsernameRequest) ProtoReflect() protoreflect.Message { +func (x *CheckUserUsernameRequest) ProtoReflect() protoreflect.Message { mi := &file_service_user_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -615,26 +615,26 @@ func (x *CheckUsernameRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CheckUsernameRequest.ProtoReflect.Descriptor instead. -func (*CheckUsernameRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CheckUserUsernameRequest.ProtoReflect.Descriptor instead. +func (*CheckUserUsernameRequest) Descriptor() ([]byte, []int) { return file_service_user_proto_rawDescGZIP(), []int{9} } -func (x *CheckUsernameRequest) GetUserId() int64 { +func (x *CheckUserUsernameRequest) GetUserId() int64 { if x != nil { return x.UserId } return 0 } -func (x *CheckUsernameRequest) GetUsername() string { +func (x *CheckUserUsernameRequest) GetUsername() string { if x != nil { return x.Username } return "" } -type CheckUsernameResponse struct { +type CheckUserUsernameResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -642,8 +642,8 @@ type CheckUsernameResponse struct { Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` } -func (x *CheckUsernameResponse) Reset() { - *x = CheckUsernameResponse{} +func (x *CheckUserUsernameResponse) Reset() { + *x = CheckUserUsernameResponse{} if protoimpl.UnsafeEnabled { mi := &file_service_user_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -651,13 +651,13 @@ func (x *CheckUsernameResponse) Reset() { } } -func (x *CheckUsernameResponse) String() string { +func (x *CheckUserUsernameResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CheckUsernameResponse) ProtoMessage() {} +func (*CheckUserUsernameResponse) ProtoMessage() {} -func (x *CheckUsernameResponse) ProtoReflect() protoreflect.Message { +func (x *CheckUserUsernameResponse) ProtoReflect() protoreflect.Message { mi := &file_service_user_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -669,12 +669,12 @@ func (x *CheckUsernameResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CheckUsernameResponse.ProtoReflect.Descriptor instead. -func (*CheckUsernameResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use CheckUserUsernameResponse.ProtoReflect.Descriptor instead. +func (*CheckUserUsernameResponse) Descriptor() ([]byte, []int) { return file_service_user_proto_rawDescGZIP(), []int{10} } -func (x *CheckUsernameResponse) GetExists() bool { +func (x *CheckUserUsernameResponse) GetExists() bool { if x != nil { return x.Exists } @@ -800,6 +800,126 @@ func (x *LoginUserResponse) GetMessage() string { return "" } +// 修改用户基本信息 +type UpdateUserInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + Fullname string `protobuf:"bytes,2,opt,name=fullname,proto3" json:"fullname,omitempty"` +} + +func (x *UpdateUserInfoRequest) Reset() { + *x = UpdateUserInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserInfoRequest) ProtoMessage() {} + +func (x *UpdateUserInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_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 UpdateUserInfoRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserInfoRequest) Descriptor() ([]byte, []int) { + return file_service_user_proto_rawDescGZIP(), []int{13} +} + +func (x *UpdateUserInfoRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UpdateUserInfoRequest) GetFullname() string { + if x != nil { + return x.Fullname + } + return "" +} + +// 修改用户登录信息 +type UpdateUserLoginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *UpdateUserLoginRequest) Reset() { + *x = UpdateUserLoginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserLoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserLoginRequest) ProtoMessage() {} + +func (x *UpdateUserLoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_proto_msgTypes[14] + 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 UpdateUserLoginRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserLoginRequest) Descriptor() ([]byte, []int) { + return file_service_user_proto_rawDescGZIP(), []int{14} +} + +func (x *UpdateUserLoginRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UpdateUserLoginRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *UpdateUserLoginRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + var File_service_user_proto protoreflect.FileDescriptor var file_service_user_proto_rawDesc = []byte{ @@ -858,60 +978,81 @@ var file_service_user_proto_rawDesc = []byte{ 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x4a, 0x0a, 0x14, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x2f, 0x0a, 0x15, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x22, 0x4a, 0x0a, 0x10, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, - 0x59, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x9e, 0x04, 0x0a, 0x0b, 0x55, - 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, - 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, 0x0a, - 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x12, 0x4d, 0x0a, 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, - 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4d, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4a, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, - 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x70, - 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x38, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, - 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, - 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x4e, 0x0a, 0x18, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, + 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x33, 0x0a, 0x19, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, + 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x4a, 0x0a, 0x10, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x59, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x4b, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x68, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0xa6, 0x05, 0x0a, 0x0b, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, 0x0a, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x12, 0x4d, 0x0a, 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, + 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x4d, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, + 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, + 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, + 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -926,7 +1067,7 @@ func file_service_user_proto_rawDescGZIP() []byte { return file_service_user_proto_rawDescData } -var file_service_user_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_service_user_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_service_user_proto_goTypes = []interface{}{ (*CreateUserRequest)(nil), // 0: pb.CreateUserRequest (*CreateUserResponse)(nil), // 1: pb.CreateUserResponse @@ -937,35 +1078,41 @@ var file_service_user_proto_goTypes = []interface{}{ (*ListEnabledUsersResponse)(nil), // 6: pb.ListEnabledUsersResponse (*FindEnabledUserRequest)(nil), // 7: pb.FindEnabledUserRequest (*FindEnabledUserResponse)(nil), // 8: pb.FindEnabledUserResponse - (*CheckUsernameRequest)(nil), // 9: pb.CheckUsernameRequest - (*CheckUsernameResponse)(nil), // 10: pb.CheckUsernameResponse + (*CheckUserUsernameRequest)(nil), // 9: pb.CheckUserUsernameRequest + (*CheckUserUsernameResponse)(nil), // 10: pb.CheckUserUsernameResponse (*LoginUserRequest)(nil), // 11: pb.LoginUserRequest (*LoginUserResponse)(nil), // 12: pb.LoginUserResponse - (*User)(nil), // 13: pb.User - (*RPCSuccess)(nil), // 14: pb.RPCSuccess - (*RPCCountResponse)(nil), // 15: pb.RPCCountResponse + (*UpdateUserInfoRequest)(nil), // 13: pb.UpdateUserInfoRequest + (*UpdateUserLoginRequest)(nil), // 14: pb.UpdateUserLoginRequest + (*User)(nil), // 15: pb.User + (*RPCSuccess)(nil), // 16: pb.RPCSuccess + (*RPCCountResponse)(nil), // 17: pb.RPCCountResponse } var file_service_user_proto_depIdxs = []int32{ - 13, // 0: pb.ListEnabledUsersResponse.users:type_name -> pb.User - 13, // 1: pb.FindEnabledUserResponse.user:type_name -> pb.User + 15, // 0: pb.ListEnabledUsersResponse.users:type_name -> pb.User + 15, // 1: pb.FindEnabledUserResponse.user:type_name -> pb.User 0, // 2: pb.UserService.createUser:input_type -> pb.CreateUserRequest 2, // 3: pb.UserService.updateUser:input_type -> pb.UpdateUserRequest 3, // 4: pb.UserService.deleteUser:input_type -> pb.DeleteUserRequest 4, // 5: pb.UserService.countAllEnabledUsers:input_type -> pb.CountAllEnabledUsersRequest 5, // 6: pb.UserService.listEnabledUsers:input_type -> pb.ListEnabledUsersRequest 7, // 7: pb.UserService.findEnabledUser:input_type -> pb.FindEnabledUserRequest - 9, // 8: pb.UserService.checkUsername:input_type -> pb.CheckUsernameRequest + 9, // 8: pb.UserService.checkUserUsername:input_type -> pb.CheckUserUsernameRequest 11, // 9: pb.UserService.loginUser:input_type -> pb.LoginUserRequest - 1, // 10: pb.UserService.createUser:output_type -> pb.CreateUserResponse - 14, // 11: pb.UserService.updateUser:output_type -> pb.RPCSuccess - 14, // 12: pb.UserService.deleteUser:output_type -> pb.RPCSuccess - 15, // 13: pb.UserService.countAllEnabledUsers:output_type -> pb.RPCCountResponse - 6, // 14: pb.UserService.listEnabledUsers:output_type -> pb.ListEnabledUsersResponse - 8, // 15: pb.UserService.findEnabledUser:output_type -> pb.FindEnabledUserResponse - 10, // 16: pb.UserService.checkUsername:output_type -> pb.CheckUsernameResponse - 12, // 17: pb.UserService.loginUser:output_type -> pb.LoginUserResponse - 10, // [10:18] is the sub-list for method output_type - 2, // [2:10] is the sub-list for method input_type + 13, // 10: pb.UserService.updateUserInfo:input_type -> pb.UpdateUserInfoRequest + 14, // 11: pb.UserService.updateUserLogin:input_type -> pb.UpdateUserLoginRequest + 1, // 12: pb.UserService.createUser:output_type -> pb.CreateUserResponse + 16, // 13: pb.UserService.updateUser:output_type -> pb.RPCSuccess + 16, // 14: pb.UserService.deleteUser:output_type -> pb.RPCSuccess + 17, // 15: pb.UserService.countAllEnabledUsers:output_type -> pb.RPCCountResponse + 6, // 16: pb.UserService.listEnabledUsers:output_type -> pb.ListEnabledUsersResponse + 8, // 17: pb.UserService.findEnabledUser:output_type -> pb.FindEnabledUserResponse + 10, // 18: pb.UserService.checkUserUsername:output_type -> pb.CheckUserUsernameResponse + 12, // 19: pb.UserService.loginUser:output_type -> pb.LoginUserResponse + 16, // 20: pb.UserService.updateUserInfo:output_type -> pb.RPCSuccess + 16, // 21: pb.UserService.updateUserLogin:output_type -> pb.RPCSuccess + 12, // [12:22] is the sub-list for method output_type + 2, // [2:12] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -1088,7 +1235,7 @@ func file_service_user_proto_init() { } } file_service_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckUsernameRequest); i { + switch v := v.(*CheckUserUsernameRequest); i { case 0: return &v.state case 1: @@ -1100,7 +1247,7 @@ func file_service_user_proto_init() { } } file_service_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckUsernameResponse); i { + switch v := v.(*CheckUserUsernameResponse); i { case 0: return &v.state case 1: @@ -1135,6 +1282,30 @@ func file_service_user_proto_init() { return nil } } + file_service_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserLoginRequest); 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{ @@ -1142,7 +1313,7 @@ func file_service_user_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_user_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, @@ -1181,9 +1352,13 @@ type UserServiceClient interface { // 查询单个用户信息 FindEnabledUser(ctx context.Context, in *FindEnabledUserRequest, opts ...grpc.CallOption) (*FindEnabledUserResponse, error) // 检查用户名是否存在 - CheckUsername(ctx context.Context, in *CheckUsernameRequest, opts ...grpc.CallOption) (*CheckUsernameResponse, error) + CheckUserUsername(ctx context.Context, in *CheckUserUsernameRequest, opts ...grpc.CallOption) (*CheckUserUsernameResponse, error) // 登录 LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error) + // 修改用户基本信息 + UpdateUserInfo(ctx context.Context, in *UpdateUserInfoRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 修改用户登录信息 + UpdateUserLogin(ctx context.Context, in *UpdateUserLoginRequest, opts ...grpc.CallOption) (*RPCSuccess, error) } type userServiceClient struct { @@ -1248,9 +1423,9 @@ func (c *userServiceClient) FindEnabledUser(ctx context.Context, in *FindEnabled return out, nil } -func (c *userServiceClient) CheckUsername(ctx context.Context, in *CheckUsernameRequest, opts ...grpc.CallOption) (*CheckUsernameResponse, error) { - out := new(CheckUsernameResponse) - err := c.cc.Invoke(ctx, "/pb.UserService/checkUsername", in, out, opts...) +func (c *userServiceClient) CheckUserUsername(ctx context.Context, in *CheckUserUsernameRequest, opts ...grpc.CallOption) (*CheckUserUsernameResponse, error) { + out := new(CheckUserUsernameResponse) + err := c.cc.Invoke(ctx, "/pb.UserService/checkUserUsername", in, out, opts...) if err != nil { return nil, err } @@ -1266,6 +1441,24 @@ func (c *userServiceClient) LoginUser(ctx context.Context, in *LoginUserRequest, return out, nil } +func (c *userServiceClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.UserService/updateUserInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) UpdateUserLogin(ctx context.Context, in *UpdateUserLoginRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.UserService/updateUserLogin", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // UserServiceServer is the server API for UserService service. type UserServiceServer interface { // 创建用户 @@ -1281,9 +1474,13 @@ type UserServiceServer interface { // 查询单个用户信息 FindEnabledUser(context.Context, *FindEnabledUserRequest) (*FindEnabledUserResponse, error) // 检查用户名是否存在 - CheckUsername(context.Context, *CheckUsernameRequest) (*CheckUsernameResponse, error) + CheckUserUsername(context.Context, *CheckUserUsernameRequest) (*CheckUserUsernameResponse, error) // 登录 LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error) + // 修改用户基本信息 + UpdateUserInfo(context.Context, *UpdateUserInfoRequest) (*RPCSuccess, error) + // 修改用户登录信息 + UpdateUserLogin(context.Context, *UpdateUserLoginRequest) (*RPCSuccess, error) } // UnimplementedUserServiceServer can be embedded to have forward compatible implementations. @@ -1308,12 +1505,18 @@ func (*UnimplementedUserServiceServer) ListEnabledUsers(context.Context, *ListEn func (*UnimplementedUserServiceServer) FindEnabledUser(context.Context, *FindEnabledUserRequest) (*FindEnabledUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FindEnabledUser not implemented") } -func (*UnimplementedUserServiceServer) CheckUsername(context.Context, *CheckUsernameRequest) (*CheckUsernameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckUsername not implemented") +func (*UnimplementedUserServiceServer) CheckUserUsername(context.Context, *CheckUserUsernameRequest) (*CheckUserUsernameResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckUserUsername not implemented") } func (*UnimplementedUserServiceServer) LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LoginUser not implemented") } +func (*UnimplementedUserServiceServer) UpdateUserInfo(context.Context, *UpdateUserInfoRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInfo not implemented") +} +func (*UnimplementedUserServiceServer) UpdateUserLogin(context.Context, *UpdateUserLoginRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserLogin not implemented") +} func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer) { s.RegisterService(&_UserService_serviceDesc, srv) @@ -1427,20 +1630,20 @@ func _UserService_FindEnabledUser_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } -func _UserService_CheckUsername_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckUsernameRequest) +func _UserService_CheckUserUsername_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckUserUsernameRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserServiceServer).CheckUsername(ctx, in) + return srv.(UserServiceServer).CheckUserUsername(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.UserService/CheckUsername", + FullMethod: "/pb.UserService/CheckUserUsername", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).CheckUsername(ctx, req.(*CheckUsernameRequest)) + return srv.(UserServiceServer).CheckUserUsername(ctx, req.(*CheckUserUsernameRequest)) } return interceptor(ctx, in, info, handler) } @@ -1463,6 +1666,42 @@ func _UserService_LoginUser_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _UserService_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserService/UpdateUserInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUserInfo(ctx, req.(*UpdateUserInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_UpdateUserLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserLoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUserLogin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserService/UpdateUserLogin", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUserLogin(ctx, req.(*UpdateUserLoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _UserService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.UserService", HandlerType: (*UserServiceServer)(nil), @@ -1492,13 +1731,21 @@ var _UserService_serviceDesc = grpc.ServiceDesc{ Handler: _UserService_FindEnabledUser_Handler, }, { - MethodName: "checkUsername", - Handler: _UserService_CheckUsername_Handler, + MethodName: "checkUserUsername", + Handler: _UserService_CheckUserUsername_Handler, }, { MethodName: "loginUser", Handler: _UserService_LoginUser_Handler, }, + { + MethodName: "updateUserInfo", + Handler: _UserService_UpdateUserInfo_Handler, + }, + { + MethodName: "updateUserLogin", + Handler: _UserService_UpdateUserLogin_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_user.proto", diff --git a/pkg/rpc/protos/service_user.proto b/pkg/rpc/protos/service_user.proto index 4eccae6..402505d 100644 --- a/pkg/rpc/protos/service_user.proto +++ b/pkg/rpc/protos/service_user.proto @@ -27,10 +27,16 @@ service UserService { rpc findEnabledUser (FindEnabledUserRequest) returns (FindEnabledUserResponse); // 检查用户名是否存在 - rpc checkUsername (CheckUsernameRequest) returns (CheckUsernameResponse); + rpc checkUserUsername (CheckUserUsernameRequest) returns (CheckUserUsernameResponse); // 登录 rpc loginUser (LoginUserRequest) returns (LoginUserResponse); + + // 修改用户基本信息 + rpc updateUserInfo (UpdateUserInfoRequest) returns (RPCSuccess); + + // 修改用户登录信息 + rpc updateUserLogin (UpdateUserLoginRequest) returns (RPCSuccess); } // 创建用户 @@ -91,12 +97,12 @@ message FindEnabledUserResponse { } // 检查用户名是否存在 -message CheckUsernameRequest { +message CheckUserUsernameRequest { int64 userId = 1; string username = 2; } -message CheckUsernameResponse { +message CheckUserUsernameResponse { bool exists = 1; } @@ -110,4 +116,17 @@ message LoginUserResponse { int64 userId = 1; bool isOk = 2; string message = 3; +} + +// 修改用户基本信息 +message UpdateUserInfoRequest { + int64 userId = 1; + string fullname = 2; +} + +// 修改用户登录信息 +message UpdateUserLoginRequest { + int64 userId = 1; + string username = 2; + string password = 3; } \ No newline at end of file