// ================================================================================
// 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/consts"
	"kami/internal/model"
	"kami/internal/model/entity"

	"github.com/gogf/gf/v2/container/gset"
	"github.com/gogf/gf/v2/database/gdb"
)

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)
		GetByUserName(ctx context.Context, username string) (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) (userId string, 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 []string) (users []*model.SysUserSimpleOutput, err error)
		// GetUsersAll 获取所有用户
		GetUsersAll(ctx context.Context) (users []*model.SysUserSimpleOutput, err error)
		GetUserFromToken(ctx context.Context) (needAuth bool, user *entity.V1SysUser, err error)
		// CheckUserNormal 检查账户是否正常
		CheckUserNormal(ctx context.Context, userId string) (isNormal bool, err error)
		// GetAllUserNormal 获取所有正常用户
		GetAllUserNormal(ctx context.Context, tx gdb.TX) (user []*entity.V1SysUser, err error)
		// GetAllSimpleUser 获取所有的用户
		GetAllSimpleUser(ctx context.Context) (data []model.UserSimpleUsersOutput, err error)
		// GetCurrentOneFromCache 获取当前通道拉的用户
		GetCurrentOneFromCache(ctx context.Context, channelName consts.CardRedeemAccountCategory) (data *entity.V1SysUser, err error)
		// GetOneNormalOneWithPayment 获取指定用户，并携带当前充值信息
		GetOneNormalOneWithPayment(ctx context.Context, userId string, tx gdb.TX) (output *model.UserSearchWithPaymentOutput, err error)
		// GetAllNormalWithPayment 获取所有户，并携带当前充值信息
		GetAllNormalWithPayment(ctx context.Context, minAmount float64, tx gdb.TX) (output []*model.UserSearchWithPaymentOutput, err error)
		// GetAllNormalWithPaymentAndChannelCfg 获取所有户，并携带当前充值信息
		GetAllNormalWithPaymentAndChannelCfg(ctx context.Context, minAmount float64, tx gdb.TX) (output []*model.UserSearchWithPaymentAndCfgOutput, err error)
		// GetNextOne 获取当前用户的下一个用户
		GetNextOne(ctx context.Context, userId string, amount float64, isNext bool, tx gdb.TX) (data *entity.V1SysUser, err error)
		// SetTotp 设置totp
		SetTotp(ctx context.Context, data *entity.V1SysUser, key string, 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
}
