Documentation ¶
Index ¶
- Constants
- Variables
- func HttpEntry() *http.EntrySet
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type BlockAccountRequest
- func (*BlockAccountRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BlockAccountRequest) GetAccount() string
- func (x *BlockAccountRequest) GetReason() string
- func (*BlockAccountRequest) ProtoMessage()
- func (x *BlockAccountRequest) ProtoReflect() protoreflect.Message
- func (x *BlockAccountRequest) Reset()
- func (x *BlockAccountRequest) String() string
- func (req *BlockAccountRequest) Validate() error
- type CreateAccountRequest
- func (*CreateAccountRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateAccountRequest) GetAccount() string
- func (x *CreateAccountRequest) GetCreateType() CreateType
- func (x *CreateAccountRequest) GetDepartmentId() string
- func (x *CreateAccountRequest) GetDescription() string
- func (x *CreateAccountRequest) GetDomain() string
- func (x *CreateAccountRequest) GetExpiresDays() int32
- func (x *CreateAccountRequest) GetPassword() string
- func (x *CreateAccountRequest) GetProfile() *Profile
- func (x *CreateAccountRequest) GetUserType() types.UserType
- func (*CreateAccountRequest) ProtoMessage()
- func (x *CreateAccountRequest) ProtoReflect() protoreflect.Message
- func (x *CreateAccountRequest) Reset()
- func (x *CreateAccountRequest) String() string
- func (req *CreateAccountRequest) Validate() error
- type CreateType
- func (CreateType) Descriptor() protoreflect.EnumDescriptor
- func (x CreateType) Enum() *CreateType
- func (CreateType) EnumDescriptor() ([]byte, []int)deprecated
- func (t CreateType) Equal(target CreateType) bool
- func (t CreateType) IsIn(targets ...CreateType) bool
- func (t CreateType) MarshalJSON() ([]byte, error)
- func (x CreateType) Number() protoreflect.EnumNumber
- func (x CreateType) String() string
- func (CreateType) Type() protoreflect.EnumType
- func (t *CreateType) UnmarshalJSON(b []byte) error
- type DeleteAccountRequest
- func (*DeleteAccountRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteAccountRequest) GetAccount() string
- func (*DeleteAccountRequest) ProtoMessage()
- func (x *DeleteAccountRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteAccountRequest) Reset()
- func (x *DeleteAccountRequest) String() string
- type DescribeAccountRequest
- func (*DescribeAccountRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeAccountRequest) GetAccount() string
- func (*DescribeAccountRequest) ProtoMessage()
- func (x *DescribeAccountRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeAccountRequest) Reset()
- func (x *DescribeAccountRequest) String() string
- func (req *DescribeAccountRequest) Validate() error
- type Gender
- func (Gender) Descriptor() protoreflect.EnumDescriptor
- func (x Gender) Enum() *Gender
- func (Gender) EnumDescriptor() ([]byte, []int)deprecated
- func (t Gender) Equal(target Gender) bool
- func (t Gender) IsIn(targets ...Gender) bool
- func (t Gender) MarshalJSON() ([]byte, error)
- func (x Gender) Number() protoreflect.EnumNumber
- func (x Gender) String() string
- func (Gender) Type() protoreflect.EnumType
- func (t *Gender) UnmarshalJSON(b []byte) error
- type GeneratePasswordRequest
- func (*GeneratePasswordRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GeneratePasswordRequest) GetDomain() string
- func (x *GeneratePasswordRequest) GetLength() int32
- func (*GeneratePasswordRequest) ProtoMessage()
- func (x *GeneratePasswordRequest) ProtoReflect() protoreflect.Message
- func (x *GeneratePasswordRequest) Reset()
- func (x *GeneratePasswordRequest) String() string
- type GeneratePasswordResponse
- func (*GeneratePasswordResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GeneratePasswordResponse) GetPassword() string
- func (*GeneratePasswordResponse) ProtoMessage()
- func (x *GeneratePasswordResponse) ProtoReflect() protoreflect.Message
- func (x *GeneratePasswordResponse) Reset()
- func (x *GeneratePasswordResponse) String() string
- type Password
- func (p *Password) CheckPassword(password string) error
- func (*Password) Descriptor() ([]byte, []int)deprecated
- func (x *Password) GetCreateAt() int64
- func (x *Password) GetHistory() []string
- func (x *Password) GetIsExpired() bool
- func (x *Password) GetNeedReset() bool
- func (x *Password) GetPassword() string
- func (x *Password) GetResetReason() string
- func (x *Password) GetUpdateAt() int64
- func (p *Password) HistoryCount() int
- func (p *Password) IsHistory(password string) bool
- func (*Password) ProtoMessage()
- func (x *Password) ProtoReflect() protoreflect.Message
- func (x *Password) Reset()
- func (p *Password) SetExpired()
- func (p *Password) SetNeedReset(format string, a ...interface{})
- func (x *Password) String() string
- func (p *Password) Update(new *Password, maxHistory uint, needReset bool)
- type Profile
- func (*Profile) Descriptor() ([]byte, []int)deprecated
- func (x *Profile) GetAddress() string
- func (x *Profile) GetAvatar() string
- func (x *Profile) GetCity() string
- func (x *Profile) GetEmail() string
- func (x *Profile) GetGender() Gender
- func (x *Profile) GetLanguage() string
- func (x *Profile) GetNickName() string
- func (x *Profile) GetPhone() string
- func (x *Profile) GetProvince() string
- func (x *Profile) GetRealName() string
- func (p *Profile) Patch(data *Profile)
- func (*Profile) ProtoMessage()
- func (x *Profile) ProtoReflect() protoreflect.Message
- func (x *Profile) Reset()
- func (x *Profile) String() string
- func (p *Profile) ValidateInitialized() error
- type QueryAccountRequest
- func (*QueryAccountRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryAccountRequest) GetAccounts() []string
- func (x *QueryAccountRequest) GetDepartmentId() string
- func (x *QueryAccountRequest) GetDomain() string
- func (x *QueryAccountRequest) GetKeywords() string
- func (x *QueryAccountRequest) GetNamespaceId() string
- func (x *QueryAccountRequest) GetPage() *request.PageRequest
- func (x *QueryAccountRequest) GetSkipItems() bool
- func (x *QueryAccountRequest) GetUserType() types.UserType
- func (x *QueryAccountRequest) GetWithAllSub() bool
- func (x *QueryAccountRequest) GetWithDepartment() bool
- func (*QueryAccountRequest) ProtoMessage()
- func (x *QueryAccountRequest) ProtoReflect() protoreflect.Message
- func (x *QueryAccountRequest) Reset()
- func (x *QueryAccountRequest) String() string
- func (req *QueryAccountRequest) Validate() error
- type ServiceClient
- type ServiceServer
- type Set
- type Status
- func (*Status) Descriptor() ([]byte, []int)deprecated
- func (x *Status) GetLocked() bool
- func (x *Status) GetLockedReson() string
- func (x *Status) GetLockedTime() int64
- func (x *Status) GetUnlockTime() int64
- func (*Status) ProtoMessage()
- func (x *Status) ProtoReflect() protoreflect.Message
- func (x *Status) Reset()
- func (x *Status) String() string
- type UnBlockAccountRequest
- func (*UnBlockAccountRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UnBlockAccountRequest) GetAccount() string
- func (*UnBlockAccountRequest) ProtoMessage()
- func (x *UnBlockAccountRequest) ProtoReflect() protoreflect.Message
- func (x *UnBlockAccountRequest) Reset()
- func (x *UnBlockAccountRequest) String() string
- func (req *UnBlockAccountRequest) Validate() error
- type UnimplementedServiceServer
- func (UnimplementedServiceServer) BlockAccount(context.Context, *BlockAccountRequest) (*User, error)
- func (UnimplementedServiceServer) CreateAccount(context.Context, *CreateAccountRequest) (*User, error)
- func (UnimplementedServiceServer) DeleteAccount(context.Context, *DeleteAccountRequest) (*User, error)
- func (UnimplementedServiceServer) DescribeAccount(context.Context, *DescribeAccountRequest) (*User, error)
- func (UnimplementedServiceServer) GeneratePassword(context.Context, *GeneratePasswordRequest) (*GeneratePasswordResponse, error)
- func (UnimplementedServiceServer) QueryAccount(context.Context, *QueryAccountRequest) (*Set, error)
- func (UnimplementedServiceServer) UnBlockAccount(context.Context, *UnBlockAccountRequest) (*User, error)
- func (UnimplementedServiceServer) UpdateAccountPassword(context.Context, *UpdatePasswordRequest) (*Password, error)
- func (UnimplementedServiceServer) UpdateAccountProfile(context.Context, *UpdateAccountRequest) (*User, error)
- type UnsafeServiceServer
- type UpdateAccountRequest
- func (req *UpdateAccountRequest) CheckOwner(account string) bool
- func (*UpdateAccountRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateAccountRequest) GetAccount() string
- func (x *UpdateAccountRequest) GetDepartmentId() string
- func (x *UpdateAccountRequest) GetProfile() *Profile
- func (x *UpdateAccountRequest) GetUpdateMode() types1.UpdateMode
- func (*UpdateAccountRequest) ProtoMessage()
- func (x *UpdateAccountRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateAccountRequest) Reset()
- func (x *UpdateAccountRequest) String() string
- func (req *UpdateAccountRequest) Validate() error
- type UpdatePasswordRequest
- func (req *UpdatePasswordRequest) CheckOwner(account string) bool
- func (*UpdatePasswordRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdatePasswordRequest) GetAccount() string
- func (x *UpdatePasswordRequest) GetIsReset() bool
- func (x *UpdatePasswordRequest) GetNewPass() string
- func (x *UpdatePasswordRequest) GetOldPass() string
- func (*UpdatePasswordRequest) ProtoMessage()
- func (x *UpdatePasswordRequest) ProtoReflect() protoreflect.Message
- func (x *UpdatePasswordRequest) Reset()
- func (x *UpdatePasswordRequest) String() string
- func (req *UpdatePasswordRequest) Validate() error
- type User
- func (u *User) Block(reason string)
- func (u *User) ChangePassword(old, new string, maxHistory uint, needReset bool) error
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (u *User) Desensitize()
- func (x *User) GetAccount() string
- func (x *User) GetCreateAt() int64
- func (x *User) GetCreateType() CreateType
- func (x *User) GetDepartment() *department.Department
- func (x *User) GetDepartmentId() string
- func (x *User) GetDescription() string
- func (x *User) GetDomain() string
- func (x *User) GetExpiresDays() int32
- func (x *User) GetHashedPassword() *Password
- func (x *User) GetIsInitialized() bool
- func (x *User) GetProfile() *Profile
- func (x *User) GetRoles() []string
- func (x *User) GetStatus() *Status
- func (x *User) GetType() types.UserType
- func (x *User) GetUpdateAt() int64
- func (u *User) HasDepartment() bool
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- func (u *User) UnBlock() error
Constants ¶
const (
AppName = "user"
)
const (
// DefaultExiresDays 默认多少天无登录系统就冻结该用户
DefaultExiresDays = 90
)
Variables ¶
var ( Gender_name = map[int32]string{ 0: "UNKNOWN", 1: "MALE", 2: "FEMALE", } Gender_value = map[string]int32{ "UNKNOWN": 0, "MALE": 1, "FEMALE": 2, } )
Enum value maps for Gender.
var ( CreateType_name = map[int32]string{ 0: "USER_REGISTRY", 1: "DOMAIN_CREATED", 2: "LDAP_SYNC", 3: "WXWORK_SYNC", } CreateType_value = map[string]int32{ "USER_REGISTRY": 0, "DOMAIN_CREATED": 1, "LDAP_SYNC": 2, "WXWORK_SYNC": 3, } )
Enum value maps for CreateType.
var File_apps_user_pb_enum_proto protoreflect.FileDescriptor
var File_apps_user_pb_request_proto protoreflect.FileDescriptor
var File_apps_user_pb_service_proto protoreflect.FileDescriptor
var File_apps_user_pb_user_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "infraboard.keyauth.user.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "QueryAccount", Handler: _Service_QueryAccount_Handler, }, { MethodName: "DescribeAccount", Handler: _Service_DescribeAccount_Handler, }, { MethodName: "CreateAccount", Handler: _Service_CreateAccount_Handler, }, { MethodName: "BlockAccount", Handler: _Service_BlockAccount_Handler, }, { MethodName: "UnBlockAccount", Handler: _Service_UnBlockAccount_Handler, }, { MethodName: "DeleteAccount", Handler: _Service_DeleteAccount_Handler, }, { MethodName: "UpdateAccountProfile", Handler: _Service_UpdateAccountProfile_Handler, }, { MethodName: "UpdateAccountPassword", Handler: _Service_UpdateAccountPassword_Handler, }, { MethodName: "GeneratePassword", Handler: _Service_GeneratePassword_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/user/pb/service.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type BlockAccountRequest ¶
type BlockAccountRequest struct { // @gotags: json:"account" Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account"` // @gotags: json:"reason" Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason"` // contains filtered or unexported fields }
BlockAccountRequest 冻结用户
func NewBlockAccountRequest ¶
func NewBlockAccountRequest(account, reason string) *BlockAccountRequest
NewBlockAccountRequest todo
func (*BlockAccountRequest) Descriptor
deprecated
func (*BlockAccountRequest) Descriptor() ([]byte, []int)
Deprecated: Use BlockAccountRequest.ProtoReflect.Descriptor instead.
func (*BlockAccountRequest) GetAccount ¶
func (x *BlockAccountRequest) GetAccount() string
func (*BlockAccountRequest) GetReason ¶
func (x *BlockAccountRequest) GetReason() string
func (*BlockAccountRequest) ProtoMessage ¶
func (*BlockAccountRequest) ProtoMessage()
func (*BlockAccountRequest) ProtoReflect ¶
func (x *BlockAccountRequest) ProtoReflect() protoreflect.Message
func (*BlockAccountRequest) Reset ¶
func (x *BlockAccountRequest) Reset()
func (*BlockAccountRequest) String ¶
func (x *BlockAccountRequest) String() string
func (*BlockAccountRequest) Validate ¶
func (req *BlockAccountRequest) Validate() error
type CreateAccountRequest ¶
type CreateAccountRequest struct { // 域信息 // @gotags: json:"domain" validate:"required" Domain string `protobuf:"bytes,9,opt,name=domain,proto3" json:"domain" validate:"required"` // 创建方式 // @gotags: json:"create_type" CreateType CreateType `protobuf:"varint,1,opt,name=create_type,json=createType,proto3,enum=infraboard.keyauth.user.CreateType" json:"create_type"` // 用户类型 // @gotags: json:"user_type" UserType types.UserType `protobuf:"varint,2,opt,name=user_type,json=userType,proto3,enum=infraboard.keyauth.user.UserType" json:"user_type"` // 用户所属部门 // @gotags: json:"department_id" validate:"lte=200" DepartmentId string `protobuf:"bytes,3,opt,name=department_id,json=departmentId,proto3" json:"department_id" validate:"lte=200"` // 用户账号名称 // @gotags: json:"account" validate:"required,lte=60" Account string `protobuf:"bytes,4,opt,name=account,proto3" json:"account" validate:"required,lte=60"` // 用户多久未登录时(天), 冻结改用户, 防止僵尸用户的账号被利用' // @gotags: json:"expires_days" ExpiresDays int32 `protobuf:"varint,5,opt,name=expires_days,json=expiresDays,proto3" json:"expires_days"` // 用户描述 // @gotags: json:"description" Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description"` // 数据 // @gotags: json:"profile" Profile *Profile `protobuf:"bytes,7,opt,name=profile,proto3" json:"profile"` // 密码相关信息 // @gotags: json:"password" validate:"required,lte=80" Password string `protobuf:"bytes,8,opt,name=password,proto3" json:"password" validate:"required,lte=80"` // contains filtered or unexported fields }
CreateAccountRequest 创建用户请求
func NewCreateUserRequest ¶
func NewCreateUserRequest() *CreateAccountRequest
NewCreateUserRequest 创建请求
func NewCreateUserRequestWithLDAPSync ¶
func NewCreateUserRequestWithLDAPSync(username, password string) *CreateAccountRequest
NewCreateUserRequestWithLDAPSync todo
func NewCreateUserRequestWithWXWORKSync ¶
func NewCreateUserRequestWithWXWORKSync(username, password string) *CreateAccountRequest
NewCreateUserRequestWithWXWORKSync todo
func (*CreateAccountRequest) Descriptor
deprecated
func (*CreateAccountRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateAccountRequest.ProtoReflect.Descriptor instead.
func (*CreateAccountRequest) GetAccount ¶
func (x *CreateAccountRequest) GetAccount() string
func (*CreateAccountRequest) GetCreateType ¶
func (x *CreateAccountRequest) GetCreateType() CreateType
func (*CreateAccountRequest) GetDepartmentId ¶
func (x *CreateAccountRequest) GetDepartmentId() string
func (*CreateAccountRequest) GetDescription ¶
func (x *CreateAccountRequest) GetDescription() string
func (*CreateAccountRequest) GetDomain ¶
func (x *CreateAccountRequest) GetDomain() string
func (*CreateAccountRequest) GetExpiresDays ¶
func (x *CreateAccountRequest) GetExpiresDays() int32
func (*CreateAccountRequest) GetPassword ¶
func (x *CreateAccountRequest) GetPassword() string
func (*CreateAccountRequest) GetProfile ¶
func (x *CreateAccountRequest) GetProfile() *Profile
func (*CreateAccountRequest) GetUserType ¶
func (x *CreateAccountRequest) GetUserType() types.UserType
func (*CreateAccountRequest) ProtoMessage ¶
func (*CreateAccountRequest) ProtoMessage()
func (*CreateAccountRequest) ProtoReflect ¶
func (x *CreateAccountRequest) ProtoReflect() protoreflect.Message
func (*CreateAccountRequest) Reset ¶
func (x *CreateAccountRequest) Reset()
func (*CreateAccountRequest) String ¶
func (x *CreateAccountRequest) String() string
func (*CreateAccountRequest) Validate ¶
func (req *CreateAccountRequest) Validate() error
Validate 校验请求是否合法
type CreateType ¶
type CreateType int32
const ( // UserRegistry (user_registry) 用户自己注册的用户 CreateType_USER_REGISTRY CreateType = 0 // DOMAIN_CREATED (domain_admin) 域管理员创建的用户 CreateType_DOMAIN_CREATED CreateType = 1 // LDAPSync (ldap_sync) LDAP同步的用户 CreateType_LDAP_SYNC CreateType = 2 // 企业微信同步的用户; CreateType_WXWORK_SYNC CreateType = 3 )
func ParseCreateTypeFromString ¶
func ParseCreateTypeFromString(str string) (CreateType, error)
ParseCreateTypeFromString Parse CreateType from string
func (CreateType) Descriptor ¶
func (CreateType) Descriptor() protoreflect.EnumDescriptor
func (CreateType) Enum ¶
func (x CreateType) Enum() *CreateType
func (CreateType) EnumDescriptor
deprecated
func (CreateType) EnumDescriptor() ([]byte, []int)
Deprecated: Use CreateType.Descriptor instead.
func (CreateType) Number ¶
func (x CreateType) Number() protoreflect.EnumNumber
func (CreateType) String ¶
func (x CreateType) String() string
func (CreateType) Type ¶
func (CreateType) Type() protoreflect.EnumType
func (*CreateType) UnmarshalJSON ¶
func (t *CreateType) UnmarshalJSON(b []byte) error
UnmarshalJSON todo
type DeleteAccountRequest ¶
type DeleteAccountRequest struct { // @gotags: json:"account" Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account"` // contains filtered or unexported fields }
DeleteAccountRequest 删除账户
func (*DeleteAccountRequest) Descriptor
deprecated
func (*DeleteAccountRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteAccountRequest.ProtoReflect.Descriptor instead.
func (*DeleteAccountRequest) GetAccount ¶
func (x *DeleteAccountRequest) GetAccount() string
func (*DeleteAccountRequest) ProtoMessage ¶
func (*DeleteAccountRequest) ProtoMessage()
func (*DeleteAccountRequest) ProtoReflect ¶
func (x *DeleteAccountRequest) ProtoReflect() protoreflect.Message
func (*DeleteAccountRequest) Reset ¶
func (x *DeleteAccountRequest) Reset()
func (*DeleteAccountRequest) String ¶
func (x *DeleteAccountRequest) String() string
type DescribeAccountRequest ¶
type DescribeAccountRequest struct { // 用户账号名称 // @gotags: json:"account" validate:"required,lte=60" Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account" validate:"required,lte=60"` // contains filtered or unexported fields }
DescribeAccountRequest 查询用户详情请求
func NewDescriptAccountRequest ¶
func NewDescriptAccountRequest() *DescribeAccountRequest
NewDescriptAccountRequest 查询详情请求
func NewDescriptAccountRequestWithAccount ¶
func NewDescriptAccountRequestWithAccount(accout string) *DescribeAccountRequest
NewDescriptAccountRequestWithAccount 查询详情请求
func (*DescribeAccountRequest) Descriptor
deprecated
func (*DescribeAccountRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeAccountRequest.ProtoReflect.Descriptor instead.
func (*DescribeAccountRequest) GetAccount ¶
func (x *DescribeAccountRequest) GetAccount() string
func (*DescribeAccountRequest) ProtoMessage ¶
func (*DescribeAccountRequest) ProtoMessage()
func (*DescribeAccountRequest) ProtoReflect ¶
func (x *DescribeAccountRequest) ProtoReflect() protoreflect.Message
func (*DescribeAccountRequest) Reset ¶
func (x *DescribeAccountRequest) Reset()
func (*DescribeAccountRequest) String ¶
func (x *DescribeAccountRequest) String() string
func (*DescribeAccountRequest) Validate ¶
func (req *DescribeAccountRequest) Validate() error
Validate 校验详情查询
type Gender ¶
type Gender int32
func ParseGenderFromString ¶
ParseGenderFromString Parse Gender from string
func (Gender) Descriptor ¶
func (Gender) Descriptor() protoreflect.EnumDescriptor
func (Gender) EnumDescriptor
deprecated
func (Gender) Number ¶
func (x Gender) Number() protoreflect.EnumNumber
func (Gender) Type ¶
func (Gender) Type() protoreflect.EnumType
type GeneratePasswordRequest ¶
type GeneratePasswordRequest struct { // @gotags: json:"length" Length int32 `protobuf:"varint,1,opt,name=length,proto3" json:"length"` // @gotags: json:"domain" Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain"` // contains filtered or unexported fields }
GeneratePasswordRequest todo
func NewGeneratePasswordRequest ¶
func NewGeneratePasswordRequest() *GeneratePasswordRequest
NewGeneratePasswordRequest todo
func (*GeneratePasswordRequest) Descriptor
deprecated
func (*GeneratePasswordRequest) Descriptor() ([]byte, []int)
Deprecated: Use GeneratePasswordRequest.ProtoReflect.Descriptor instead.
func (*GeneratePasswordRequest) GetDomain ¶
func (x *GeneratePasswordRequest) GetDomain() string
func (*GeneratePasswordRequest) GetLength ¶
func (x *GeneratePasswordRequest) GetLength() int32
func (*GeneratePasswordRequest) ProtoMessage ¶
func (*GeneratePasswordRequest) ProtoMessage()
func (*GeneratePasswordRequest) ProtoReflect ¶
func (x *GeneratePasswordRequest) ProtoReflect() protoreflect.Message
func (*GeneratePasswordRequest) Reset ¶
func (x *GeneratePasswordRequest) Reset()
func (*GeneratePasswordRequest) String ¶
func (x *GeneratePasswordRequest) String() string
type GeneratePasswordResponse ¶
type GeneratePasswordResponse struct { // @gotags: json:"password" Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password"` // contains filtered or unexported fields }
GeneratePasswordResponse todo
func NewGeneratePasswordResponse ¶
func NewGeneratePasswordResponse(password string) *GeneratePasswordResponse
NewGeneratePasswordResponse todo
func (*GeneratePasswordResponse) Descriptor
deprecated
func (*GeneratePasswordResponse) Descriptor() ([]byte, []int)
Deprecated: Use GeneratePasswordResponse.ProtoReflect.Descriptor instead.
func (*GeneratePasswordResponse) GetPassword ¶
func (x *GeneratePasswordResponse) GetPassword() string
func (*GeneratePasswordResponse) ProtoMessage ¶
func (*GeneratePasswordResponse) ProtoMessage()
func (*GeneratePasswordResponse) ProtoReflect ¶
func (x *GeneratePasswordResponse) ProtoReflect() protoreflect.Message
func (*GeneratePasswordResponse) Reset ¶
func (x *GeneratePasswordResponse) Reset()
func (*GeneratePasswordResponse) String ¶
func (x *GeneratePasswordResponse) String() string
type Password ¶
type Password struct { // hash过后的密码 // @gotags: bson:"password" json:"password,omitempty" Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty" bson:"password"` // 密码创建时间 // @gotags: bson:"create_at" json:"create_at,omitempty" CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty" bson:"create_at"` // 密码更新时间 // @gotags: bson:"update_at" json:"update_at,omitempty" UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty" bson:"update_at"` // 密码需要被重置 // @gotags: bson:"need_reset" json:"need_reset" NeedReset bool `protobuf:"varint,4,opt,name=need_reset,json=needReset,proto3" json:"need_reset" bson:"need_reset"` // 需要重置的原因 // @gotags: bson:"reset_reason" json:"reset_reason" ResetReason string `protobuf:"bytes,5,opt,name=reset_reason,json=resetReason,proto3" json:"reset_reason" bson:"reset_reason"` // 历史密码 // @gotags: bson:"history" json:"history,omitempty" History []string `protobuf:"bytes,6,rep,name=history,proto3" json:"history,omitempty" bson:"history"` // 是否过期 // @gotags: bson:"-" json:"is_expired" IsExpired bool `protobuf:"varint,7,opt,name=is_expired,json=isExpired,proto3" json:"is_expired" bson:"-"` // contains filtered or unexported fields }
func NewHashedPassword ¶
NewHashedPassword 生产hash后的密码对象
func (*Password) CheckPassword ¶
CheckPassword 判断password 是否正确
func (*Password) Descriptor
deprecated
func (*Password) GetCreateAt ¶
func (*Password) GetHistory ¶
func (*Password) GetIsExpired ¶
func (*Password) GetNeedReset ¶
func (*Password) GetPassword ¶
func (*Password) GetResetReason ¶
func (*Password) GetUpdateAt ¶
func (*Password) ProtoMessage ¶
func (*Password) ProtoMessage()
func (*Password) ProtoReflect ¶
func (x *Password) ProtoReflect() protoreflect.Message
func (*Password) SetNeedReset ¶
SetNeedReset 需要被重置
type Profile ¶
type Profile struct { // 用户真实姓名 // @gotags: bson:"real_name" json:"real_name" validate:"lte=10" RealName string `protobuf:"bytes,1,opt,name=real_name,json=realName,proto3" json:"real_name" bson:"real_name" validate:"lte=10"` // 用户昵称, 用于在界面进行展示 // @gotags: bson:"nick_name" json:"nick_name" validate:"lte=30" NickName string `protobuf:"bytes,2,opt,name=nick_name,json=nickName,proto3" json:"nick_name" bson:"nick_name" validate:"lte=30"` // 手机号码, 用户可以通过手机进行注册和密码找回, 还可以通过手机号进行登录 // @gotags: bson:"phone" json:"phone" validate:"lte=30" Phone string `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone" bson:"phone" validate:"lte=30"` // 邮箱, 用户可以通过邮箱进行注册和照明密码 // @gotags: bson:"email" json:"email" validate:"lte=30" Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email" bson:"email" validate:"lte=30"` // 用户住址 // @gotags: bson:"address" json:"address" validate:"lte=120" Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address" bson:"address" validate:"lte=120"` // 性别 // @gotags: bson:"gender" json:"gender" validate:"lte=10" Gender Gender `protobuf:"varint,6,opt,name=gender,proto3,enum=infraboard.keyauth.user.Gender" json:"gender" bson:"gender" validate:"lte=10"` // 头像 // @gotags: bson:"avatar" json:"avatar" validate:"lte=300" Avatar string `protobuf:"bytes,7,opt,name=avatar,proto3" json:"avatar" bson:"avatar" validate:"lte=300"` // 用户使用的语言 // @gotags: bson:"language" json:"language" validate:"lte=40" Language string `protobuf:"bytes,8,opt,name=language,proto3" json:"language" bson:"language" validate:"lte=40"` // 用户所在的城市 // @gotags: bson:"city" json:"city" validate:"lte=40" City string `protobuf:"bytes,9,opt,name=city,proto3" json:"city" bson:"city" validate:"lte=40"` // 用户所在的省 // @gotags: bson:"province" json:"province" validate:"lte=40" Province string `protobuf:"bytes,10,opt,name=province,proto3" json:"province" bson:"province" validate:"lte=40"` // contains filtered or unexported fields }
Profile todo
func (*Profile) Descriptor
deprecated
func (*Profile) GetAddress ¶
func (*Profile) GetLanguage ¶
func (*Profile) GetNickName ¶
func (*Profile) GetProvince ¶
func (*Profile) GetRealName ¶
func (*Profile) ProtoMessage ¶
func (*Profile) ProtoMessage()
func (*Profile) ProtoReflect ¶
func (x *Profile) ProtoReflect() protoreflect.Message
func (*Profile) ValidateInitialized ¶
ValidateInitialized 判断初始化数据是否准备好了
type QueryAccountRequest ¶
type QueryAccountRequest struct { // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // @gotags: json:"accounts" Accounts []string `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts"` // @gotags: json:"user_type" UserType types.UserType `protobuf:"varint,3,opt,name=user_type,json=userType,proto3,enum=infraboard.keyauth.user.UserType" json:"user_type"` // @gotags: json:"namespace_id" NamespaceId string `protobuf:"bytes,4,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id"` // @gotags: json:"with_department" WithDepartment bool `protobuf:"varint,5,opt,name=with_department,json=withDepartment,proto3" json:"with_department"` // @gotags: json:"department_id" DepartmentId string `protobuf:"bytes,6,opt,name=department_id,json=departmentId,proto3" json:"department_id"` // @gotags: json:"with_all_sub" WithAllSub bool `protobuf:"varint,7,opt,name=with_all_sub,json=withAllSub,proto3" json:"with_all_sub"` // @gotags: json:"skip_items" SkipItems bool `protobuf:"varint,8,opt,name=skip_items,json=skipItems,proto3" json:"skip_items"` // @gotags: json:"keywords" Keywords string `protobuf:"bytes,9,opt,name=keywords,proto3" json:"keywords"` // @gotags: json:"domain" Domain string `protobuf:"bytes,10,opt,name=domain,proto3" json:"domain"` // contains filtered or unexported fields }
QueryAccountRequest 获取子账号列表
func NewNewQueryAccountRequestFromHTTP ¶
func NewNewQueryAccountRequestFromHTTP(r *http.Request) *QueryAccountRequest
NewNewQueryAccountRequestFromHTTP todo
func NewQueryAccountRequest ¶
func NewQueryAccountRequest() *QueryAccountRequest
NewQueryAccountRequest 列表查询请求
func (*QueryAccountRequest) Descriptor
deprecated
func (*QueryAccountRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryAccountRequest.ProtoReflect.Descriptor instead.
func (*QueryAccountRequest) GetAccounts ¶
func (x *QueryAccountRequest) GetAccounts() []string
func (*QueryAccountRequest) GetDepartmentId ¶
func (x *QueryAccountRequest) GetDepartmentId() string
func (*QueryAccountRequest) GetDomain ¶
func (x *QueryAccountRequest) GetDomain() string
func (*QueryAccountRequest) GetKeywords ¶
func (x *QueryAccountRequest) GetKeywords() string
func (*QueryAccountRequest) GetNamespaceId ¶
func (x *QueryAccountRequest) GetNamespaceId() string
func (*QueryAccountRequest) GetPage ¶
func (x *QueryAccountRequest) GetPage() *request.PageRequest
func (*QueryAccountRequest) GetSkipItems ¶
func (x *QueryAccountRequest) GetSkipItems() bool
func (*QueryAccountRequest) GetUserType ¶
func (x *QueryAccountRequest) GetUserType() types.UserType
func (*QueryAccountRequest) GetWithAllSub ¶
func (x *QueryAccountRequest) GetWithAllSub() bool
func (*QueryAccountRequest) GetWithDepartment ¶
func (x *QueryAccountRequest) GetWithDepartment() bool
func (*QueryAccountRequest) ProtoMessage ¶
func (*QueryAccountRequest) ProtoMessage()
func (*QueryAccountRequest) ProtoReflect ¶
func (x *QueryAccountRequest) ProtoReflect() protoreflect.Message
func (*QueryAccountRequest) Reset ¶
func (x *QueryAccountRequest) Reset()
func (*QueryAccountRequest) String ¶
func (x *QueryAccountRequest) String() string
func (*QueryAccountRequest) Validate ¶
func (req *QueryAccountRequest) Validate() error
Validate 校验查询参数
type ServiceClient ¶
type ServiceClient interface { // 查询用户 QueryAccount(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*Set, error) // 获取账号Profile DescribeAccount(ctx context.Context, in *DescribeAccountRequest, opts ...grpc.CallOption) (*User, error) // 创建用户 CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...grpc.CallOption) (*User, error) // 警用账号 BlockAccount(ctx context.Context, in *BlockAccountRequest, opts ...grpc.CallOption) (*User, error) // 警用账号 UnBlockAccount(ctx context.Context, in *UnBlockAccountRequest, opts ...grpc.CallOption) (*User, error) // DeleteAccount 删除用户 DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*User, error) // 更新用户 UpdateAccountProfile(ctx context.Context, in *UpdateAccountRequest, opts ...grpc.CallOption) (*User, error) // 修改用户密码 UpdateAccountPassword(ctx context.Context, in *UpdatePasswordRequest, opts ...grpc.CallOption) (*Password, error) // GeneratePassword 生成符合检测强度的随机密码 GeneratePassword(ctx context.Context, in *GeneratePasswordRequest, opts ...grpc.CallOption) (*GeneratePasswordResponse, error) }
ServiceClient is the client API for Service 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.
func NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { // 查询用户 QueryAccount(context.Context, *QueryAccountRequest) (*Set, error) // 获取账号Profile DescribeAccount(context.Context, *DescribeAccountRequest) (*User, error) // 创建用户 CreateAccount(context.Context, *CreateAccountRequest) (*User, error) // 警用账号 BlockAccount(context.Context, *BlockAccountRequest) (*User, error) // 警用账号 UnBlockAccount(context.Context, *UnBlockAccountRequest) (*User, error) // DeleteAccount 删除用户 DeleteAccount(context.Context, *DeleteAccountRequest) (*User, error) // 更新用户 UpdateAccountProfile(context.Context, *UpdateAccountRequest) (*User, error) // 修改用户密码 UpdateAccountPassword(context.Context, *UpdatePasswordRequest) (*Password, error) // GeneratePassword 生成符合检测强度的随机密码 GeneratePassword(context.Context, *GeneratePasswordRequest) (*GeneratePasswordResponse, error) // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type Set ¶
type Set struct { // @gotags: bson:"total" json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total" bson:"total"` // @gotags: bson:"items" json:"items" Items []*User `protobuf:"bytes,2,rep,name=items,proto3" json:"items" bson:"items"` // contains filtered or unexported fields }
func (*Set) Descriptor
deprecated
func (*Set) ProtoMessage ¶
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶
func (x *Set) ProtoReflect() protoreflect.Message
type Status ¶
type Status struct { // 是否冻结 // @gotags: bson:"locked" json:"locked" Locked bool `protobuf:"varint,1,opt,name=locked,proto3" json:"locked" bson:"locked"` // 冻结时间 // @gotags: bson:"locked_time" json:"locked_time,omitempty" LockedTime int64 `protobuf:"varint,2,opt,name=locked_time,json=lockedTime,proto3" json:"locked_time,omitempty" bson:"locked_time"` // 冻结原因 // @gotags: bson:"locked_reson" json:"locked_reson,omitempty" LockedReson string `protobuf:"bytes,3,opt,name=locked_reson,json=lockedReson,proto3" json:"locked_reson,omitempty" bson:"locked_reson"` // 解冻时间 // @gotags: bson:"unlock_time" json:"unlock_time,omitempty" UnlockTime int64 `protobuf:"varint,4,opt,name=unlock_time,json=unlockTime,proto3" json:"unlock_time,omitempty" bson:"unlock_time"` // contains filtered or unexported fields }
Status 用户状态
func (*Status) Descriptor
deprecated
func (*Status) GetLockedReson ¶
func (*Status) GetLockedTime ¶
func (*Status) GetUnlockTime ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
type UnBlockAccountRequest ¶
type UnBlockAccountRequest struct { // @gotags: json:"account" Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account"` // contains filtered or unexported fields }
UnBlockAccountRequest 解冻用户
func (*UnBlockAccountRequest) Descriptor
deprecated
func (*UnBlockAccountRequest) Descriptor() ([]byte, []int)
Deprecated: Use UnBlockAccountRequest.ProtoReflect.Descriptor instead.
func (*UnBlockAccountRequest) GetAccount ¶
func (x *UnBlockAccountRequest) GetAccount() string
func (*UnBlockAccountRequest) ProtoMessage ¶
func (*UnBlockAccountRequest) ProtoMessage()
func (*UnBlockAccountRequest) ProtoReflect ¶
func (x *UnBlockAccountRequest) ProtoReflect() protoreflect.Message
func (*UnBlockAccountRequest) Reset ¶
func (x *UnBlockAccountRequest) Reset()
func (*UnBlockAccountRequest) String ¶
func (x *UnBlockAccountRequest) String() string
func (*UnBlockAccountRequest) Validate ¶
func (req *UnBlockAccountRequest) Validate() error
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) BlockAccount ¶
func (UnimplementedServiceServer) BlockAccount(context.Context, *BlockAccountRequest) (*User, error)
func (UnimplementedServiceServer) CreateAccount ¶
func (UnimplementedServiceServer) CreateAccount(context.Context, *CreateAccountRequest) (*User, error)
func (UnimplementedServiceServer) DeleteAccount ¶
func (UnimplementedServiceServer) DeleteAccount(context.Context, *DeleteAccountRequest) (*User, error)
func (UnimplementedServiceServer) DescribeAccount ¶
func (UnimplementedServiceServer) DescribeAccount(context.Context, *DescribeAccountRequest) (*User, error)
func (UnimplementedServiceServer) GeneratePassword ¶
func (UnimplementedServiceServer) GeneratePassword(context.Context, *GeneratePasswordRequest) (*GeneratePasswordResponse, error)
func (UnimplementedServiceServer) QueryAccount ¶
func (UnimplementedServiceServer) QueryAccount(context.Context, *QueryAccountRequest) (*Set, error)
func (UnimplementedServiceServer) UnBlockAccount ¶
func (UnimplementedServiceServer) UnBlockAccount(context.Context, *UnBlockAccountRequest) (*User, error)
func (UnimplementedServiceServer) UpdateAccountPassword ¶
func (UnimplementedServiceServer) UpdateAccountPassword(context.Context, *UpdatePasswordRequest) (*Password, error)
func (UnimplementedServiceServer) UpdateAccountProfile ¶
func (UnimplementedServiceServer) UpdateAccountProfile(context.Context, *UpdateAccountRequest) (*User, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.
type UpdateAccountRequest ¶
type UpdateAccountRequest struct { // 更新模式 // @gotags: json:"update_mode" UpdateMode types1.UpdateMode `protobuf:"varint,1,opt,name=update_mode,json=updateMode,proto3,enum=infraboard.keyauth.types.UpdateMode" json:"update_mode"` // 用户账号名称 // @gotags: json:"account" validate:"required,lte=120" Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account" validate:"required,lte=120"` // 用户所属部门 // @gotags: json:"department_id" DepartmentId string `protobuf:"bytes,3,opt,name=department_id,json=departmentId,proto3" json:"department_id"` // profile 账号profile // @gotags: json:"profile" Profile *Profile `protobuf:"bytes,4,opt,name=profile,proto3" json:"profile"` // contains filtered or unexported fields }
UpdateAccountRequest todo
func NewPatchAccountRequest ¶
func NewPatchAccountRequest() *UpdateAccountRequest
NewPatchAccountRequest todo
func NewPutAccountRequest ¶
func NewPutAccountRequest() *UpdateAccountRequest
NewPutAccountRequest todo
func (*UpdateAccountRequest) CheckOwner ¶
func (req *UpdateAccountRequest) CheckOwner(account string) bool
func (*UpdateAccountRequest) Descriptor
deprecated
func (*UpdateAccountRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateAccountRequest.ProtoReflect.Descriptor instead.
func (*UpdateAccountRequest) GetAccount ¶
func (x *UpdateAccountRequest) GetAccount() string
func (*UpdateAccountRequest) GetDepartmentId ¶
func (x *UpdateAccountRequest) GetDepartmentId() string
func (*UpdateAccountRequest) GetProfile ¶
func (x *UpdateAccountRequest) GetProfile() *Profile
func (*UpdateAccountRequest) GetUpdateMode ¶
func (x *UpdateAccountRequest) GetUpdateMode() types1.UpdateMode
func (*UpdateAccountRequest) ProtoMessage ¶
func (*UpdateAccountRequest) ProtoMessage()
func (*UpdateAccountRequest) ProtoReflect ¶
func (x *UpdateAccountRequest) ProtoReflect() protoreflect.Message
func (*UpdateAccountRequest) Reset ¶
func (x *UpdateAccountRequest) Reset()
func (*UpdateAccountRequest) String ¶
func (x *UpdateAccountRequest) String() string
func (*UpdateAccountRequest) Validate ¶
func (req *UpdateAccountRequest) Validate() error
Validate 更新请求校验
type UpdatePasswordRequest ¶
type UpdatePasswordRequest struct { // @gotags: json:"account" Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account"` // @gotags: json:"old_pass" OldPass string `protobuf:"bytes,2,opt,name=old_pass,json=oldPass,proto3" json:"old_pass"` // @gotags: json:"new_pass" NewPass string `protobuf:"bytes,3,opt,name=new_pass,json=newPass,proto3" json:"new_pass"` // @gotags: json:"is_reset" IsReset bool `protobuf:"varint,4,opt,name=is_reset,json=isReset,proto3" json:"is_reset"` // contains filtered or unexported fields }
UpdatePasswordRequest todo
func NewUpdatePasswordRequest ¶
func NewUpdatePasswordRequest() *UpdatePasswordRequest
NewUpdatePasswordRequest todo
func (*UpdatePasswordRequest) CheckOwner ¶
func (req *UpdatePasswordRequest) CheckOwner(account string) bool
实现checkowner方法
func (*UpdatePasswordRequest) Descriptor
deprecated
func (*UpdatePasswordRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdatePasswordRequest.ProtoReflect.Descriptor instead.
func (*UpdatePasswordRequest) GetAccount ¶
func (x *UpdatePasswordRequest) GetAccount() string
func (*UpdatePasswordRequest) GetIsReset ¶
func (x *UpdatePasswordRequest) GetIsReset() bool
func (*UpdatePasswordRequest) GetNewPass ¶
func (x *UpdatePasswordRequest) GetNewPass() string
func (*UpdatePasswordRequest) GetOldPass ¶
func (x *UpdatePasswordRequest) GetOldPass() string
func (*UpdatePasswordRequest) ProtoMessage ¶
func (*UpdatePasswordRequest) ProtoMessage()
func (*UpdatePasswordRequest) ProtoReflect ¶
func (x *UpdatePasswordRequest) ProtoReflect() protoreflect.Message
func (*UpdatePasswordRequest) Reset ¶
func (x *UpdatePasswordRequest) Reset()
func (*UpdatePasswordRequest) String ¶
func (x *UpdatePasswordRequest) String() string
func (*UpdatePasswordRequest) Validate ¶
func (req *UpdatePasswordRequest) Validate() error
Validate tood
type User ¶
type User struct { // 用户所属部门 // @gotags: bson:"department_id" json:"department_id" validate:"lte=200" DepartmentId string `` /* 127-byte string literal not displayed */ // 用户账号名称 // @gotags: bson:"_id" json:"account" validate:"required,lte=60" Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account" bson:"_id" validate:"required,lte=60"` // 创建方式 // @gotags: bson:"create_type" json:"create_type" CreateType CreateType `` /* 141-byte string literal not displayed */ // 用户创建的时间 // @gotags: bson:"create_at" json:"create_at,omitempty" CreateAt int64 `protobuf:"varint,4,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty" bson:"create_at"` // 修改时间 // @gotags: bson:"update_at" json:"update_at,omitempty" UpdateAt int64 `protobuf:"varint,5,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty" bson:"update_at"` // 如果是子账号和服务账号 都需要继承主用户Domain // @gotags: bson:"domain" json:"domain,omitempty" Domain string `protobuf:"bytes,6,opt,name=domain,proto3" json:"domain,omitempty" bson:"domain"` // 是否是主账号 // @gotags: bson:"type" json:"type" Type types.UserType `protobuf:"varint,7,opt,name=type,proto3,enum=infraboard.keyauth.user.UserType" json:"type" bson:"type"` // 数据 // @gotags: bson:"profile" json:"profile" Profile *Profile `protobuf:"bytes,8,opt,name=profile,proto3" json:"profile" bson:"profile"` // 用户的角色(当携带Namesapce查询时会有) // @gotags: bson:"-" json:"roles,omitempty" Roles []string `protobuf:"bytes,9,rep,name=roles,proto3" json:"roles,omitempty" bson:"-"` // 用户多久未登录时(天), 冻结改用户, 防止僵尸用户的账号被利用 // @gotags: bson:"expires_days" json:"expires_days" ExpiresDays int32 `protobuf:"varint,10,opt,name=expires_days,json=expiresDays,proto3" json:"expires_days" bson:"expires_days"` // 用户描述 // @gotags: json:"description" Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description"` // 用户是否初始化 // @gotags: bson:"is_initialized" json:"is_initialized" IsInitialized bool `protobuf:"varint,12,opt,name=is_initialized,json=isInitialized,proto3" json:"is_initialized" bson:"is_initialized"` // 密码相关信息 // @gotags: bson:"password" json:"password" HashedPassword *Password `protobuf:"bytes,13,opt,name=hashed_password,json=hashedPassword,proto3" json:"password" bson:"password"` // 用户状态 // @gotags: bson:"status" json:"status" Status *Status `protobuf:"bytes,14,opt,name=status,proto3" json:"status" bson:"status"` // 部门 // @gotags: bson:"-" json:"department,omitempty" Department *department.Department `protobuf:"bytes,15,opt,name=department,proto3" json:"department,omitempty" bson:"-"` // contains filtered or unexported fields }
User info
func (*User) ChangePassword ¶
ChangePassword 修改用户密码
func (*User) Descriptor
deprecated
func (*User) GetAccount ¶
func (*User) GetCreateAt ¶
func (*User) GetCreateType ¶
func (x *User) GetCreateType() CreateType
func (*User) GetDepartment ¶
func (x *User) GetDepartment() *department.Department
func (*User) GetDepartmentId ¶
func (*User) GetDescription ¶
func (*User) GetExpiresDays ¶
func (*User) GetHashedPassword ¶
func (*User) GetIsInitialized ¶
func (*User) GetProfile ¶
func (*User) GetUpdateAt ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message