chore: auto-generate protobuf files [skip ci]

This commit is contained in:
github-actions[bot]
2026-04-11 15:14:23 +00:00
parent be19cbd627
commit f0c2987f3d
3 changed files with 421 additions and 514 deletions

View File

@@ -21,27 +21,27 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
type GetMeRequest struct { type GetProfileRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // Берется из access токена на API шлюзе
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
func (x *GetMeRequest) Reset() { func (x *GetProfileRequest) Reset() {
*x = GetMeRequest{} *x = GetProfileRequest{}
mi := &file_users_users_proto_msgTypes[0] mi := &file_users_users_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
func (x *GetMeRequest) String() string { func (x *GetProfileRequest) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*GetMeRequest) ProtoMessage() {} func (*GetProfileRequest) ProtoMessage() {}
func (x *GetMeRequest) ProtoReflect() protoreflect.Message { func (x *GetProfileRequest) ProtoReflect() protoreflect.Message {
mi := &file_users_users_proto_msgTypes[0] mi := &file_users_users_proto_msgTypes[0]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -53,275 +53,251 @@ func (x *GetMeRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use GetMeRequest.ProtoReflect.Descriptor instead. // Deprecated: Use GetProfileRequest.ProtoReflect.Descriptor instead.
func (*GetMeRequest) Descriptor() ([]byte, []int) { func (*GetProfileRequest) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{0} return file_users_users_proto_rawDescGZIP(), []int{0}
} }
func (x *GetMeRequest) GetId() string { func (x *GetProfileRequest) GetUserId() string {
if x != nil {
return x.Id
}
return ""
}
type GetMeResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetMeResponse) Reset() {
*x = GetMeResponse{}
mi := &file_users_users_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetMeResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetMeResponse) ProtoMessage() {}
func (x *GetMeResponse) ProtoReflect() protoreflect.Message {
mi := &file_users_users_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetMeResponse.ProtoReflect.Descriptor instead.
func (*GetMeResponse) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{1}
}
func (x *GetMeResponse) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
type CreateUserRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateUserRequest) Reset() {
*x = CreateUserRequest{}
mi := &file_users_users_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateUserRequest) ProtoMessage() {}
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_users_users_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{2}
}
func (x *CreateUserRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type CreateUserResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateUserResponse) Reset() {
*x = CreateUserResponse{}
mi := &file_users_users_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateUserResponse) ProtoMessage() {}
func (x *CreateUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_users_users_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUserResponse) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{3}
}
func (x *CreateUserResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
type ChangeMeRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"`
Phone *string `protobuf:"bytes,4,opt,name=phone,proto3,oneof" json:"phone,omitempty"`
FullName *string `protobuf:"bytes,5,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"`
AvatarUrl *string `protobuf:"bytes,6,opt,name=avatar_url,json=avatarUrl,proto3,oneof" json:"avatar_url,omitempty"`
CustomStatusText *string `protobuf:"bytes,7,opt,name=custom_status_text,json=customStatusText,proto3,oneof" json:"custom_status_text,omitempty"`
CustomStatusEmoji *string `protobuf:"bytes,8,opt,name=custom_status_emoji,json=customStatusEmoji,proto3,oneof" json:"custom_status_emoji,omitempty"`
Timezone *string `protobuf:"bytes,9,opt,name=timezone,proto3,oneof" json:"timezone,omitempty"`
Language *string `protobuf:"bytes,10,opt,name=language,proto3,oneof" json:"language,omitempty"`
IsPublic *bool `protobuf:"varint,11,opt,name=is_public,json=isPublic,proto3,oneof" json:"is_public,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ChangeMeRequest) Reset() {
*x = ChangeMeRequest{}
mi := &file_users_users_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ChangeMeRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChangeMeRequest) ProtoMessage() {}
func (x *ChangeMeRequest) ProtoReflect() protoreflect.Message {
mi := &file_users_users_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ChangeMeRequest.ProtoReflect.Descriptor instead.
func (*ChangeMeRequest) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{4}
}
func (x *ChangeMeRequest) GetUserId() string {
if x != nil { if x != nil {
return x.UserId return x.UserId
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetSessionId() string { type GetProfileResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Email *string `protobuf:"bytes,2,opt,name=email,proto3,oneof" json:"email,omitempty"`
Phone *string `protobuf:"bytes,3,opt,name=phone,proto3,oneof" json:"phone,omitempty"`
FullName *string `protobuf:"bytes,4,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"`
AvatarUrl *string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3,oneof" json:"avatar_url,omitempty"`
IsPublic bool `protobuf:"varint,6,opt,name=is_public,json=isPublic,proto3" json:"is_public,omitempty"`
Timezone string `protobuf:"bytes,7,opt,name=timezone,proto3" json:"timezone,omitempty"`
Language string `protobuf:"bytes,8,opt,name=language,proto3" json:"language,omitempty"`
CustomStatusText *string `protobuf:"bytes,9,opt,name=custom_status_text,json=customStatusText,proto3,oneof" json:"custom_status_text,omitempty"`
CustomStatusEmoji *string `protobuf:"bytes,10,opt,name=custom_status_emoji,json=customStatusEmoji,proto3,oneof" json:"custom_status_emoji,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetProfileResponse) Reset() {
*x = GetProfileResponse{}
mi := &file_users_users_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetProfileResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetProfileResponse) ProtoMessage() {}
func (x *GetProfileResponse) ProtoReflect() protoreflect.Message {
mi := &file_users_users_proto_msgTypes[1]
if x != nil { if x != nil {
return x.SessionId ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetProfileResponse.ProtoReflect.Descriptor instead.
func (*GetProfileResponse) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{1}
}
func (x *GetProfileResponse) GetId() string {
if x != nil {
return x.Id
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetEmail() string { func (x *GetProfileResponse) GetEmail() string {
if x != nil && x.Email != nil { if x != nil && x.Email != nil {
return *x.Email return *x.Email
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetPhone() string { func (x *GetProfileResponse) GetPhone() string {
if x != nil && x.Phone != nil { if x != nil && x.Phone != nil {
return *x.Phone return *x.Phone
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetFullName() string { func (x *GetProfileResponse) GetFullName() string {
if x != nil && x.FullName != nil { if x != nil && x.FullName != nil {
return *x.FullName return *x.FullName
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetAvatarUrl() string { func (x *GetProfileResponse) GetAvatarUrl() string {
if x != nil && x.AvatarUrl != nil { if x != nil && x.AvatarUrl != nil {
return *x.AvatarUrl return *x.AvatarUrl
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetCustomStatusText() string { func (x *GetProfileResponse) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
func (x *GetProfileResponse) GetTimezone() string {
if x != nil {
return x.Timezone
}
return ""
}
func (x *GetProfileResponse) GetLanguage() string {
if x != nil {
return x.Language
}
return ""
}
func (x *GetProfileResponse) GetCustomStatusText() string {
if x != nil && x.CustomStatusText != nil { if x != nil && x.CustomStatusText != nil {
return *x.CustomStatusText return *x.CustomStatusText
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetCustomStatusEmoji() string { func (x *GetProfileResponse) GetCustomStatusEmoji() string {
if x != nil && x.CustomStatusEmoji != nil { if x != nil && x.CustomStatusEmoji != nil {
return *x.CustomStatusEmoji return *x.CustomStatusEmoji
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetTimezone() string { type UpdateProfileRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Email *string `protobuf:"bytes,2,opt,name=email,proto3,oneof" json:"email,omitempty"`
Phone *string `protobuf:"bytes,3,opt,name=phone,proto3,oneof" json:"phone,omitempty"`
FullName *string `protobuf:"bytes,4,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"`
AvatarUrl *string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3,oneof" json:"avatar_url,omitempty"`
CustomStatusText *string `protobuf:"bytes,6,opt,name=custom_status_text,json=customStatusText,proto3,oneof" json:"custom_status_text,omitempty"`
CustomStatusEmoji *string `protobuf:"bytes,7,opt,name=custom_status_emoji,json=customStatusEmoji,proto3,oneof" json:"custom_status_emoji,omitempty"`
Timezone *string `protobuf:"bytes,8,opt,name=timezone,proto3,oneof" json:"timezone,omitempty"`
Language *string `protobuf:"bytes,9,opt,name=language,proto3,oneof" json:"language,omitempty"`
IsPublic *bool `protobuf:"varint,10,opt,name=is_public,json=isPublic,proto3,oneof" json:"is_public,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdateProfileRequest) Reset() {
*x = UpdateProfileRequest{}
mi := &file_users_users_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdateProfileRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateProfileRequest) ProtoMessage() {}
func (x *UpdateProfileRequest) ProtoReflect() protoreflect.Message {
mi := &file_users_users_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateProfileRequest.ProtoReflect.Descriptor instead.
func (*UpdateProfileRequest) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{2}
}
func (x *UpdateProfileRequest) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *UpdateProfileRequest) GetEmail() string {
if x != nil && x.Email != nil {
return *x.Email
}
return ""
}
func (x *UpdateProfileRequest) GetPhone() string {
if x != nil && x.Phone != nil {
return *x.Phone
}
return ""
}
func (x *UpdateProfileRequest) GetFullName() string {
if x != nil && x.FullName != nil {
return *x.FullName
}
return ""
}
func (x *UpdateProfileRequest) GetAvatarUrl() string {
if x != nil && x.AvatarUrl != nil {
return *x.AvatarUrl
}
return ""
}
func (x *UpdateProfileRequest) GetCustomStatusText() string {
if x != nil && x.CustomStatusText != nil {
return *x.CustomStatusText
}
return ""
}
func (x *UpdateProfileRequest) GetCustomStatusEmoji() string {
if x != nil && x.CustomStatusEmoji != nil {
return *x.CustomStatusEmoji
}
return ""
}
func (x *UpdateProfileRequest) GetTimezone() string {
if x != nil && x.Timezone != nil { if x != nil && x.Timezone != nil {
return *x.Timezone return *x.Timezone
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetLanguage() string { func (x *UpdateProfileRequest) GetLanguage() string {
if x != nil && x.Language != nil { if x != nil && x.Language != nil {
return *x.Language return *x.Language
} }
return "" return ""
} }
func (x *ChangeMeRequest) GetIsPublic() bool { func (x *UpdateProfileRequest) GetIsPublic() bool {
if x != nil && x.IsPublic != nil { if x != nil && x.IsPublic != nil {
return *x.IsPublic return *x.IsPublic
} }
return false return false
} }
type ChangeMeResponse struct { type UpdateProfileResponse struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
@@ -329,21 +305,21 @@ type ChangeMeResponse struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
func (x *ChangeMeResponse) Reset() { func (x *UpdateProfileResponse) Reset() {
*x = ChangeMeResponse{} *x = UpdateProfileResponse{}
mi := &file_users_users_proto_msgTypes[5] mi := &file_users_users_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
func (x *ChangeMeResponse) String() string { func (x *UpdateProfileResponse) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*ChangeMeResponse) ProtoMessage() {} func (*UpdateProfileResponse) ProtoMessage() {}
func (x *ChangeMeResponse) ProtoReflect() protoreflect.Message { func (x *UpdateProfileResponse) ProtoReflect() protoreflect.Message {
mi := &file_users_users_proto_msgTypes[5] mi := &file_users_users_proto_msgTypes[3]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -354,64 +330,52 @@ func (x *ChangeMeResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use ChangeMeResponse.ProtoReflect.Descriptor instead. // Deprecated: Use UpdateProfileResponse.ProtoReflect.Descriptor instead.
func (*ChangeMeResponse) Descriptor() ([]byte, []int) { func (*UpdateProfileResponse) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{5} return file_users_users_proto_rawDescGZIP(), []int{3}
} }
func (x *ChangeMeResponse) GetSuccess() bool { func (x *UpdateProfileResponse) GetSuccess() bool {
if x != nil { if x != nil {
return x.Success return x.Success
} }
return false return false
} }
func (x *ChangeMeResponse) GetMessage() string { func (x *UpdateProfileResponse) GetMessage() string {
if x != nil { if x != nil {
return x.Message return x.Message
} }
return "" return ""
} }
type User struct { // Вызывается другими сервисами при создании аккаунта
type CreateProfileRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // Обязательно передаем ID созданного аккаунта!
Username *string `protobuf:"bytes,2,opt,name=username,proto3,oneof" json:"username,omitempty"` Email *string `protobuf:"bytes,2,opt,name=email,proto3,oneof" json:"email,omitempty"`
Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` FullName *string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"`
Phone *string `protobuf:"bytes,4,opt,name=phone,proto3,oneof" json:"phone,omitempty"` Phone *string `protobuf:"bytes,4,opt,name=phone,proto3,oneof" json:"phone,omitempty"`
FullName *string `protobuf:"bytes,5,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"` AvatarUrl *string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3,oneof" json:"avatar_url,omitempty"`
IsLdap bool `protobuf:"varint,6,opt,name=is_ldap,json=isLdap,proto3" json:"is_ldap,omitempty"`
Status *string `protobuf:"bytes,7,opt,name=status,proto3,oneof" json:"status,omitempty"`
Roles []string `protobuf:"bytes,8,rep,name=roles,proto3" json:"roles,omitempty"`
AvatarUrl *string `protobuf:"bytes,9,opt,name=avatar_url,json=avatarUrl,proto3,oneof" json:"avatar_url,omitempty"`
EmployeeId *string `protobuf:"bytes,10,opt,name=employee_id,json=employeeId,proto3,oneof" json:"employee_id,omitempty"`
Presence *string `protobuf:"bytes,11,opt,name=presence,proto3,oneof" json:"presence,omitempty"`
LastActive *string `protobuf:"bytes,12,opt,name=last_active,json=lastActive,proto3,oneof" json:"last_active,omitempty"`
CustomStatusText *string `protobuf:"bytes,13,opt,name=custom_status_text,json=customStatusText,proto3,oneof" json:"custom_status_text,omitempty"`
CustomStatusEmoji *string `protobuf:"bytes,14,opt,name=custom_status_emoji,json=customStatusEmoji,proto3,oneof" json:"custom_status_emoji,omitempty"`
Timezone *string `protobuf:"bytes,15,opt,name=timezone,proto3,oneof" json:"timezone,omitempty"`
Language *string `protobuf:"bytes,16,opt,name=language,proto3,oneof" json:"language,omitempty"`
TwoFaEnabled bool `protobuf:"varint,17,opt,name=two_fa_enabled,json=twoFaEnabled,proto3" json:"two_fa_enabled,omitempty"`
HasPin bool `protobuf:"varint,18,opt,name=has_pin,json=hasPin,proto3" json:"has_pin,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
func (x *User) Reset() { func (x *CreateProfileRequest) Reset() {
*x = User{} *x = CreateProfileRequest{}
mi := &file_users_users_proto_msgTypes[6] mi := &file_users_users_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
func (x *User) String() string { func (x *CreateProfileRequest) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*User) ProtoMessage() {} func (*CreateProfileRequest) ProtoMessage() {}
func (x *User) ProtoReflect() protoreflect.Message { func (x *CreateProfileRequest) ProtoReflect() protoreflect.Message {
mi := &file_users_users_proto_msgTypes[6] mi := &file_users_users_proto_msgTypes[4]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -422,133 +386,86 @@ func (x *User) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use User.ProtoReflect.Descriptor instead. // Deprecated: Use CreateProfileRequest.ProtoReflect.Descriptor instead.
func (*User) Descriptor() ([]byte, []int) { func (*CreateProfileRequest) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{6} return file_users_users_proto_rawDescGZIP(), []int{4}
} }
func (x *User) GetId() string { func (x *CreateProfileRequest) GetUserId() string {
if x != nil { if x != nil {
return x.Id return x.UserId
} }
return "" return ""
} }
func (x *User) GetUsername() string { func (x *CreateProfileRequest) GetEmail() string {
if x != nil && x.Username != nil {
return *x.Username
}
return ""
}
func (x *User) GetEmail() string {
if x != nil && x.Email != nil { if x != nil && x.Email != nil {
return *x.Email return *x.Email
} }
return "" return ""
} }
func (x *User) GetPhone() string { func (x *CreateProfileRequest) GetFullName() string {
if x != nil && x.Phone != nil {
return *x.Phone
}
return ""
}
func (x *User) GetFullName() string {
if x != nil && x.FullName != nil { if x != nil && x.FullName != nil {
return *x.FullName return *x.FullName
} }
return "" return ""
} }
func (x *User) GetIsLdap() bool { func (x *CreateProfileRequest) GetPhone() string {
if x != nil { if x != nil && x.Phone != nil {
return x.IsLdap return *x.Phone
}
return false
}
func (x *User) GetStatus() string {
if x != nil && x.Status != nil {
return *x.Status
} }
return "" return ""
} }
func (x *User) GetRoles() []string { func (x *CreateProfileRequest) GetAvatarUrl() string {
if x != nil {
return x.Roles
}
return nil
}
func (x *User) GetAvatarUrl() string {
if x != nil && x.AvatarUrl != nil { if x != nil && x.AvatarUrl != nil {
return *x.AvatarUrl return *x.AvatarUrl
} }
return "" return ""
} }
func (x *User) GetEmployeeId() string { type CreateProfileResponse struct {
if x != nil && x.EmployeeId != nil { state protoimpl.MessageState `protogen:"open.v1"`
return *x.EmployeeId Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
} unknownFields protoimpl.UnknownFields
return "" sizeCache protoimpl.SizeCache
} }
func (x *User) GetPresence() string { func (x *CreateProfileResponse) Reset() {
if x != nil && x.Presence != nil { *x = CreateProfileResponse{}
return *x.Presence mi := &file_users_users_proto_msgTypes[5]
} ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
return "" ms.StoreMessageInfo(mi)
} }
func (x *User) GetLastActive() string { func (x *CreateProfileResponse) String() string {
if x != nil && x.LastActive != nil { return protoimpl.X.MessageStringOf(x)
return *x.LastActive
}
return ""
} }
func (x *User) GetCustomStatusText() string { func (*CreateProfileResponse) ProtoMessage() {}
if x != nil && x.CustomStatusText != nil {
return *x.CustomStatusText
}
return ""
}
func (x *User) GetCustomStatusEmoji() string { func (x *CreateProfileResponse) ProtoReflect() protoreflect.Message {
if x != nil && x.CustomStatusEmoji != nil { mi := &file_users_users_proto_msgTypes[5]
return *x.CustomStatusEmoji
}
return ""
}
func (x *User) GetTimezone() string {
if x != nil && x.Timezone != nil {
return *x.Timezone
}
return ""
}
func (x *User) GetLanguage() string {
if x != nil && x.Language != nil {
return *x.Language
}
return ""
}
func (x *User) GetTwoFaEnabled() bool {
if x != nil { if x != nil {
return x.TwoFaEnabled ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
} }
return false return ms
}
return mi.MessageOf(x)
} }
func (x *User) GetHasPin() bool { // Deprecated: Use CreateProfileResponse.ProtoReflect.Descriptor instead.
func (*CreateProfileResponse) Descriptor() ([]byte, []int) {
return file_users_users_proto_rawDescGZIP(), []int{5}
}
func (x *CreateProfileResponse) GetSuccess() bool {
if x != nil { if x != nil {
return x.HasPin return x.Success
} }
return false return false
} }
@@ -557,30 +474,42 @@ var File_users_users_proto protoreflect.FileDescriptor
const file_users_users_proto_rawDesc = "" + const file_users_users_proto_rawDesc = "" +
"\n" + "\n" +
"\x11users/users.proto\x12\busers.v1\"\x1e\n" + "\x11users/users.proto\x12\busers.v1\",\n" +
"\fGetMeRequest\x12\x0e\n" + "\x11GetProfileRequest\x12\x17\n" +
"\x02id\x18\x01 \x01(\tR\x02id\"3\n" + "\auser_id\x18\x01 \x01(\tR\x06userId\"\xbd\x03\n" +
"\rGetMeResponse\x12\"\n" + "\x12GetProfileResponse\x12\x0e\n" +
"\x04user\x18\x01 \x01(\v2\x0e.users.v1.UserR\x04user\"#\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x19\n" +
"\x11CreateUserRequest\x12\x0e\n" + "\x05email\x18\x02 \x01(\tH\x00R\x05email\x88\x01\x01\x12\x19\n" +
"\x02id\x18\x01 \x01(\tR\x02id\".\n" + "\x05phone\x18\x03 \x01(\tH\x01R\x05phone\x88\x01\x01\x12 \n" +
"\x12CreateUserResponse\x12\x18\n" + "\tfull_name\x18\x04 \x01(\tH\x02R\bfullName\x88\x01\x01\x12\"\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\"\x99\x04\n" +
"\x0fChangeMeRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" +
"\n" + "\n" +
"session_id\x18\x02 \x01(\tR\tsessionId\x12\x19\n" + "avatar_url\x18\x05 \x01(\tH\x03R\tavatarUrl\x88\x01\x01\x12\x1b\n" +
"\x05email\x18\x03 \x01(\tH\x00R\x05email\x88\x01\x01\x12\x19\n" + "\tis_public\x18\x06 \x01(\bR\bisPublic\x12\x1a\n" +
"\x05phone\x18\x04 \x01(\tH\x01R\x05phone\x88\x01\x01\x12 \n" + "\btimezone\x18\a \x01(\tR\btimezone\x12\x1a\n" +
"\tfull_name\x18\x05 \x01(\tH\x02R\bfullName\x88\x01\x01\x12\"\n" + "\blanguage\x18\b \x01(\tR\blanguage\x121\n" +
"\x12custom_status_text\x18\t \x01(\tH\x04R\x10customStatusText\x88\x01\x01\x123\n" +
"\x13custom_status_emoji\x18\n" +
" \x01(\tH\x05R\x11customStatusEmoji\x88\x01\x01B\b\n" +
"\x06_emailB\b\n" +
"\x06_phoneB\f\n" +
"\n" + "\n" +
"avatar_url\x18\x06 \x01(\tH\x03R\tavatarUrl\x88\x01\x01\x121\n" + "_full_nameB\r\n" +
"\x12custom_status_text\x18\a \x01(\tH\x04R\x10customStatusText\x88\x01\x01\x123\n" + "\v_avatar_urlB\x15\n" +
"\x13custom_status_emoji\x18\b \x01(\tH\x05R\x11customStatusEmoji\x88\x01\x01\x12\x1f\n" + "\x13_custom_status_textB\x16\n" +
"\btimezone\x18\t \x01(\tH\x06R\btimezone\x88\x01\x01\x12\x1f\n" + "\x14_custom_status_emoji\"\xff\x03\n" +
"\blanguage\x18\n" + "\x14UpdateProfileRequest\x12\x17\n" +
" \x01(\tH\aR\blanguage\x88\x01\x01\x12 \n" + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x19\n" +
"\tis_public\x18\v \x01(\bH\bR\bisPublic\x88\x01\x01B\b\n" + "\x05email\x18\x02 \x01(\tH\x00R\x05email\x88\x01\x01\x12\x19\n" +
"\x05phone\x18\x03 \x01(\tH\x01R\x05phone\x88\x01\x01\x12 \n" +
"\tfull_name\x18\x04 \x01(\tH\x02R\bfullName\x88\x01\x01\x12\"\n" +
"\n" +
"avatar_url\x18\x05 \x01(\tH\x03R\tavatarUrl\x88\x01\x01\x121\n" +
"\x12custom_status_text\x18\x06 \x01(\tH\x04R\x10customStatusText\x88\x01\x01\x123\n" +
"\x13custom_status_emoji\x18\a \x01(\tH\x05R\x11customStatusEmoji\x88\x01\x01\x12\x1f\n" +
"\btimezone\x18\b \x01(\tH\x06R\btimezone\x88\x01\x01\x12\x1f\n" +
"\blanguage\x18\t \x01(\tH\aR\blanguage\x88\x01\x01\x12 \n" +
"\tis_public\x18\n" +
" \x01(\bH\bR\bisPublic\x88\x01\x01B\b\n" +
"\x06_emailB\b\n" + "\x06_emailB\b\n" +
"\x06_phoneB\f\n" + "\x06_phoneB\f\n" +
"\n" + "\n" +
@@ -591,53 +520,29 @@ const file_users_users_proto_rawDesc = "" +
"\t_timezoneB\v\n" + "\t_timezoneB\v\n" +
"\t_languageB\f\n" + "\t_languageB\f\n" +
"\n" + "\n" +
"_is_public\"F\n" + "_is_public\"K\n" +
"\x10ChangeMeResponse\x12\x18\n" + "\x15UpdateProfileResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\"\x94\x06\n" + "\amessage\x18\x02 \x01(\tR\amessage\"\xdc\x01\n" +
"\x04User\x12\x0e\n" + "\x14CreateProfileRequest\x12\x17\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n" + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x19\n" +
"\busername\x18\x02 \x01(\tH\x00R\busername\x88\x01\x01\x12\x19\n" + "\x05email\x18\x02 \x01(\tH\x00R\x05email\x88\x01\x01\x12 \n" +
"\x05email\x18\x03 \x01(\tH\x01R\x05email\x88\x01\x01\x12\x19\n" + "\tfull_name\x18\x03 \x01(\tH\x01R\bfullName\x88\x01\x01\x12\x19\n" +
"\x05phone\x18\x04 \x01(\tH\x02R\x05phone\x88\x01\x01\x12 \n" + "\x05phone\x18\x04 \x01(\tH\x02R\x05phone\x88\x01\x01\x12\"\n" +
"\tfull_name\x18\x05 \x01(\tH\x03R\bfullName\x88\x01\x01\x12\x17\n" +
"\ais_ldap\x18\x06 \x01(\bR\x06isLdap\x12\x1b\n" +
"\x06status\x18\a \x01(\tH\x04R\x06status\x88\x01\x01\x12\x14\n" +
"\x05roles\x18\b \x03(\tR\x05roles\x12\"\n" +
"\n" + "\n" +
"avatar_url\x18\t \x01(\tH\x05R\tavatarUrl\x88\x01\x01\x12$\n" + "avatar_url\x18\x05 \x01(\tH\x03R\tavatarUrl\x88\x01\x01B\b\n" +
"\vemployee_id\x18\n" + "\x06_emailB\f\n" +
" \x01(\tH\x06R\n" +
"employeeId\x88\x01\x01\x12\x1f\n" +
"\bpresence\x18\v \x01(\tH\aR\bpresence\x88\x01\x01\x12$\n" +
"\vlast_active\x18\f \x01(\tH\bR\n" +
"lastActive\x88\x01\x01\x121\n" +
"\x12custom_status_text\x18\r \x01(\tH\tR\x10customStatusText\x88\x01\x01\x123\n" +
"\x13custom_status_emoji\x18\x0e \x01(\tH\n" +
"R\x11customStatusEmoji\x88\x01\x01\x12\x1f\n" +
"\btimezone\x18\x0f \x01(\tH\vR\btimezone\x88\x01\x01\x12\x1f\n" +
"\blanguage\x18\x10 \x01(\tH\fR\blanguage\x88\x01\x01\x12$\n" +
"\x0etwo_fa_enabled\x18\x11 \x01(\bR\ftwoFaEnabled\x12\x17\n" +
"\ahas_pin\x18\x12 \x01(\bR\x06hasPinB\v\n" +
"\t_usernameB\b\n" +
"\x06_emailB\b\n" +
"\x06_phoneB\f\n" +
"\n" + "\n" +
"_full_nameB\t\n" + "_full_nameB\b\n" +
"\a_statusB\r\n" + "\x06_phoneB\r\n" +
"\v_avatar_urlB\x0e\n" + "\v_avatar_url\"1\n" +
"\f_employee_idB\v\n" + "\x15CreateProfileResponse\x12\x18\n" +
"\t_presenceB\x0e\n" + "\asuccess\x18\x01 \x01(\bR\asuccess2\xfb\x01\n" +
"\f_last_activeB\x15\n" + "\fUsersService\x12G\n" +
"\x13_custom_status_textB\x16\n" +
"\x14_custom_status_emojiB\v\n" +
"\t_timezoneB\v\n" +
"\t_language2\xd4\x01\n" +
"\fUsersService\x128\n" +
"\x05GetMe\x12\x16.users.v1.GetMeRequest\x1a\x17.users.v1.GetMeResponse\x12A\n" +
"\bChangeMe\x12\x19.users.v1.ChangeMeRequest\x1a\x1a.users.v1.ChangeMeResponse\x12G\n" +
"\n" + "\n" +
"CreateUser\x12\x1b.users.v1.CreateUserRequest\x1a\x1c.users.v1.CreateUserResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" "GetProfile\x12\x1b.users.v1.GetProfileRequest\x1a\x1c.users.v1.GetProfileResponse\x12P\n" +
"\rUpdateProfile\x12\x1e.users.v1.UpdateProfileRequest\x1a\x1f.users.v1.UpdateProfileResponse\x12P\n" +
"\rCreateProfile\x12\x1e.users.v1.CreateProfileRequest\x1a\x1f.users.v1.CreateProfileResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
var ( var (
file_users_users_proto_rawDescOnce sync.Once file_users_users_proto_rawDescOnce sync.Once
@@ -651,29 +556,27 @@ func file_users_users_proto_rawDescGZIP() []byte {
return file_users_users_proto_rawDescData return file_users_users_proto_rawDescData
} }
var file_users_users_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_users_users_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_users_users_proto_goTypes = []any{ var file_users_users_proto_goTypes = []any{
(*GetMeRequest)(nil), // 0: users.v1.GetMeRequest (*GetProfileRequest)(nil), // 0: users.v1.GetProfileRequest
(*GetMeResponse)(nil), // 1: users.v1.GetMeResponse (*GetProfileResponse)(nil), // 1: users.v1.GetProfileResponse
(*CreateUserRequest)(nil), // 2: users.v1.CreateUserRequest (*UpdateProfileRequest)(nil), // 2: users.v1.UpdateProfileRequest
(*CreateUserResponse)(nil), // 3: users.v1.CreateUserResponse (*UpdateProfileResponse)(nil), // 3: users.v1.UpdateProfileResponse
(*ChangeMeRequest)(nil), // 4: users.v1.ChangeMeRequest (*CreateProfileRequest)(nil), // 4: users.v1.CreateProfileRequest
(*ChangeMeResponse)(nil), // 5: users.v1.ChangeMeResponse (*CreateProfileResponse)(nil), // 5: users.v1.CreateProfileResponse
(*User)(nil), // 6: users.v1.User
} }
var file_users_users_proto_depIdxs = []int32{ var file_users_users_proto_depIdxs = []int32{
6, // 0: users.v1.GetMeResponse.user:type_name -> users.v1.User 0, // 0: users.v1.UsersService.GetProfile:input_type -> users.v1.GetProfileRequest
0, // 1: users.v1.UsersService.GetMe:input_type -> users.v1.GetMeRequest 2, // 1: users.v1.UsersService.UpdateProfile:input_type -> users.v1.UpdateProfileRequest
4, // 2: users.v1.UsersService.ChangeMe:input_type -> users.v1.ChangeMeRequest 4, // 2: users.v1.UsersService.CreateProfile:input_type -> users.v1.CreateProfileRequest
2, // 3: users.v1.UsersService.CreateUser:input_type -> users.v1.CreateUserRequest 1, // 3: users.v1.UsersService.GetProfile:output_type -> users.v1.GetProfileResponse
1, // 4: users.v1.UsersService.GetMe:output_type -> users.v1.GetMeResponse 3, // 4: users.v1.UsersService.UpdateProfile:output_type -> users.v1.UpdateProfileResponse
5, // 5: users.v1.UsersService.ChangeMe:output_type -> users.v1.ChangeMeResponse 5, // 5: users.v1.UsersService.CreateProfile:output_type -> users.v1.CreateProfileResponse
3, // 6: users.v1.UsersService.CreateUser:output_type -> users.v1.CreateUserResponse 3, // [3:6] is the sub-list for method output_type
4, // [4:7] is the sub-list for method output_type 0, // [0:3] is the sub-list for method input_type
1, // [1:4] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee
1, // [1:1] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name
0, // [0:1] is the sub-list for field type_name
} }
func init() { file_users_users_proto_init() } func init() { file_users_users_proto_init() }
@@ -681,15 +584,16 @@ func file_users_users_proto_init() {
if File_users_users_proto != nil { if File_users_users_proto != nil {
return return
} }
file_users_users_proto_msgTypes[1].OneofWrappers = []any{}
file_users_users_proto_msgTypes[2].OneofWrappers = []any{}
file_users_users_proto_msgTypes[4].OneofWrappers = []any{} file_users_users_proto_msgTypes[4].OneofWrappers = []any{}
file_users_users_proto_msgTypes[6].OneofWrappers = []any{}
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_users_users_proto_rawDesc), len(file_users_users_proto_rawDesc)), RawDescriptor: unsafe.Slice(unsafe.StringData(file_users_users_proto_rawDesc), len(file_users_users_proto_rawDesc)),
NumEnums: 0, NumEnums: 0,
NumMessages: 7, NumMessages: 6,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

View File

@@ -19,18 +19,19 @@ import (
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion9
const ( const (
UsersService_GetMe_FullMethodName = "/users.v1.UsersService/GetMe" UsersService_GetProfile_FullMethodName = "/users.v1.UsersService/GetProfile"
UsersService_ChangeMe_FullMethodName = "/users.v1.UsersService/ChangeMe" UsersService_UpdateProfile_FullMethodName = "/users.v1.UsersService/UpdateProfile"
UsersService_CreateUser_FullMethodName = "/users.v1.UsersService/CreateUser" UsersService_CreateProfile_FullMethodName = "/users.v1.UsersService/CreateProfile"
) )
// UsersServiceClient is the client API for UsersService service. // UsersServiceClient is the client API for UsersService service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type UsersServiceClient interface { type UsersServiceClient interface {
GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*GetMeResponse, error) GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*GetProfileResponse, error)
ChangeMe(ctx context.Context, in *ChangeMeRequest, opts ...grpc.CallOption) (*ChangeMeResponse, error) UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*UpdateProfileResponse, error)
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) // Для системного использования (вызывается из Auth/Admin)
CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*CreateProfileResponse, error)
} }
type usersServiceClient struct { type usersServiceClient struct {
@@ -41,30 +42,30 @@ func NewUsersServiceClient(cc grpc.ClientConnInterface) UsersServiceClient {
return &usersServiceClient{cc} return &usersServiceClient{cc}
} }
func (c *usersServiceClient) GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*GetMeResponse, error) { func (c *usersServiceClient) GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*GetProfileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetMeResponse) out := new(GetProfileResponse)
err := c.cc.Invoke(ctx, UsersService_GetMe_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, UsersService_GetProfile_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *usersServiceClient) ChangeMe(ctx context.Context, in *ChangeMeRequest, opts ...grpc.CallOption) (*ChangeMeResponse, error) { func (c *usersServiceClient) UpdateProfile(ctx context.Context, in *UpdateProfileRequest, opts ...grpc.CallOption) (*UpdateProfileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ChangeMeResponse) out := new(UpdateProfileResponse)
err := c.cc.Invoke(ctx, UsersService_ChangeMe_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, UsersService_UpdateProfile_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *usersServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) { func (c *usersServiceClient) CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*CreateProfileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateUserResponse) out := new(CreateProfileResponse)
err := c.cc.Invoke(ctx, UsersService_CreateUser_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, UsersService_CreateProfile_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -75,9 +76,10 @@ func (c *usersServiceClient) CreateUser(ctx context.Context, in *CreateUserReque
// All implementations must embed UnimplementedUsersServiceServer // All implementations must embed UnimplementedUsersServiceServer
// for forward compatibility. // for forward compatibility.
type UsersServiceServer interface { type UsersServiceServer interface {
GetMe(context.Context, *GetMeRequest) (*GetMeResponse, error) GetProfile(context.Context, *GetProfileRequest) (*GetProfileResponse, error)
ChangeMe(context.Context, *ChangeMeRequest) (*ChangeMeResponse, error) UpdateProfile(context.Context, *UpdateProfileRequest) (*UpdateProfileResponse, error)
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) // Для системного использования (вызывается из Auth/Admin)
CreateProfile(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error)
mustEmbedUnimplementedUsersServiceServer() mustEmbedUnimplementedUsersServiceServer()
} }
@@ -88,14 +90,14 @@ type UsersServiceServer interface {
// pointer dereference when methods are called. // pointer dereference when methods are called.
type UnimplementedUsersServiceServer struct{} type UnimplementedUsersServiceServer struct{}
func (UnimplementedUsersServiceServer) GetMe(context.Context, *GetMeRequest) (*GetMeResponse, error) { func (UnimplementedUsersServiceServer) GetProfile(context.Context, *GetProfileRequest) (*GetProfileResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetMe not implemented") return nil, status.Error(codes.Unimplemented, "method GetProfile not implemented")
} }
func (UnimplementedUsersServiceServer) ChangeMe(context.Context, *ChangeMeRequest) (*ChangeMeResponse, error) { func (UnimplementedUsersServiceServer) UpdateProfile(context.Context, *UpdateProfileRequest) (*UpdateProfileResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ChangeMe not implemented") return nil, status.Error(codes.Unimplemented, "method UpdateProfile not implemented")
} }
func (UnimplementedUsersServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) { func (UnimplementedUsersServiceServer) CreateProfile(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error) {
return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented") return nil, status.Error(codes.Unimplemented, "method CreateProfile not implemented")
} }
func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {} func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {}
func (UnimplementedUsersServiceServer) testEmbeddedByValue() {} func (UnimplementedUsersServiceServer) testEmbeddedByValue() {}
@@ -118,56 +120,56 @@ func RegisterUsersServiceServer(s grpc.ServiceRegistrar, srv UsersServiceServer)
s.RegisterService(&UsersService_ServiceDesc, srv) s.RegisterService(&UsersService_ServiceDesc, srv)
} }
func _UsersService_GetMe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _UsersService_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMeRequest) in := new(GetProfileRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(UsersServiceServer).GetMe(ctx, in) return srv.(UsersServiceServer).GetProfile(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: UsersService_GetMe_FullMethodName, FullMethod: UsersService_GetProfile_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServiceServer).GetMe(ctx, req.(*GetMeRequest)) return srv.(UsersServiceServer).GetProfile(ctx, req.(*GetProfileRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _UsersService_ChangeMe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _UsersService_UpdateProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChangeMeRequest) in := new(UpdateProfileRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(UsersServiceServer).ChangeMe(ctx, in) return srv.(UsersServiceServer).UpdateProfile(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: UsersService_ChangeMe_FullMethodName, FullMethod: UsersService_UpdateProfile_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServiceServer).ChangeMe(ctx, req.(*ChangeMeRequest)) return srv.(UsersServiceServer).UpdateProfile(ctx, req.(*UpdateProfileRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _UsersService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _UsersService_CreateProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateUserRequest) in := new(CreateProfileRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(UsersServiceServer).CreateUser(ctx, in) return srv.(UsersServiceServer).CreateProfile(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: UsersService_CreateUser_FullMethodName, FullMethod: UsersService_CreateProfile_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) return srv.(UsersServiceServer).CreateProfile(ctx, req.(*CreateProfileRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@@ -180,16 +182,16 @@ var UsersService_ServiceDesc = grpc.ServiceDesc{
HandlerType: (*UsersServiceServer)(nil), HandlerType: (*UsersServiceServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{ {
MethodName: "GetMe", MethodName: "GetProfile",
Handler: _UsersService_GetMe_Handler, Handler: _UsersService_GetProfile_Handler,
}, },
{ {
MethodName: "ChangeMe", MethodName: "UpdateProfile",
Handler: _UsersService_ChangeMe_Handler, Handler: _UsersService_UpdateProfile_Handler,
}, },
{ {
MethodName: "CreateUser", MethodName: "CreateProfile",
Handler: _UsersService_CreateUser_Handler, Handler: _UsersService_CreateProfile_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},

View File

@@ -11,25 +11,26 @@ import { Observable } from "rxjs";
export const protobufPackage = "users.v1"; export const protobufPackage = "users.v1";
export interface GetMeRequest { export interface GetProfileRequest {
id: string; /** Берется из access токена на API шлюзе */
} userId: string;
}
export interface GetMeResponse {
user: User | undefined; export interface GetProfileResponse {
} id: string;
email?: string | undefined;
export interface CreateUserRequest { phone?: string | undefined;
id: string; fullName?: string | undefined;
} avatarUrl?: string | undefined;
isPublic: boolean;
export interface CreateUserResponse { timezone: string;
success: boolean; language: string;
} customStatusText?: string | undefined;
customStatusEmoji?: string | undefined;
export interface ChangeMeRequest { }
export interface UpdateProfileRequest {
userId: string; userId: string;
sessionId: string;
email?: string | undefined; email?: string | undefined;
phone?: string | undefined; phone?: string | undefined;
fullName?: string | undefined; fullName?: string | undefined;
@@ -41,59 +42,59 @@ export interface ChangeMeRequest {
isPublic?: boolean | undefined; isPublic?: boolean | undefined;
} }
export interface ChangeMeResponse { export interface UpdateProfileResponse {
success: boolean; success: boolean;
message: string; message: string;
} }
export interface User { /** Вызывается другими сервисами при создании аккаунта */
id: string; export interface CreateProfileRequest {
username?: string | undefined; /** Обязательно передаем ID созданного аккаунта! */
userId: string;
email?: string | undefined; email?: string | undefined;
phone?: string | undefined;
fullName?: string | undefined; fullName?: string | undefined;
isLdap: boolean; phone?: string | undefined;
status?: string | undefined;
roles: string[];
avatarUrl?: string | undefined; avatarUrl?: string | undefined;
employeeId?: string | undefined; }
presence?: string | undefined;
lastActive?: string | undefined; export interface CreateProfileResponse {
customStatusText?: string | undefined; success: boolean;
customStatusEmoji?: string | undefined;
timezone?: string | undefined;
language?: string | undefined;
twoFaEnabled: boolean;
hasPin: boolean;
} }
export const USERS_V1_PACKAGE_NAME = "users.v1"; export const USERS_V1_PACKAGE_NAME = "users.v1";
export interface UsersServiceClient { export interface UsersServiceClient {
getMe(request: GetMeRequest, metadata?: Metadata): Observable<GetMeResponse>; getProfile(request: GetProfileRequest, metadata?: Metadata): Observable<GetProfileResponse>;
changeMe(request: ChangeMeRequest, metadata?: Metadata): Observable<ChangeMeResponse>; updateProfile(request: UpdateProfileRequest, metadata?: Metadata): Observable<UpdateProfileResponse>;
createUser(request: CreateUserRequest, metadata?: Metadata): Observable<CreateUserResponse>; /** Для системного использования (вызывается из Auth/Admin) */
createProfile(request: CreateProfileRequest, metadata?: Metadata): Observable<CreateProfileResponse>;
} }
export interface UsersServiceController { export interface UsersServiceController {
getMe(request: GetMeRequest, metadata?: Metadata): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse; getProfile(
request: GetProfileRequest,
changeMe(
request: ChangeMeRequest,
metadata?: Metadata, metadata?: Metadata,
): Promise<ChangeMeResponse> | Observable<ChangeMeResponse> | ChangeMeResponse; ): Promise<GetProfileResponse> | Observable<GetProfileResponse> | GetProfileResponse;
createUser( updateProfile(
request: CreateUserRequest, request: UpdateProfileRequest,
metadata?: Metadata, metadata?: Metadata,
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse; ): Promise<UpdateProfileResponse> | Observable<UpdateProfileResponse> | UpdateProfileResponse;
/** Для системного использования (вызывается из Auth/Admin) */
createProfile(
request: CreateProfileRequest,
metadata?: Metadata,
): Promise<CreateProfileResponse> | Observable<CreateProfileResponse> | CreateProfileResponse;
} }
export function UsersServiceControllerMethods() { export function UsersServiceControllerMethods() {
return function (constructor: Function) { return function (constructor: Function) {
const grpcMethods: string[] = ["getMe", "changeMe", "createUser"]; const grpcMethods: string[] = ["getProfile", "updateProfile", "createProfile"];
for (const method of grpcMethods) { for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor); GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);