// ==================== 系统配置管理 ====================

/**
 * 参数配置查询参数
 */
export interface ConfigQuery extends PageQuery {
  configName?: string;
  configKey?: string;
  configType?: string;
}

/**
 * 参数配置表单类型
 */
export interface ConfigForm {
  configId?: string | number;
  configName: string;
  configKey: string;
  configValue: string;
  configType: string;
  remark?: string;
}

/**
 * 参数配置返回对象
 */
export interface ConfigVO extends BaseEntity {
  configId: string | number;
  configName: string;
  configKey: string;
  configValue: string;
  configType: string;
  remark?: string;
}

// ==================== 用户管理 ====================

/**
 * 用户查询参数
 */
export interface UserQuery extends PageQuery {
  userName?: string;
  nickName?: string;
  phonenumber?: string;
  status?: string;
  deptId?: string | number;
  roleId?: string | number;
  userIds?: string;
}

/**
 * 用户表单类型
 */
export interface UserForm {
  userId?: string | number;
  deptId?: number;
  userName: string;
  nickName?: string;
  password?: string;
  phonenumber?: string;
  email?: string;
  sex?: string;
  status: string;
  remark?: string;
  postIds?: string[];
  roleIds?: string[];
}

/**
 * 用户返回对象
 */
export interface UserVO extends BaseEntity {
  userId: string | number;
  tenantId: string;
  deptId: number;
  userName: string;
  nickName: string;
  userType: string;
  email: string;
  phonenumber: string;
  sex: string;
  avatar: string;
  status: string;
  delFlag: string;
  loginIp: string;
  loginDate: string;
  remark: string;
  deptName: string;
  roles: RoleVO[];
  roleIds: any;
  postIds: any;
  roleId: any;
  admin: boolean;
}

/**
 * 用户信息对象
 */
export interface UserInfoVO {
  user: UserVO;
  roles: RoleVO[];
  roleIds: string[];
  posts: PostVO[];
  postIds: string[];
  roleGroup: string;
  postGroup: string;
}

/**
 * 重置密码表单
 */
export interface ResetPwdForm {
  userId: string | number;
  password: string;
}

/**
 * 用户状态修改表单
 */
export interface UserStatusForm {
  userId: string | number;
  status: string;
}

/**
 * 用户角色授权表单
 */
export interface UserRoleForm {
  userId: string | number;
  roleIds: string[];
}

// ==================== 角色管理 ====================

/**
 * 角色查询参数
 */
export interface RoleQuery extends PageQuery {
  roleName?: string;
  roleKey?: string;
  status?: string;
}

/**
 * 角色表单类型
 */
export interface RoleForm {
  roleId?: string | number;
  roleName: string;
  roleKey: string;
  roleSort: number;
  status: string;
  menuCheckStrictly: boolean;
  deptCheckStrictly: boolean;
  remark?: string;
  dataScope?: string;
  menuIds?: Array<string | number>;
  deptIds?: Array<string | number>;
}

/**
 * 角色返回对象
 */
export interface RoleVO extends BaseEntity {
  roleId: string | number;
  roleName: string;
  roleKey: string;
  roleSort: number;
  dataScope: string;
  menuCheckStrictly: boolean;
  deptCheckStrictly: boolean;
  status: string;
  delFlag: string;
  remark?: string;
  flag: boolean;
  menuIds?: Array<string | number>;
  deptIds?: Array<string | number>;
  admin: boolean;
}

/**
 * 角色部门树形结构
 */
export interface RoleDeptTree {
  checkedKeys: string[];
  depts: DeptTreeOption[];
}

/**
 * 部门树形选项
 */
export interface DeptTreeOption {
  id: string;
  label: string;
  parentId: string;
  weight: number;
  children?: DeptTreeOption[];
}

/**
 * 角色状态修改表单
 */
export interface RoleStatusForm {
  roleId: string | number;
  status: string;
}

/**
 * 角色数据权限表单
 */
export interface RoleDataScopeForm {
  roleId: string | number;
  dataScope: string;
  deptIds: Array<string | number>;
}

/**
 * 角色用户授权表单
 */
export interface RoleUserForm {
  roleId: string | number;
  userIds: Array<string | number>;
}

// ==================== 部门管理 ====================

/**
 * 部门查询参数
 */
export interface DeptQuery extends PageQuery {
  deptName?: string;
  deptCategory?: string;
  status?: number;
}

/**
 * 部门表单类型
 */
export interface DeptForm {
  deptId?: string | number;
  parentId?: string | number;
  deptName?: string;
  deptCategory?: string;
  orderNum?: number;
  leader?: string;
  phone?: string;
  email?: string;
  status?: string;
  ancestors?: string;
}

/**
 * 部门返回对象
 */
export interface DeptVO extends BaseEntity {
  deptId: string | number;
  parentId: string | number;
  deptName: string;
  deptCategory: string;
  orderNum: number;
  leader: string;
  phone: string;
  email: string;
  status: string;
  delFlag: string;
  ancestors: string;
  parentName: string;
  children: DeptVO[];
}

/**
 * 部门树形结构
 */
export interface DeptTreeVO extends BaseEntity {
  id: string | number;
  label: string;
  parentId: string | number;
  weight: number;
  children: DeptTreeVO[];
  disabled: boolean;
}

// ==================== 菜单管理 ====================

/**
 * 菜单查询参数
 */
export interface MenuQuery {
  keywords?: string;
  menuName?: string;
  status?: string;
}

/**
 * 菜单表单类型
 */
export interface MenuForm {
  menuId?: string | number;
  parentId?: string | number;
  menuName: string;
  orderNum: number;
  path: string;
  component?: string;
  queryParam?: string;
  isFrame?: string;
  isCache?: string;
  menuType?: string;
  visible?: string;
  status: string;
  icon?: string;
  remark?: string;
  perms?: string;
}

/**
 * 菜单返回对象
 */
export interface MenuVO extends BaseEntity {
  menuId: string | number;
  parentId: string | number;
  menuName: string;
  orderNum: number;
  path: string;
  component: string;
  queryParam: string;
  isFrame: string;
  isCache: string;
  menuType: string;
  visible: string;
  status: string;
  icon: string;
  remark: string;
  parentName: string;
  children: MenuVO[];
}

/**
 * 菜单树形选项
 */
export interface MenuTreeOption {
  id: string | number;
  label: string;
  parentId: string | number;
  weight: number;
  children?: MenuTreeOption[];
}

/**
 * 角色菜单树形结构
 */
export interface RoleMenuTree {
  menus: MenuTreeOption[];
  checkedKeys: string[];
}

// ==================== 岗位管理 ====================

/**
 * 岗位查询参数
 */
export interface PostQuery extends PageQuery {
  postCode?: string;
  postName?: string;
  status?: string;
}

/**
 * 岗位表单类型
 */
export interface PostForm {
  postId?: string | number;
  postCode: string;
  postName: string;
  postSort: number;
  status: string;
  remark?: string;
}

/**
 * 岗位返回对象
 */
export interface PostVO extends BaseEntity {
  postId: string | number;
  postCode: string;
  postName: string;
  postSort: number;
  status: string;
  remark?: string;
}

// ==================== 字典管理 ====================

/**
 * 字典类型查询参数
 */
export interface DictTypeQuery extends PageQuery {
  dictName?: string;
  dictType?: string;
  status?: string;
}

/**
 * 字典类型表单
 */
export interface DictTypeForm {
  dictId?: string | number;
  dictName: string;
  dictType: string;
  status: string;
  remark?: string;
}

/**
 * 字典类型返回对象
 */
export interface DictTypeVO extends BaseEntity {
  dictId: string | number;
  dictName: string;
  dictType: string;
  status: string;
  remark?: string;
}

/**
 * 字典数据查询参数
 */
export interface DictDataQuery extends PageQuery {
  dictType?: string;
  dictLabel?: string;
  status?: string;
}

/**
 * 字典数据表单
 */
export interface DictDataForm {
  dictCode?: string | number;
  dictSort: number;
  dictLabel: string;
  dictValue: string;
  dictType: string;
  cssClass?: string;
  listClass?: string;
  isDefault?: string;
  status: string;
  remark?: string;
}

/**
 * 字典数据返回对象
 */
export interface DictDataVO extends BaseEntity {
  dictCode: string | number;
  dictSort: number;
  dictLabel: string;
  dictValue: string;
  dictType: string;
  cssClass?: string;
  listClass?: string;
  isDefault: string;
  status: string;
  remark?: string;
}

// ==================== 通知公告 ====================

/**
 * 通知公告查询参数
 */
export interface NoticeQuery extends PageQuery {
  noticeTitle?: string;
  noticeType?: string;
  createBy?: string;
  status?: string;
}

/**
 * 通知公告表单
 */
export interface NoticeForm {
  noticeId?: string | number;
  noticeTitle: string;
  noticeType: string;
  noticeContent: string;
  status: string;
  remark?: string;
}

/**
 * 通知公告返回对象
 */
export interface NoticeVO extends BaseEntity {
  noticeId: string | number;
  noticeTitle: string;
  noticeType: string;
  noticeContent: string;
  status: string;
  remark?: string;
}

// ==================== 租户管理 ====================

/**
 * 租户查询参数
 */
export interface TenantQuery extends PageQuery {
  tenantName?: string;
  contactUserName?: string;
  contactPhone?: string;
  status?: string;
}

/**
 * 租户表单
 */
export interface TenantForm {
  tenantId?: string | number;
  tenantName: string;
  contactUserName: string;
  contactPhone: string;
  address?: string;
  domain?: string;
  packageId: string | number;
  expireTime: string;
  userCount: number;
  status: string;
  remark?: string;
}

/**
 * 租户返回对象
 */
export interface TenantVO extends BaseEntity {
  tenantId: string | number;
  tenantName: string;
  contactUserName: string;
  contactPhone: string;
  address?: string;
  domain?: string;
  packageId: string | number;
  expireTime: string;
  userCount: number;
  status: string;
  remark?: string;
  packageName?: string;
}

/**
 * 租户状态修改表单
 */
export interface TenantStatusForm {
  tenantId: string | number;
  status: string;
}

// ==================== 租户套餐管理 ====================

/**
 * 租户套餐查询参数
 */
export interface TenantPackageQuery extends PageQuery {
  packageName?: string;
  status?: string;
}

/**
 * 租户套餐表单
 */
export interface TenantPackageForm {
  packageId?: string | number;
  packageName: string;
  menuIds: Array<string | number>;
  status: string;
  remark?: string;
}

/**
 * 租户套餐返回对象
 */
export interface TenantPackageVO extends BaseEntity {
  packageId: string | number;
  packageName: string;
  menuIds: Array<string | number>;
  status: string;
  remark?: string;
}

/**
 * 租户套餐状态修改表单
 */
export interface TenantPackageStatusForm {
  packageId: string | number;
  status: string;
}

// ==================== 文件管理 ====================

/**
 * OSS对象查询参数
 */
export interface OssQuery extends PageQuery {
  fileName?: string;
  originalName?: string;
  fileSuffix?: string;
  url?: string;
  createTime?: string;
}

/**
 * OSS对象返回对象
 */
export interface OssVO extends BaseEntity {
  ossId: string | number;
  fileName: string;
  originalName: string;
  fileSuffix: string;
  url: string;
  size: string;
}

/**
 * OSS配置查询参数
 */
export interface OssConfigQuery extends PageQuery {
  configName?: string;
  configKey?: string;
  status?: string;
}

/**
 * OSS配置表单
 */
export interface OssConfigForm {
  ossConfigId?: string | number;
  configKey: string;
  accessKey: string;
  secretKey: string;
  bucketName: string;
  prefix?: string;
  endpoint: string;
  domain?: string;
  isHttps?: string;
  region?: string;
  status: string;
  remark?: string;
}

/**
 * OSS配置返回对象
 */
export interface OssConfigVO extends BaseEntity {
  ossConfigId: string | number;
  configKey: string;
  accessKey: string;
  secretKey: string;
  bucketName: string;
  prefix?: string;
  endpoint: string;
  domain?: string;
  isHttps: string;
  region?: string;
  status: string;
  remark?: string;
}

/**
 * OSS配置状态修改表单
 */
export interface OssConfigStatusForm {
  ossConfigId: string | number;
  status: string;
}

// ==================== 客户端管理 ====================

/**
 * 客户端查询参数
 */
export interface ClientQuery extends PageQuery {
  clientName?: string;
  clientId?: string;
  status?: string;
}

/**
 * 客户端表单
 */
export interface ClientForm {
  clientId?: string | number;
  clientName: string;
  clientIdKey: string;
  clientSecret: string;
  tokenValiditySeconds: number;
  refreshTokenValiditySeconds: number;
  logoutUri?: string;
  redirectUri?: string;
  status: string;
  remark?: string;
}

/**
 * 客户端返回对象
 */
export interface ClientVO extends BaseEntity {
  clientId: string | number;
  clientName: string;
  clientIdKey: string;
  clientSecret: string;
  tokenValiditySeconds: number;
  refreshTokenValiditySeconds: number;
  logoutUri?: string;
  redirectUri?: string;
  status: string;
  remark?: string;
}

/**
 * 客户端状态修改表单
 */
export interface ClientStatusForm {
  clientId: string | number;
  status: string;
}

// ==================== 第三方登录 ====================

/**
 * 第三方登录查询参数
 */
export interface SocialQuery extends PageQuery {
  socialName?: string;
  socialType?: string;
  status?: string;
}

/**
 * 第三方登录表单
 */
export interface SocialForm {
  socialId?: string | number;
  socialName: string;
  socialType: string;
  appId: string;
  appSecret: string;
  redirectUrl?: string;
  status: string;
  remark?: string;
}

/**
 * 第三方登录返回对象
 */
export interface SocialVO extends BaseEntity {
  socialId: string | number;
  socialName: string;
  socialType: string;
  appId: string;
  appSecret: string;
  redirectUrl?: string;
  status: string;
  remark?: string;
}

/**
 * 第三方登录状态修改表单
 */
export interface SocialStatusForm {
  socialId: string | number;
  status: string;
}

// ==================== 基础类型 ====================

/**
 * 基础实体类型
 */
export interface BaseEntity {
  createBy?: string;
  createTime?: string;
  updateBy?: string;
  updateTime?: string;
  remark?: string;
}

/**
 * 分页查询基础类型
 */
export interface PageQuery {
  pageNum?: number;
  pageSize?: number;
  orderByColumn?: string;
  isAsc?: string;
}

/**
 * 分页返回对象
 */
export interface PageResult<T> {
  rows: T[];
  total: number;
}

/**
 * 通用返回对象
 */
export interface ApiResult<T = any> {
  code: number;
  msg: string;
  data: T;
}

/**
 * 树形结构基础类型
 */
export interface TreeNode {
  id: string | number;
  label: string;
  parentId: string | number;
  children?: TreeNode[];
}

/**
 * 选项类型
 */
export interface Option {
  label: string;
  value: string | number;
  disabled?: boolean;
} 