83 lines
3.9 KiB
Go
83 lines
3.9 KiB
Go
// ================================================================================
|
|
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|
// You can delete these comments if you wish manually maintain this interface file.
|
|
// ================================================================================
|
|
|
|
package service
|
|
|
|
import (
|
|
"context"
|
|
"kami/internal/model"
|
|
"kami/internal/model/entity"
|
|
|
|
"github.com/gogf/gf/v2/container/gset"
|
|
)
|
|
|
|
type (
|
|
ISysUser interface {
|
|
GetCasBinUserPrefix() string
|
|
NotCheckAuthAdminIds(ctx context.Context) *gset.Set
|
|
GetAdminUserByUsernamePassword(ctx context.Context, req *model.UserLoginInput) (user *model.LoginUserOutput, err error)
|
|
// GetUserByUsername 通过用户名获取用户信息
|
|
GetUserByUsername(ctx context.Context, userName string) (sysUser *model.LoginUserOutput, err error)
|
|
// GetUserById 通过用户名获取用户信息
|
|
GetUserById(ctx context.Context, id string) (sysUser *model.LoginUserOutput, err error)
|
|
// LoginLog 记录登录日志
|
|
LoginLog(ctx context.Context, params *model.LoginLogParams)
|
|
// GetAdminRules 获取用户菜单数据
|
|
GetAdminRules(ctx context.Context, userId string) (menuList []*model.UserMenus, permissions []string, err error)
|
|
// GetAdminRole 获取用户角色
|
|
GetAdminRole(ctx context.Context, userId string, allRoleList []*entity.V1SysRole) (roles []*entity.V1SysRole, err error)
|
|
// GetAdminRoleIds 获取用户角色ids
|
|
GetAdminRoleIds(ctx context.Context, userId string) (roleIds []uint, err error)
|
|
GetAllMenus(ctx context.Context) (menus []*model.UserMenus, err error)
|
|
GetAdminMenusByRoleIds(ctx context.Context, roleIds []uint) (menus []*model.UserMenus, err error)
|
|
GetMenusTree(menus []*model.UserMenus, pid uint) []*model.UserMenus
|
|
GetPermissions(ctx context.Context, roleIds []uint) (userButtons []string, err error)
|
|
// List 用户列表
|
|
List(ctx context.Context, req *model.UserSearchInput) (total int, userList []*entity.V1SysUser, err error)
|
|
// ListWithPayment 查询用户数据,带钱包信息
|
|
ListWithPayment(ctx context.Context, req *model.UserSearchInput) (total int, userList []*model.UserSearchWithPaymentOutput, err error)
|
|
Add(ctx context.Context, req *model.UserAddInput) (err error)
|
|
Edit(ctx context.Context, req *model.UserEditInput) (err error)
|
|
// EditUserRole 修改用户角色信息
|
|
EditUserRole(ctx context.Context, roleIds []int64, userId int64) (err error)
|
|
UserNameOrMobileExists(ctx context.Context, userName string, id ...string) (isExist bool, err error)
|
|
// GetEditUser 获取编辑用户信息
|
|
GetEditUser(ctx context.Context, id string) (res *model.UserGetEditOutput, err error)
|
|
// GetUserInfoById 通过Id获取用户信息
|
|
GetUserInfoById(ctx context.Context, id string, withPwd ...bool) (user *entity.V1SysUser, err error)
|
|
// ChangePwd ResetUserPwd 重置用户密码
|
|
ChangePwd(ctx context.Context, input *model.UserChangePwdInput) (err error)
|
|
ChangeUserStatus(ctx context.Context, input *model.UserStatusInput) (err error)
|
|
// DeleteById 删除用户
|
|
DeleteById(ctx context.Context, id string) (err error)
|
|
// Delete 删除用户
|
|
Delete(ctx context.Context, ids []string) (err error)
|
|
// GetUsers 通过用户ids查询多个用户信息
|
|
GetUsers(ctx context.Context, ids []int) (users []*model.SysUserSimpleOutput, err error)
|
|
// GetUsersAll 获取所有用户
|
|
GetUsersAll(ctx context.Context) (users []*model.SysUserSimpleOutput, err error)
|
|
GetUserIdFromToken(ctx context.Context) (needAuth bool, user *entity.V1SysUser, err error)
|
|
// SetTotp 设置totp
|
|
SetTotp(ctx context.Context, data *entity.V1SysUser, key, secret string) (err error)
|
|
// ResetTotp 重置两步验证
|
|
ResetTotp(ctx context.Context, data *entity.V1SysUser) (err error)
|
|
}
|
|
)
|
|
|
|
var (
|
|
localSysUser ISysUser
|
|
)
|
|
|
|
func SysUser() ISysUser {
|
|
if localSysUser == nil {
|
|
panic("implement not found for interface ISysUser, forgot register?")
|
|
}
|
|
return localSysUser
|
|
}
|
|
|
|
func RegisterSysUser(i ISysUser) {
|
|
localSysUser = i
|
|
}
|