import type { ApiResponse } from './index';

// 用户信息子类型
export interface UserInfo {
  id: number
  username: string
  email: string
  mobile: string
  role_id: number
  pass_admin: string
  last_login?: string
  salt_code_admin: string
  real_check: number
  par_uid: number
  path: string
  lang_type: number
  reg_type: number
  status: number
  invite_code: string
  created_at: string
  updated_at: string
  deleted_at: string | null
  token: string
  redis_key: string
}

// 菜单子项类型
export interface MenuChildItem {
  id: number;
  name: string;
  api: string;
  path: string | null;
  icon: string | null;
  parent_id: number;
  sort: number;
  type: number;
  status: number;
}

// 菜单主项类型
export interface MenuItem {
  id: number;
  name: string;
  api: string;
  path: string | null;
  icon: string | null;
  parent_id: number;
  sort: number;
  type: number;
  status: number;
  son: MenuChildItem[];
}

// 权限信息类型
export interface PermissionItem {
  id: number;
  name: string;
  title: string;
  module: string;
  status: number;
}

// 登录响应数据类型
export interface LoginResponseData {
  user: UserInfo;
  menus_info: MenuItem[];
  permissions_info: PermissionItem[];
}

// 登录接口响应类型（适配 ApiResponse 泛型）
export type LoginResponse = LoginResponseData;
