Documentation ¶
Index ¶
- type CaptchaReply
- type ChangeUserPasswordRequest
- type PageUserRequest
- type Repo
- type UpdateCurrentUserRequest
- type UseCase
- func (u *UseCase) AddUser(ctx kratosx.Context, user *User) (uint32, error)
- func (u *UseCase) ChangePasswordCaptcha(ctx kratosx.Context) (*CaptchaReply, error)
- func (u *UseCase) ChangeUserPassword(ctx kratosx.Context, in *ChangeUserPasswordRequest) error
- func (u *UseCase) CurrentUser(ctx kratosx.Context) (*User, error)
- func (u *UseCase) DeleteUser(ctx kratosx.Context, id uint32) error
- func (u *UseCase) DisableUser(ctx kratosx.Context, id uint32, desc string) error
- func (u *UseCase) EnableUser(ctx kratosx.Context, id uint32) error
- func (u *UseCase) OfflineUser(ctx kratosx.Context, id uint32) error
- func (u *UseCase) PageUser(ctx kratosx.Context, in *PageUserRequest) ([]*User, uint32, error)
- func (u *UseCase) ResetUserPassword(ctx kratosx.Context, id uint32) error
- func (u *UseCase) SwitchCurrentUserRole(ctx kratosx.Context, id uint32) error
- func (u *UseCase) UpdateCurrentUser(ctx kratosx.Context, in *UpdateCurrentUserRequest) error
- func (u *UseCase) UpdateUser(ctx kratosx.Context, user *User) error
- func (u *UseCase) UserLogin(ctx kratosx.Context, in *UserLoginRequest) (string, error)
- func (u *UseCase) UserLoginCaptcha(ctx kratosx.Context) (*CaptchaReply, 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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptchaReply ¶
type PageUserRequest ¶
type PageUserRequest struct { Page uint32 `json:"page"` PageSize uint32 `json:"page_size"` DepartmentIds []uint32 `json:"department_ids"` Username *string `json:"username"` Status *bool `json:"status"` RoleId *uint32 `json:"role_id"` DepartmentId *uint32 `json:"department_id"` StartTime *uint32 `json:"start_time"` EndTime *uint32 `json:"end_time"` Name *string `json:"name"` }
type Repo ¶
type Repo interface { GetUser(ctx kratosx.Context, id uint32) (*User, error) GetUserByPhone(ctx kratosx.Context, phone string) (*User, error) GetUserByEmail(ctx kratosx.Context, email string) (*User, error) PageUser(ctx kratosx.Context, in *PageUserRequest) ([]*User, uint32, error) HasRole(ctx kratosx.Context, uid, rid uint32) bool AddUser(ctx kratosx.Context, in *User) (uint32, error) UpdateUser(ctx kratosx.Context, in *User) error DeleteUser(ctx kratosx.Context, id uint32) error }
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
func NewUseCase ¶
func (*UseCase) ChangePasswordCaptcha ¶
func (u *UseCase) ChangePasswordCaptcha(ctx kratosx.Context) (*CaptchaReply, error)
func (*UseCase) ChangeUserPassword ¶
func (u *UseCase) ChangeUserPassword(ctx kratosx.Context, in *ChangeUserPasswordRequest) error
func (*UseCase) CurrentUser ¶
CurrentUser 查询当前用户信息
func (*UseCase) DisableUser ¶
func (*UseCase) ResetUserPassword ¶
func (*UseCase) SwitchCurrentUserRole ¶
func (*UseCase) UpdateCurrentUser ¶
func (u *UseCase) UpdateCurrentUser(ctx kratosx.Context, in *UpdateCurrentUserRequest) error
func (*UseCase) UserLoginCaptcha ¶
func (u *UseCase) UserLoginCaptcha(ctx kratosx.Context) (*CaptchaReply, error)
type User ¶
type User struct { types.BaseModel DepartmentId uint32 `json:"department_id"` RoleId uint32 `json:"role_id"` Name string `json:"name"` Nickname string `json:"nickname"` Gender string `json:"gender"` Phone string `json:"phone"` Password string `json:"password"` Avatar string `json:"avatar"` Email string `json:"email"` Status *bool `json:"status"` Disabled *string `json:"disabled"` LastLogin int64 `json:"last_login"` Token string `json:"token"` Role *role.Role `json:"role"` Department *department.Department `json:"department"` Roles []*role.Role `json:"roles" gorm:"many2many:user_role"` Jobs []*job.Job `json:"jobs" gorm:"many2many:user_job"` UserRoles []*UserRole `json:"user_roles"` UserJobs []*UserJob `json:"user_jobs"` }
type UserJob ¶
type UserJob struct { types.CreateModel JobID uint32 `json:"job_id"` UserID uint32 `json:"user_id"` }
type UserLoginRequest ¶
Click to show internal directories.
Click to hide internal directories.