import * as Study from "./study";
import * as User from "./user";
import * as News from "./news";
import * as Transfer from "./transfer";
import * as System from './system';
import * as Major from "./major";
import * as Career from "./career";
import * as Tree from "./tree";
import * as Voluntary from "./voluntary";
import * as Dropdown from "./dropdown";
import * as University from "./university";
import { VipCardInfo } from "./user";
import { EnumExamMode, EnumExamType, EnumReviewMode } from "@/common/enum";

export { Study, User, News, Transfer, System, Major, Career, Tree, Voluntary, Dropdown, University };

/// 接口响应
export interface ApiResponse<T> {
  code: number;
  msg: string;
  data: T;
  card?: VipCardInfo;
  // 以下是注册登录才有的
  token?: string;
  user?: User.UserInfo;
  isDefaultModifyPwd?: boolean;
  isPasswordExpired?: boolean;
  // 以下是机构信息
  org?: {
    contactPhone: string;
    logo: string;
    orgName: string;
  }
}

export interface ApiCaptchaResponse {
  code: number;
  msg: string;
  img: string;
  uuid: string;
}

export interface ApiResponseList<T> {
  code: number;
  msg: string;
  rows: T[];
  total: number;
}


export interface TableConfig {
  border?: boolean;
  stripe?: boolean;
  emptyText?: string;
  loading?: boolean;
  rowKey?: string;
  defaultValue?: string;
}

export interface TableColumnConfig {
  prop: string;
  label: string;
  flex?: number;
  slot?: string;
  type?: string;
  headerAlign?: 'left' | 'center' | 'right';
  align?: 'left' | 'center' | 'right';
}

/**
 * 应用 store
 */
export interface AppStoreState {
  isInitialized: boolean;
  activeTabbar: number;
  statusBarHeight: number;
  systemInfo: UniApp.GetSystemInfoResult | null;
  appConfig: ConfigItem[];
  platform: string;
}

export interface DictStoreState {
  dicts: Record<string, DictItem[]>;
}

export interface UserStoreState {
  accessToken: string | null;
  user: User.UserInfo | null;
  isDefaultModifyPwd?: boolean;
  isPasswordExpired?: boolean;
  card: VipCardInfo | null;
  isExamGuideShow: boolean;
  tempInfo?: {
    location: string;
    examType?: EnumExamType;
  };
  org: {
    contactPhone: string;
    logo: string;
    orgName: string;
  };
  rememberPwd: boolean;
  cardPassword: string;
  cardNo: string;
  directedSchoolList: Study.DirectedSchool[];
  practiceSettings: Study.PracticeSettings;
}

/**
 * 字典项
 */
export interface DictItem {
  dictLabel: string;
  dictValue: string;
}

export interface PickerItem {
  label: string;
  value: string | number;
}

export interface ConfigItem {
  configKey: string;
  configValue: string;
  configType: string;
  configName: string;
  configId: number;
}

export interface SwiperTabItem {
  name: string;
  value?: string;
  slot?: string;
  params?: any;

  visited?: boolean;
  component?: any;
}

export interface Entity {
  id: number;
  name: string;
  remark: string | null;
  createBy: string | null;
  craeteTime: string | null;
  updateBy: string | null;
  updateTime: string | null;
}
