import { RoleVO } from './role'

/**
 * 用户信息
 */
export interface UserInfo {
  user: UserVO
  permissionCodes: string[]
  roleCodes: string[]
}

/**
 * 查询参数
 */
export interface UserQuery extends PageQuery {
  account?: string
  userName?: string
  nickName?: string
  status?: string
}

/**
 * 接收后端返回信息
 */
export interface UserVO extends BaseEntity {
  userId: string
  orgName: string
  positionId: string
  positionName: string
  account: string
  userName: string
  nickName: string
  userType: string
  email: string
  isLock: string
  phoneNumber: string
  gender: string
  avatar: string
  url: string
  loginIp: string
  loginDate: string
  remark: string
}

/**
 * 传入后端的表单信息
 */
export interface UserBO {
  userId: string
  orgId: string
  positionId: string
  account: string
  userName: string
  nickName: string
  userType: string
  email: string
  phoneNumber: string
  gender: string
  avatar: string
  url: string
  loginIp: string
  loginDate: string
  remark?: string
  status?: string
}

/**
 * 传入已有角色
 */
export interface UserRoleBO {
  userId: string
  roleIds: string[]
}

/**
 * 接收已有角色
 */
export interface UserRoleVO {
  allRoles: RoleVO[]
  hasRoles: string[]
}

/**
 * 传入新旧密码
 */
export interface PasswordBO {
  oldPassword: string
  password: string
}
