Documentation ¶
Index ¶
- Constants
- type Department
- type GetUserLoginCaptchaReply
- type GetUserRequest
- type Job
- type ListUserRequest
- type Repo
- type Role
- type SendCurrentUserCaptchaReply
- type UpdateCurrentUserPasswordRequest
- type UpdateCurrentUserRequest
- type UseCase
- func (u *UseCase) CreateUser(ctx kratosx.Context, req *User) (uint32, error)
- func (u *UseCase) DeleteUser(ctx kratosx.Context, ids []uint32) (uint32, error)
- func (u *UseCase) GetCurrentUser(ctx kratosx.Context) (*User, error)
- func (u *UseCase) GetUser(ctx kratosx.Context, req *GetUserRequest) (*User, error)
- func (u *UseCase) GetUserLoginCaptcha(ctx kratosx.Context) (*GetUserLoginCaptchaReply, error)
- func (u *UseCase) ListUser(ctx kratosx.Context, req *ListUserRequest) ([]*User, uint32, error)
- func (u *UseCase) ResetUserPassword(ctx kratosx.Context, id uint32) error
- func (u *UseCase) SendCurrentUserCaptcha(ctx kratosx.Context, tp string) (*SendCurrentUserCaptchaReply, error)
- func (u *UseCase) UpdateCurrentUser(ctx kratosx.Context, req *UpdateCurrentUserRequest) error
- func (u *UseCase) UpdateCurrentUserPassword(ctx kratosx.Context, req *UpdateCurrentUserPasswordRequest) error
- func (u *UseCase) UpdateCurrentUserRole(ctx kratosx.Context, rid uint32) error
- func (u *UseCase) UpdateCurrentUserSetting(ctx kratosx.Context, setting string) error
- func (u *UseCase) UpdateUser(ctx kratosx.Context, req *User) error
- func (u *UseCase) UpdateUserStatus(ctx kratosx.Context, id uint32, status bool) error
- func (u *UseCase) UserLogin(ctx kratosx.Context, in *UserLoginRequest) (string, error)
- func (u *UseCase) UserLogout(ctx kratosx.Context) error
- func (u *UseCase) UserRefreshToken(ctx kratosx.Context) (string, error)
- type User
- type UserJob
- type UserLoginRequest
- type UserRole
Constants ¶
View Source
const ( ChangePwCaptchaType = "captcha" ChangePwPasswordType = "password" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Department ¶ added in v1.0.15
type GetUserLoginCaptchaReply ¶ added in v1.0.15
type GetUserRequest ¶ added in v1.0.15
type ListUserRequest ¶ added in v1.0.15
type ListUserRequest struct { Page uint32 `json:"page"` PageSize uint32 `json:"pageSize"` Order *string `json:"order"` OrderBy *string `json:"orderBy"` DepartmentId *uint32 `json:"departmentId"` RoleId *uint32 `json:"roleId"` Name *string `json:"name"` Phone *string `json:"phone"` Email *string `json:"email"` Status *bool `json:"status"` LoggedAts []int64 `json:"loggedAts"` CreatedAts []int64 `json:"createdAts"` DepartmentIds []uint32 `json:"departmentIds"` // fixed code }
type Repo ¶
type Repo interface { // GetUser 获取指定的用户信息 GetUser(ctx kratosx.Context, id uint32) (*User, error) // ListUser 获取用户信息列表 ListUser(ctx kratosx.Context, req *ListUserRequest) ([]*User, uint32, error) // CreateUser 创建用户信息 CreateUser(ctx kratosx.Context, req *User) (uint32, error) // UpdateUser 更新用户信息 UpdateUser(ctx kratosx.Context, req *User) error // UpdateUserStatus 更新用户信息状态 UpdateUserStatus(ctx kratosx.Context, id uint32, status bool) error // DeleteUser 删除用户信息 DeleteUser(ctx kratosx.Context, ids []uint32) (uint32, error) // GetUserByPhone 获取指定的用户信息 GetUserByPhone(ctx kratosx.Context, phone string) (*User, error) // GetUserByEmail 获取指定的用户信息 GetUserByEmail(ctx kratosx.Context, email string) (*User, error) // GetDepartmentDataScope 获取指定用户的部门权限 GetDepartmentDataScope(ctx kratosx.Context, uid uint32) (bool, []uint32, error) // GetRoleDataScope 获取指定角色的角色权限 GetRoleDataScope(ctx kratosx.Context, uid uint32) (bool, []uint32, error) // HasUserDataScope 获取某个用户是否具有另一个用户的权限 HasUserDataScope(ctx kratosx.Context, pid, uid uint32) (bool, error) // GetUserToken 获取用户的token信息 GetUserToken(ctx kratosx.Context, id uint32) (*string, int64, error) // GetUserPassword 获取用户的password GetUserPassword(ctx kratosx.Context, id uint32) (string, error) }
type SendCurrentUserCaptchaReply ¶ added in v1.0.15
type UpdateCurrentUserPasswordRequest ¶ added in v1.0.15
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
func (*UseCase) CreateUser ¶ added in v1.0.15
CreateUser 创建用户信息 fixed code
func (*UseCase) DeleteUser ¶
DeleteUser 删除用户信息 fixed code
func (*UseCase) GetCurrentUser ¶ added in v1.0.15
GetCurrentUser 获取当前的用户信息
func (*UseCase) GetUserLoginCaptcha ¶ added in v1.0.15
func (u *UseCase) GetUserLoginCaptcha(ctx kratosx.Context) (*GetUserLoginCaptchaReply, error)
GetUserLoginCaptcha 获取用户登陆验证吗
func (*UseCase) ResetUserPassword ¶
ResetUserPassword 重置用户密码
func (*UseCase) SendCurrentUserCaptcha ¶ added in v1.0.15
func (u *UseCase) SendCurrentUserCaptcha(ctx kratosx.Context, tp string) (*SendCurrentUserCaptchaReply, error)
SendCurrentUserCaptcha 发送当前用户验证吗
func (*UseCase) UpdateCurrentUser ¶
func (u *UseCase) UpdateCurrentUser(ctx kratosx.Context, req *UpdateCurrentUserRequest) error
UpdateCurrentUser 更新当前的基础信息
func (*UseCase) UpdateCurrentUserPassword ¶ added in v1.0.15
func (u *UseCase) UpdateCurrentUserPassword(ctx kratosx.Context, req *UpdateCurrentUserPasswordRequest) error
UpdateCurrentUserPassword 修改当前用户密码
func (*UseCase) UpdateCurrentUserRole ¶ added in v1.0.15
UpdateCurrentUserRole 切换当前用户角色
func (*UseCase) UpdateCurrentUserSetting ¶ added in v1.0.15
UpdateCurrentUserSetting 保存当前用户设置
func (*UseCase) UpdateUser ¶
UpdateUser 更新用户信息 fixed code
func (*UseCase) UpdateUserStatus ¶ added in v1.0.15
UpdateUserStatus 更新用户信息状态 fixed code
func (*UseCase) UserLogout ¶
UserLogout 退出登陆
type User ¶
type User struct { Id uint32 `json:"id"` DepartmentId uint32 `json:"departmentId"` RoleId uint32 `json:"roleId"` Name string `json:"name"` Nickname string `json:"nickname"` Gender string `json:"gender"` Avatar *string `json:"avatar"` Phone string `json:"phone"` Email string `json:"email"` Password string `json:"password"` Status *bool `json:"status"` Setting *string `json:"setting"` Token *string `json:"token"` LoggedAt int64 `json:"loggedAt"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` UserJobs []*UserJob `json:"userJobs"` UserRoles []*UserRole `json:"userRoles"` Roles []*Role `json:"roles"` Jobs []*Job `json:"jobs"` Department *Department `json:"department"` Role *Role `json:"role"` }
type UserLoginRequest ¶
Click to show internal directories.
Click to hide internal directories.