// * 请求响应参数(不包含data)
export interface Result {
	code: string;
	message: string;
}

// * 请求响应参数(包含data)
export interface ResultData<T = any> extends Result {
	result: T;
}

// * 分页响应参数
export interface ResPage<T> {
	result: T[];
	pageNo: number;
	pageSize: number;
	total: number;
}

// * 分页请求参数
export interface ReqPage {
	pageNum: number;
	pageSize: number;
}

// * 文件上传模块
export namespace Upload {
	export interface ResFileUrl {
		fileUrl: string;
	}
}

// * 登录模块
export namespace Login {
	export interface ReqLoginForm {
		account: string;
		showPassword: string;
	}
	export interface ResLogin {
		token: string;
	}
	export interface ResAuthButtons {
		[key: string]: string[];
	}
}

// * 用户管理模块
export namespace User {
	export interface ReqUserParams extends ReqPage {
		username: string;
		gender: number;
		idCard: string;
		email: string;
		address: string;
		createTime: string[];
		status: number;
	}
	export interface ResRecords {
		createTime: string;
		dictCode: string;
		dictLabel: string;
		dictSort: number;
		dictType: string;
		dictValue: string;
		isDefault: string;
		remark: string;
		status: string;
	}
	export interface ResResults {
		current: string;
		hitCount: boolean;
		pages: string;
		searchCount: boolean;
		size: string;
		total: string;
		records: ResRecords[];
	}
	export interface ResUserList {
		id: string;
		configId: string;
		dictCode: string;
		username: string;
		gender: string;
		user: {
			detail: {
				age: number;
			};
		};
		records?: ResRecords[];
		idCard: string;
		email: string;
		address: string;
		createTime: string;
		status: number;
		avatar: string;
		children?: ResUserList[];
	}
	export interface ResStatus {
		userLabel: string;
		userValue: number;
	}
	export interface ResGender {
		genderLabel: string;
		genderValue: number;
	}
	export interface ResDepartment {
		id: string;
		name: string;
		children?: ResDepartment[];
	}
	export interface ResRole {
		id: string;
		name: string;
		children?: ResDepartment[];
	}
}
