Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
- type CREATE_BY
- func (CREATE_BY) Descriptor() protoreflect.EnumDescriptor
- func (x CREATE_BY) Enum() *CREATE_BY
- func (CREATE_BY) EnumDescriptor() ([]byte, []int)deprecated
- func (t CREATE_BY) Equal(target CREATE_BY) bool
- func (t CREATE_BY) IsIn(targets ...CREATE_BY) bool
- func (t CREATE_BY) MarshalJSON() ([]byte, error)
- func (x CREATE_BY) Number() protoreflect.EnumNumber
- func (x CREATE_BY) String() string
- func (CREATE_BY) Type() protoreflect.EnumType
- func (t *CREATE_BY) UnmarshalJSON(b []byte) error
- type CreateUserRequest
- func (*CreateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserRequest) GetCreateBy() CREATE_BY
- func (x *CreateUserRequest) GetDescription() string
- func (x *CreateUserRequest) GetDomain() string
- func (x *CreateUserRequest) GetPassword() string
- func (x *CreateUserRequest) GetProvider() PROVIDER
- func (x *CreateUserRequest) GetType() TYPE
- func (x *CreateUserRequest) GetUsername() string
- func (*CreateUserRequest) ProtoMessage()
- func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUserRequest) Reset()
- func (x *CreateUserRequest) String() string
- func (req *CreateUserRequest) Validate() error
- type DESCRIBE_BY
- func (DESCRIBE_BY) Descriptor() protoreflect.EnumDescriptor
- func (x DESCRIBE_BY) Enum() *DESCRIBE_BY
- func (DESCRIBE_BY) EnumDescriptor() ([]byte, []int)deprecated
- func (t DESCRIBE_BY) Equal(target DESCRIBE_BY) bool
- func (t DESCRIBE_BY) IsIn(targets ...DESCRIBE_BY) bool
- func (t DESCRIBE_BY) MarshalJSON() ([]byte, error)
- func (x DESCRIBE_BY) Number() protoreflect.EnumNumber
- func (x DESCRIBE_BY) String() string
- func (DESCRIBE_BY) Type() protoreflect.EnumType
- func (t *DESCRIBE_BY) UnmarshalJSON(b []byte) error
- type DeleteUserRequest
- type DescribeUserRequest
- func (*DescribeUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeUserRequest) GetDescribeBy() DESCRIBE_BY
- func (x *DescribeUserRequest) GetId() string
- func (x *DescribeUserRequest) GetUsername() string
- func (*DescribeUserRequest) ProtoMessage()
- func (x *DescribeUserRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeUserRequest) Reset()
- func (x *DescribeUserRequest) String() string
- 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 PROVIDER
- func (PROVIDER) Descriptor() protoreflect.EnumDescriptor
- func (x PROVIDER) Enum() *PROVIDER
- func (PROVIDER) EnumDescriptor() ([]byte, []int)deprecated
- func (t PROVIDER) Equal(target PROVIDER) bool
- func (t PROVIDER) IsIn(targets ...PROVIDER) bool
- func (t PROVIDER) MarshalJSON() ([]byte, error)
- func (x PROVIDER) Number() protoreflect.EnumNumber
- func (x PROVIDER) String() string
- func (PROVIDER) Type() protoreflect.EnumType
- func (t *PROVIDER) UnmarshalJSON(b []byte) error
- type Password
- func (p *Password) CheckPassword(password string) error
- func (*Password) Descriptor() ([]byte, []int)deprecated
- func (x *Password) GetCreateAt() int64
- func (x *Password) GetExpiredDays() uint32
- func (x *Password) GetExpiredRemind() uint32
- func (x *Password) GetHistory() []string
- func (x *Password) GetNeedReset() bool
- func (x *Password) GetPassword() string
- func (x *Password) GetResetReason() string
- func (x *Password) GetUpdateAt() int64
- func (*Password) ProtoMessage()
- func (x *Password) ProtoReflect() protoreflect.Message
- func (x *Password) Reset()
- func (p *Password) SetNeedReset(format string, a ...interface{})
- func (x *Password) String() string
- 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 (*Profile) ProtoMessage()
- func (x *Profile) ProtoReflect() protoreflect.Message
- func (x *Profile) Reset()
- func (x *Profile) String() string
- type QueryUserRequest
- func (*QueryUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryUserRequest) GetDomain() string
- func (x *QueryUserRequest) GetKeywords() string
- func (x *QueryUserRequest) GetPage() *request.PageRequest
- func (x *QueryUserRequest) GetProvider() PROVIDER
- func (x *QueryUserRequest) GetSkipItems() bool
- func (x *QueryUserRequest) GetType() TYPE
- func (x *QueryUserRequest) GetUserIds() []string
- func (*QueryUserRequest) ProtoMessage()
- func (x *QueryUserRequest) ProtoReflect() protoreflect.Message
- func (x *QueryUserRequest) Reset()
- func (x *QueryUserRequest) String() string
- func (req *QueryUserRequest) WithType(t TYPE)
- type RPCClient
- type RPCServer
- type ResetPasswordRequest
- func (*ResetPasswordRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ResetPasswordRequest) GetIsReset() bool
- func (x *ResetPasswordRequest) GetNewPass() string
- func (x *ResetPasswordRequest) GetResetReason() string
- func (x *ResetPasswordRequest) GetUserId() string
- func (*ResetPasswordRequest) ProtoMessage()
- func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message
- func (x *ResetPasswordRequest) Reset()
- func (x *ResetPasswordRequest) String() string
- type Service
- 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 TYPE
- func (TYPE) Descriptor() protoreflect.EnumDescriptor
- func (x TYPE) Enum() *TYPE
- func (TYPE) EnumDescriptor() ([]byte, []int)deprecated
- func (t TYPE) Equal(target TYPE) bool
- func (t TYPE) IsIn(targets ...TYPE) bool
- func (t TYPE) MarshalJSON() ([]byte, error)
- func (x TYPE) Number() protoreflect.EnumNumber
- func (x TYPE) String() string
- func (TYPE) Type() protoreflect.EnumType
- func (t *TYPE) UnmarshalJSON(b []byte) error
- type UnimplementedRPCServer
- type UnsafeRPCServer
- type UpdatePasswordRequest
- func (*UpdatePasswordRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdatePasswordRequest) GetIsReset() bool
- func (x *UpdatePasswordRequest) GetNewPass() string
- func (x *UpdatePasswordRequest) GetOldPass() string
- func (x *UpdatePasswordRequest) GetResetReason() string
- func (x *UpdatePasswordRequest) GetUserId() string
- func (*UpdatePasswordRequest) ProtoMessage()
- func (x *UpdatePasswordRequest) ProtoReflect() protoreflect.Message
- func (x *UpdatePasswordRequest) Reset()
- func (x *UpdatePasswordRequest) String() string
- type UpdateUserRequest
- func (*UpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserRequest) GetProfile() *Profile
- func (x *UpdateUserRequest) GetUpdateMode() request1.UpdateMode
- func (x *UpdateUserRequest) GetUserId() string
- func (*UpdateUserRequest) ProtoMessage()
- func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateUserRequest) Reset()
- func (x *UpdateUserRequest) String() string
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (u *User) Desensitize()
- func (x *User) GetCreateAt() int64
- func (x *User) GetId() string
- func (x *User) GetIsInitialized() bool
- func (x *User) GetPassword() *Password
- func (x *User) GetProfile() *Profile
- func (x *User) GetSpec() *CreateUserRequest
- func (x *User) GetStatus() *Status
- func (x *User) GetUpdateAt() int64
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserSet
- func (s *UserSet) Add(item *User)
- func (*UserSet) Descriptor() ([]byte, []int)deprecated
- func (x *UserSet) GetItems() []*User
- func (x *UserSet) GetTotal() int64
- func (*UserSet) ProtoMessage()
- func (x *UserSet) ProtoReflect() protoreflect.Message
- func (x *UserSet) Reset()
- func (x *UserSet) String() string
Constants ¶
const (
AppName = "user"
)
Variables ¶
var ( DESCRIBE_BY_name = map[int32]string{ 0: "USER_ID", 1: "USER_NAME", } DESCRIBE_BY_value = map[string]int32{ "USER_ID": 0, "USER_NAME": 1, } )
Enum value maps for DESCRIBE_BY.
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 ( PROVIDER_name = map[int32]string{ 0: "LOCAL", 1: "LDAP", } PROVIDER_value = map[string]int32{ "LOCAL": 0, "LDAP": 1, } )
Enum value maps for PROVIDER.
var ( TYPE_name = map[int32]string{ 0: "SUB", 10: "PRIMARY", 15: "SUPPER", } TYPE_value = map[string]int32{ "SUB": 0, "PRIMARY": 10, "SUPPER": 15, } )
Enum value maps for TYPE.
var ( CREATE_BY_name = map[int32]string{ 0: "ADMIN", 1: "SELF", } CREATE_BY_value = map[string]int32{ "ADMIN": 0, "SELF": 1, } )
Enum value maps for CREATE_BY.
var File_apps_user_pb_rpc_proto protoreflect.FileDescriptor
var File_apps_user_pb_user_proto protoreflect.FileDescriptor
var RPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go8.devcloud.mcenter.user.RPC", HandlerType: (*RPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "QueryUser", Handler: _RPC_QueryUser_Handler, }, { MethodName: "DescribeUser", Handler: _RPC_DescribeUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/user/pb/rpc.proto", }
RPC_ServiceDesc is the grpc.ServiceDesc for RPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRPCServer ¶
func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
Types ¶
type CREATE_BY ¶
type CREATE_BY int32
func ParseCREATE_BYFromString ¶
ParseCREATE_BYFromString Parse CREATE_BY from string
func (CREATE_BY) Descriptor ¶
func (CREATE_BY) Descriptor() protoreflect.EnumDescriptor
func (CREATE_BY) EnumDescriptor
deprecated
func (CREATE_BY) Number ¶
func (x CREATE_BY) Number() protoreflect.EnumNumber
func (CREATE_BY) Type ¶
func (CREATE_BY) Type() protoreflect.EnumType
func (*CREATE_BY) UnmarshalJSON ¶
UnmarshalJSON todo
type CreateUserRequest ¶
type CreateUserRequest struct { // 账号提供方 // @gotags: json:"provider" bson:"provider" Provider PROVIDER `protobuf:"varint,1,opt,name=provider,proto3,enum=go8.devcloud.mcenter.user.PROVIDER" json:"provider" bson:"provider"` // 用户类型 // @gotags: json:"type" bson:"type" Type TYPE `protobuf:"varint,2,opt,name=type,proto3,enum=go8.devcloud.mcenter.user.TYPE" json:"type" bson:"type"` // 创建类型 // @gotags: json:"create_by" bson:"create_by" CreateBy CREATE_BY `` /* 134-byte string literal not displayed */ // 域信息 // @gotags: json:"domain" bson:"domain" validate:"required" Domain string `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain" bson:"domain" validate:"required"` // 用户账号名称 // @gotags: json:"username" bson:"username" validate:"required,lte=60" Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username" bson:"username" validate:"required,lte=60"` // 密码相关信息 // @gotags: json:"password" bson:"-" validate:"required,lte=80" Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password" bson:"-" validate:"required,lte=80"` // 用户描述 // @gotags: json:"description" Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` // contains filtered or unexported fields }
CreateUserRequest 创建用户请求
func NewCreateUserRequest ¶
func NewCreateUserRequest() *CreateUserRequest
func (*CreateUserRequest) Descriptor
deprecated
func (*CreateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) GetCreateBy ¶
func (x *CreateUserRequest) GetCreateBy() CREATE_BY
func (*CreateUserRequest) GetDescription ¶
func (x *CreateUserRequest) GetDescription() string
func (*CreateUserRequest) GetDomain ¶
func (x *CreateUserRequest) GetDomain() string
func (*CreateUserRequest) GetPassword ¶
func (x *CreateUserRequest) GetPassword() string
func (*CreateUserRequest) GetProvider ¶
func (x *CreateUserRequest) GetProvider() PROVIDER
func (*CreateUserRequest) GetType ¶
func (x *CreateUserRequest) GetType() TYPE
func (*CreateUserRequest) GetUsername ¶
func (x *CreateUserRequest) GetUsername() string
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) ProtoReflect ¶
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUserRequest) Reset ¶
func (x *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (x *CreateUserRequest) String() string
func (*CreateUserRequest) Validate ¶
func (req *CreateUserRequest) Validate() error
Validate 校验请求是否合法
type DESCRIBE_BY ¶
type DESCRIBE_BY int32
const ( // 通过UserId查询用户 DESCRIBE_BY_USER_ID DESCRIBE_BY = 0 // 通过Username查询用户 DESCRIBE_BY_USER_NAME DESCRIBE_BY = 1 )
func ParseDESCRIBE_BYFromString ¶
func ParseDESCRIBE_BYFromString(str string) (DESCRIBE_BY, error)
ParseDESCRIBE_BYFromString Parse DESCRIBE_BY from string
func (DESCRIBE_BY) Descriptor ¶
func (DESCRIBE_BY) Descriptor() protoreflect.EnumDescriptor
func (DESCRIBE_BY) Enum ¶
func (x DESCRIBE_BY) Enum() *DESCRIBE_BY
func (DESCRIBE_BY) EnumDescriptor
deprecated
func (DESCRIBE_BY) EnumDescriptor() ([]byte, []int)
Deprecated: Use DESCRIBE_BY.Descriptor instead.
func (DESCRIBE_BY) MarshalJSON ¶
func (t DESCRIBE_BY) MarshalJSON() ([]byte, error)
MarshalJSON todo
func (DESCRIBE_BY) Number ¶
func (x DESCRIBE_BY) Number() protoreflect.EnumNumber
func (DESCRIBE_BY) String ¶
func (x DESCRIBE_BY) String() string
func (DESCRIBE_BY) Type ¶
func (DESCRIBE_BY) Type() protoreflect.EnumType
func (*DESCRIBE_BY) UnmarshalJSON ¶
func (t *DESCRIBE_BY) UnmarshalJSON(b []byte) error
UnmarshalJSON todo
type DeleteUserRequest ¶
type DeleteUserRequest struct { // 用户账号id // @gotags: json:"user_ids" validate:"required,lte=60" UserIds []string `protobuf:"bytes,2,rep,name=user_ids,json=userIds,proto3" json:"user_ids" validate:"required,lte=60"` // contains filtered or unexported fields }
func (*DeleteUserRequest) Descriptor
deprecated
func (*DeleteUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.
func (*DeleteUserRequest) GetUserIds ¶
func (x *DeleteUserRequest) GetUserIds() []string
func (*DeleteUserRequest) ProtoMessage ¶
func (*DeleteUserRequest) ProtoMessage()
func (*DeleteUserRequest) ProtoReflect ¶
func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message
func (*DeleteUserRequest) Reset ¶
func (x *DeleteUserRequest) Reset()
func (*DeleteUserRequest) String ¶
func (x *DeleteUserRequest) String() string
type DescribeUserRequest ¶
type DescribeUserRequest struct { // 查询方式 // @gotags: json:"describe_by" DescribeBy DESCRIBE_BY `protobuf:"varint,1,opt,name=describe_by,json=describeBy,proto3,enum=go8.devcloud.mcenter.user.DESCRIBE_BY" json:"describe_by"` // 用户账号id // @gotags: json:"id" Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id"` // 用户账号 // @gotags: json:"username" Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username"` // contains filtered or unexported fields }
DescribeUserRequest 查询用户详情
func NewDescriptUserRequestWithId ¶
func NewDescriptUserRequestWithId(id string) *DescribeUserRequest
NewDescriptUserRequestWithId 查询详情请求
func NewDescriptUserRequestWithName ¶
func NewDescriptUserRequestWithName(username string) *DescribeUserRequest
NewDescriptUserRequestWithId 查询详情请求
func (*DescribeUserRequest) Descriptor
deprecated
func (*DescribeUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeUserRequest.ProtoReflect.Descriptor instead.
func (*DescribeUserRequest) GetDescribeBy ¶
func (x *DescribeUserRequest) GetDescribeBy() DESCRIBE_BY
func (*DescribeUserRequest) GetId ¶
func (x *DescribeUserRequest) GetId() string
func (*DescribeUserRequest) GetUsername ¶
func (x *DescribeUserRequest) GetUsername() string
func (*DescribeUserRequest) ProtoMessage ¶
func (*DescribeUserRequest) ProtoMessage()
func (*DescribeUserRequest) ProtoReflect ¶
func (x *DescribeUserRequest) ProtoReflect() protoreflect.Message
func (*DescribeUserRequest) Reset ¶
func (x *DescribeUserRequest) Reset()
func (*DescribeUserRequest) String ¶
func (x *DescribeUserRequest) String() string
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 PROVIDER ¶
type PROVIDER int32
func ParsePROVIDERFromString ¶
ParsePROVIDERFromString Parse PROVIDER from string
func (PROVIDER) Descriptor ¶
func (PROVIDER) Descriptor() protoreflect.EnumDescriptor
func (PROVIDER) EnumDescriptor
deprecated
func (PROVIDER) Number ¶
func (x PROVIDER) Number() protoreflect.EnumNumber
func (PROVIDER) Type ¶
func (PROVIDER) Type() protoreflect.EnumType
func (*PROVIDER) UnmarshalJSON ¶
UnmarshalJSON todo
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" CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at" bson:"create_at"` // 密码更新时间 // @gotags: bson:"update_at" json:"update_at" UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at" 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:"expired_days" json:"expired_days" ExpiredDays uint32 `protobuf:"varint,6,opt,name=expired_days,json=expiredDays,proto3" json:"expired_days" bson:"expired_days"` // 密码过期前多少天开始提醒 // @gotags: bson:"expired_remind" json:"expired_remind" ExpiredRemind uint32 `protobuf:"varint,7,opt,name=expired_remind,json=expiredRemind,proto3" json:"expired_remind" bson:"expired_remind"` // 历史密码 // @gotags: bson:"history" json:"history,omitempty" History []string `protobuf:"bytes,8,rep,name=history,proto3" json:"history,omitempty" bson:"history"` // contains filtered or unexported fields }
func NewHashedPassword ¶
NewHashedPassword 生产hash后的密码对象 bcrypt专门用于密码hash的 散列算法
func (*Password) CheckPassword ¶
CheckPassword 判断password 是否正确, 是明文的
func (*Password) Descriptor
deprecated
func (*Password) GetCreateAt ¶
func (*Password) GetExpiredDays ¶
func (*Password) GetExpiredRemind ¶
func (*Password) GetHistory ¶
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 `` /* 126-byte string literal not displayed */ // 头像 // @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
type QueryUserRequest ¶
type QueryUserRequest struct { // 分页参数 // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // 用户所属Domain // @gotags: json:"domain" validate:"required" Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain" validate:"required"` // 账号提供方 // @gotags: json:"provider" Provider *PROVIDER `protobuf:"varint,3,opt,name=provider,proto3,enum=go8.devcloud.mcenter.user.PROVIDER,oneof" json:"provider"` // 用户类型 // @gotags: json:"type" Type *TYPE `protobuf:"varint,4,opt,name=type,proto3,enum=go8.devcloud.mcenter.user.TYPE,oneof" json:"type"` // 通过Id // @gotags: json:"user_ids" UserIds []string `protobuf:"bytes,5,rep,name=user_ids,json=userIds,proto3" json:"user_ids"` // 是否获取数据 // @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"` // contains filtered or unexported fields }
QueryUserRequest 获取子账号列表
func NewQueryUserRequestFromHTTP ¶
func NewQueryUserRequestFromHTTP(r *http.Request) *QueryUserRequest
NewQueryUserRequestFromHTTP todo
func (*QueryUserRequest) Descriptor
deprecated
func (*QueryUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryUserRequest.ProtoReflect.Descriptor instead.
func (*QueryUserRequest) GetDomain ¶
func (x *QueryUserRequest) GetDomain() string
func (*QueryUserRequest) GetKeywords ¶
func (x *QueryUserRequest) GetKeywords() string
func (*QueryUserRequest) GetPage ¶
func (x *QueryUserRequest) GetPage() *request.PageRequest
func (*QueryUserRequest) GetProvider ¶
func (x *QueryUserRequest) GetProvider() PROVIDER
func (*QueryUserRequest) GetSkipItems ¶
func (x *QueryUserRequest) GetSkipItems() bool
func (*QueryUserRequest) GetType ¶
func (x *QueryUserRequest) GetType() TYPE
func (*QueryUserRequest) GetUserIds ¶
func (x *QueryUserRequest) GetUserIds() []string
func (*QueryUserRequest) ProtoMessage ¶
func (*QueryUserRequest) ProtoMessage()
func (*QueryUserRequest) ProtoReflect ¶
func (x *QueryUserRequest) ProtoReflect() protoreflect.Message
func (*QueryUserRequest) Reset ¶
func (x *QueryUserRequest) Reset()
func (*QueryUserRequest) String ¶
func (x *QueryUserRequest) String() string
func (*QueryUserRequest) WithType ¶
func (req *QueryUserRequest) WithType(t TYPE)
type RPCClient ¶
type RPCClient interface { // 查询用户列表 QueryUser(ctx context.Context, in *QueryUserRequest, opts ...grpc.CallOption) (*UserSet, error) // 查询用户详情 DescribeUser(ctx context.Context, in *DescribeUserRequest, opts ...grpc.CallOption) (*User, error) }
RPCClient is the client API for RPC 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 NewRPCClient ¶
func NewRPCClient(cc grpc.ClientConnInterface) RPCClient
type RPCServer ¶
type RPCServer interface { // 查询用户列表 QueryUser(context.Context, *QueryUserRequest) (*UserSet, error) // 查询用户详情 DescribeUser(context.Context, *DescribeUserRequest) (*User, error) // contains filtered or unexported methods }
RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility
type ResetPasswordRequest ¶
type ResetPasswordRequest struct { // 用户名 // @gotags: json:"user_id" UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id"` // 新密码 // @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"` // 重置原因 // @gotags: json:"reset_reason" ResetReason string `protobuf:"bytes,5,opt,name=reset_reason,json=resetReason,proto3" json:"reset_reason"` // contains filtered or unexported fields }
重置密码, 用户忘了自己的密码, 管理员使用
func (*ResetPasswordRequest) Descriptor
deprecated
func (*ResetPasswordRequest) Descriptor() ([]byte, []int)
Deprecated: Use ResetPasswordRequest.ProtoReflect.Descriptor instead.
func (*ResetPasswordRequest) GetIsReset ¶
func (x *ResetPasswordRequest) GetIsReset() bool
func (*ResetPasswordRequest) GetNewPass ¶
func (x *ResetPasswordRequest) GetNewPass() string
func (*ResetPasswordRequest) GetResetReason ¶
func (x *ResetPasswordRequest) GetResetReason() string
func (*ResetPasswordRequest) GetUserId ¶
func (x *ResetPasswordRequest) GetUserId() string
func (*ResetPasswordRequest) ProtoMessage ¶
func (*ResetPasswordRequest) ProtoMessage()
func (*ResetPasswordRequest) ProtoReflect ¶
func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message
func (*ResetPasswordRequest) Reset ¶
func (x *ResetPasswordRequest) Reset()
func (*ResetPasswordRequest) String ¶
func (x *ResetPasswordRequest) String() string
type Service ¶
type Service interface { // 创建用户 CreateUser(context.Context, *CreateUserRequest) (*User, error) // 查询用户列表 UpdateUser(context.Context, *UpdateUserRequest) (*User, error) // 删除用户 DeleteUser(context.Context, *DeleteUserRequest) (*User, error) // 修改用户密码, 用户需要知道原先密码 UpdatePassword(context.Context, *UpdatePasswordRequest) (*Password, error) // 重置密码, 无需知道原先密码, 主账号执行 ResetPassword(context.Context, *ResetPasswordRequest) (*Password, error) // rpc接口 RPCServer }
模块内部接口(进程内部调用接口) RPC只暴露查询接口
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" LockedTime int64 `protobuf:"varint,2,opt,name=locked_time,json=lockedTime,proto3" json:"locked_time" bson:"locked_time"` // 冻结原因 // @gotags: bson:"locked_reson" json:"locked_reson" LockedReson string `protobuf:"bytes,3,opt,name=locked_reson,json=lockedReson,proto3" json:"locked_reson" bson:"locked_reson"` // 解冻时间 // @gotags: bson:"unlock_time" json:"unlock_time" UnlockTime int64 `protobuf:"varint,4,opt,name=unlock_time,json=unlockTime,proto3" json:"unlock_time" 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 TYPE ¶
type TYPE int32
为了防止越权, 用户可以调整的权限范围只有10已下的权限
func ParseTYPEFromString ¶
ParseTYPEFromString Parse TYPE from string
func (TYPE) Descriptor ¶
func (TYPE) Descriptor() protoreflect.EnumDescriptor
func (TYPE) EnumDescriptor
deprecated
func (TYPE) Number ¶
func (x TYPE) Number() protoreflect.EnumNumber
func (TYPE) Type ¶
func (TYPE) Type() protoreflect.EnumType
type UnimplementedRPCServer ¶
type UnimplementedRPCServer struct { }
UnimplementedRPCServer must be embedded to have forward compatible implementations.
func (UnimplementedRPCServer) DescribeUser ¶
func (UnimplementedRPCServer) DescribeUser(context.Context, *DescribeUserRequest) (*User, error)
func (UnimplementedRPCServer) QueryUser ¶
func (UnimplementedRPCServer) QueryUser(context.Context, *QueryUserRequest) (*UserSet, error)
type UnsafeRPCServer ¶
type UnsafeRPCServer interface {
// contains filtered or unexported methods
}
UnsafeRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RPCServer will result in compilation errors.
type UpdatePasswordRequest ¶
type UpdatePasswordRequest struct { // 用户Id // @gotags: json:"user_id" UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id"` // 旧密码 // @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"` // 重置原因 // @gotags: json:"reset_reason" ResetReason string `protobuf:"bytes,5,opt,name=reset_reason,json=resetReason,proto3" json:"reset_reason"` // contains filtered or unexported fields }
UpdatePasswordRequest 密码更新(需要知道原密码) 用户自己使用
func (*UpdatePasswordRequest) Descriptor
deprecated
func (*UpdatePasswordRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdatePasswordRequest.ProtoReflect.Descriptor instead.
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) GetResetReason ¶
func (x *UpdatePasswordRequest) GetResetReason() string
func (*UpdatePasswordRequest) GetUserId ¶
func (x *UpdatePasswordRequest) GetUserId() 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
type UpdateUserRequest ¶
type UpdateUserRequest struct { // 更新模式 // @gotags: json:"update_mode" UpdateMode request1.UpdateMode `protobuf:"varint,1,opt,name=update_mode,json=updateMode,proto3,enum=infraboard.mcube.request.UpdateMode" json:"update_mode"` // 用户Id // @gotags: json:"user_id" validate:"required,lte=120" UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id" validate:"required,lte=120"` // profile 账号profile // @gotags: json:"profile" Profile *Profile `protobuf:"bytes,3,opt,name=profile,proto3" json:"profile"` // contains filtered or unexported fields }
UpdateUserRequest todo
func (*UpdateUserRequest) Descriptor
deprecated
func (*UpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserRequest) GetProfile ¶
func (x *UpdateUserRequest) GetProfile() *Profile
func (*UpdateUserRequest) GetUpdateMode ¶
func (x *UpdateUserRequest) GetUpdateMode() request1.UpdateMode
func (*UpdateUserRequest) GetUserId ¶
func (x *UpdateUserRequest) GetUserId() string
func (*UpdateUserRequest) ProtoMessage ¶
func (*UpdateUserRequest) ProtoMessage()
func (*UpdateUserRequest) ProtoReflect ¶
func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
func (*UpdateUserRequest) Reset ¶
func (x *UpdateUserRequest) Reset()
func (*UpdateUserRequest) String ¶
func (x *UpdateUserRequest) String() string
type User ¶
type User struct { // 用户Id // @gotags: bson:"_id" json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // 用户创建的时间 // @gotags: bson:"create_at" json:"create_at" CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at" bson:"create_at"` // 修改时间 // @gotags: bson:"update_at" json:"update_at" UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at" bson:"update_at"` // 定义信息 // @gotags: bson:"spec" json:"spec" Spec *CreateUserRequest `protobuf:"bytes,4,opt,name=spec,proto3" json:"spec" bson:"spec"` // Profile信息 // @gotags: json:"profile" Profile *Profile `protobuf:"bytes,5,opt,name=profile,proto3" json:"profile"` // 用户是否初始化 // @gotags: bson:"is_initialized" json:"is_initialized" IsInitialized bool `protobuf:"varint,6,opt,name=is_initialized,json=isInitialized,proto3" json:"is_initialized" bson:"is_initialized"` // 密码相关信息 // @gotags: bson:"password" json:"password" Password *Password `protobuf:"bytes,7,opt,name=password,proto3" json:"password" bson:"password"` // 用户状态 // @gotags: bson:"status" json:"status" Status *Status `protobuf:"bytes,8,opt,name=status,proto3" json:"status" bson:"status"` // contains filtered or unexported fields }
func NewDefaultUser ¶
func NewDefaultUser() *User
func (*User) Descriptor
deprecated
func (*User) GetCreateAt ¶
func (*User) GetIsInitialized ¶
func (*User) GetPassword ¶
func (*User) GetProfile ¶
func (*User) GetSpec ¶
func (x *User) GetSpec() *CreateUserRequest
func (*User) GetUpdateAt ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserSet ¶
type UserSet 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 NewUserSet ¶
func NewUserSet() *UserSet
func (*UserSet) Descriptor
deprecated
func (*UserSet) ProtoMessage ¶
func (*UserSet) ProtoMessage()
func (*UserSet) ProtoReflect ¶
func (x *UserSet) ProtoReflect() protoreflect.Message