/** 用户类型 */
export interface UserResp {
  id: string
  username: string
  nickname: string
  avatar: string
  gender: number
  email: string
  phone: string
  description: string
  status: 1 | 2
  isSystem?: boolean
  createUserString: string
  createTime: string
  updateUserString: string
  updateTime: string
  deptId: string
  deptName: string
  roleIds: Array<number>
  roleNames: Array<string>
  disabled: boolean
}

/** 新用户信息响应类型 */
export interface UserNewResp {
  userId: string
  account: string
  avatar: string
  birthdate: string
  deptId: string
  deptName: string
  education: string
  educationLabel: string
  email: string
  gender: string
  hiredate: string
  identityCard: string
  majorField: string
  mobile: string
  name: string
  postIds: string[]
  postName: string
  roleIds: string[]
  roleName: string
  status: number
  userCode: string
  userStatus: string
  userStatusLabel: string
  userType: string
  userTypeLabel: string
  workField: string
  msg: string
  success: boolean
}

/** 新用户信息请求类型 */
export interface UserNewAddReq {
  account: string
  avatar?: string
  birthdate?: string
  deptId?: string
  education?: string
  email?: string
  gender?: string
  hiredate?: string
  identityCard?: string
  majorField?: string
  mobile?: string
  name?: string
  postIds?: string[]
  roleIds?: string[]
  status?: number
  userStatus?: string
  userType?: string
  workField?: string
}

/** 新用户信息修改请求类型 */
export interface UserNewUpdateReq extends UserNewAddReq {}

/** 新用户绑定角色请求类型 */
export interface UserBindRoleReq {
  roleIds: string[]
  userId: string
}

/** 新用户查询参数 */
export interface UserNewQuery {
  account?: string
  deptId?: string
  mobile?: string
  name?: string
  userCode?: string
  userStatus?: string
  userType?: string
}

/** 新用户分页查询参数 */
export interface UserNewPageQuery extends UserNewQuery, PageQuery {}

export type UserDetailResp = UserResp & {
  pwdResetTime?: string
}

export interface UserImportResp {
  importKey: string
  totalRows: number
  validRows: number
  duplicateUserRows: number
  duplicateEmailRows: number
  duplicatePhoneRows: number
}
export interface UserQuery {
  description?: string
  status?: number
  createTime?: Array<string>
  deptId?: string
  sort: Array<string>
  userIds?: Array<string>
  roleId?: string
}
export interface UserPageQuery extends UserQuery, PageQuery {}

/** 角色类型 */
export interface RoleResp {
  id: string
  name: string
  code: string
  sort: number
  description: string
  dataScope: number
  isSystem: boolean
  createUserString: string
  createTime: string
  updateUserString: string
  updateTime: string
  disabled: boolean
}
export type RoleDetailResp = RoleResp & {
  menuIds: Array<number>
  deptIds: Array<number>
  menuCheckStrictly: boolean
  deptCheckStrictly: boolean
}
export interface RoleUserResp {
  id: string
  username: string
  nickname: string
  gender: number
  description: string
  status: 1 | 2
  isSystem?: boolean
  deptId: string
  deptName: string
  roleIds: Array<number>
  roleNames: Array<string>
  disabled: boolean
}
export interface RoleQuery {
  description?: string
  sort: Array<string>
}
export interface RoleUserQuery {
  description?: string
  sort: Array<string>
}
export interface RoleUserPageQuery extends RoleUserQuery, PageQuery {}

/** 菜单类型 */
export interface MenuResp {
  id: string
  title: string
  parentId: string
  type: 1 | 2 | 3
  path: string
  name: string
  component: string
  redirect: string
  icon: string
  isExternal: boolean
  isCache: boolean
  isHidden: boolean
  permission: string
  sort: number
  status: 1 | 2
  createUserString: string
  createTime: string
  updateUserString: string
  updateTime: string
  children: MenuResp[]
}
export interface MenuQuery {
  title?: string
  status?: number
}

/** 部门类型 */
export interface DeptResp {
  deptId: string
  deptName: string
  leaderId: string
  orderNum: number
  parentId: string
  status: string
  children?: DeptResp[]
}

/** 部门查询参数 */
export interface DeptQuery {
  deptName?: string
}

/** 部门新增请求参数 */
export interface DeptAddReq {
  deptName: string
  leaderId?: string
  orderNum: number
  parentId?: string
  status: number
}

/** 部门修改请求参数 */
export interface DeptUpdateReq {
  deptName: string
  leaderId?: string
  orderNum: number
  parentId?: string
  status: number
}

/** 部门详情响应类型 */
export interface DeptDetailResp {
  deptId: string
  deptName: string
  leaderId: string
  orderNum: number
  parentId: string
  status: string
}

/** 字典类型 */
export interface DictResp {
  id: string
  name: string
  code: string
  isSystem: boolean
  description: string
  createUserString: string
  createTime: string
  updateUserString: string
  updateTime: string
}
export interface DictQuery {
  description?: string
  sort: Array<string>
}
export interface DictItemResp {
  id: string
  label: string
  value: string
  color: string
  sort: number
  description: string
  status: 1 | 2
  dictId: number
  createUserString: string
  createTime: string
  updateUserString: string
  updateTime: string
}
export interface DictItemQuery {
  description?: string
  status?: number
  sort: Array<string>
  dictId: string
}
export interface DictItemPageQuery extends DictItemQuery, PageQuery {
}

/** 公告类型 */
export interface NoticeResp {
  id?: string
  title?: string
  type: string
  noticeScope: number
  noticeMethods?: Array<number>
  isTiming: boolean
  publishTime?: string
  isTop: boolean
  status?: number
}
export type NoticeDetailResp = NoticeResp & {
  createUserString: string
  createTime: string
  updateUserString: string
  updateTime: string
}
export type NoticePreviewResp = NoticeDetailResp & {
  content: string
}
export interface NoticeQuery {
  title?: string
  type?: string
  sort: Array<string>
}
export interface NoticePageQuery extends NoticeQuery, PageQuery {
}

/** 文件类型 */
export interface FileItem {
  id: string
  name: string
  originalName: string
  size: number
  url: string
  parentPath: string
  path: string
  sha256: string
  contentType: string
  metadata: string
  thumbnailSize: number
  thumbnailName: string
  thumbnailMetadata: string
  thumbnailUrl: string
  extension: string
  type: number
  storageId: string
  storageName: string
  createUserString: string
  createTime: string
  updateUserString?: string
  updateTime?: string
}
/** 文件资源统计信息 */
export interface FileStatisticsResp {
  type: string
  size: any
  number: number
  unit: string
  data: Array<FileStatisticsResp>
}
/** 文件夹计算大小信息 */
export interface FileDirCalcSizeResp {
  size: number
}
export interface FileQuery {
  originalName?: string
  type?: string
  parentPath?: string
  sort: Array<string>
}
export interface FilePageQuery extends FileQuery, PageQuery {
}

/** 存储类型 */
export interface StorageResp {
  id: string
  name: string
  code: string
  type: number
  accessKey: string
  secretKey: string
  endpoint: string
  bucketName: string
  domain: string
  description: string
  isDefault: boolean
  sort: number
  status: number
  createUserString: string
  createTime: string
  updateUserString: string
  updateTime: string
}
export interface StorageQuery {
  description?: string
  type?: number
  sort: Array<string>
}

/** 客户端类型 */
export interface ClientResp {
  id: string
  clientId: string
  clientType: string
  authType: string
  activeTimeout: string
  timeout: string
  status: string
  createUser: string
  createTime: string
  updateUser: string
  updateTime: string
  createUserString: string
  updateUserString: string
}
export interface ClientDetailResp {
  id: string
  clientId: string
  clientType: string
  authType: string
  activeTimeout: string
  timeout: string
  status: string
  createUser: string
  createTime: string
  updateUser: string
  updateTime: string
  createUserString: string
  updateUserString: string
}
export interface ClientQuery {
  clientType: string
  authType: string[]
  status: string
  sort: Array<string>
}
export interface ClientPageQuery extends ClientQuery, PageQuery {}

/** 系统参数类型 */
export interface OptionResp {
  id: string
  name: string
  code: string
  value: string
  description: string
}

export interface OptionQuery {
  code?: Array<string>
  category?: string
}

/** 基础配置类型 */
export interface BasicConfig {
  SITE_FAVICON: string
  SITE_LOGO: string
  SITE_TITLE: string
  SITE_COPYRIGHT: string
  SITE_BEIAN: string
}

/** 基础配置类型 */
export interface SiteConfig {
  SITE_FAVICON: OptionResp
  SITE_LOGO: OptionResp
  SITE_TITLE: OptionResp
  SITE_DESCRIPTION: OptionResp
  SITE_COPYRIGHT: OptionResp
  SITE_BEIAN: OptionResp
}

/** 安全配置类型 */
export interface SecurityConfig {
  PASSWORD_ERROR_LOCK_COUNT: OptionResp
  PASSWORD_ERROR_LOCK_MINUTES: OptionResp
  PASSWORD_EXPIRATION_DAYS: OptionResp
  PASSWORD_EXPIRATION_WARNING_DAYS: OptionResp
  PASSWORD_REPETITION_TIMES: OptionResp
  PASSWORD_MIN_LENGTH: OptionResp
  PASSWORD_ALLOW_CONTAIN_USERNAME: OptionResp
  PASSWORD_REQUIRE_SYMBOLS: OptionResp
}

/** 邮箱配置类型 */
export interface MailConfig {
  MAIL_PROTOCOL: OptionResp
  MAIL_HOST: OptionResp
  MAIL_PORT: OptionResp
  MAIL_USERNAME: OptionResp
  MAIL_PASSWORD: OptionResp
  MAIL_SSL_ENABLED: OptionResp
  MAIL_SSL_PORT: OptionResp
}

/** 登录配置类型 */
export interface LoginConfig {
  LOGIN_CAPTCHA_ENABLED: OptionResp
}

/** 短信配置类型 */
export interface SmsConfigResp {
  id: string
  name: string
  supplier: string
  accessKey: string
  secretKey: string
  signature: string
  templateId: string
  weight: string
  retryInterval: string
  maxRetries: string
  maximum: string
  supplierConfig: string
  status: number
  isDefault: boolean
  createUser: string
  createTime: string
  updateUser: string
  updateTime: string
  createUserString: string
  updateUserString: string
  disabled: boolean
}
export interface SmsConfigQuery {
  name: string | undefined
  supplier: string | undefined
  accessKey: string | undefined
  sort: Array<string>
}
export interface SmsConfigPageQuery extends SmsConfigQuery, PageQuery {}

/** 短信日志类型 */
export interface SmsLogResp {
  id: string
  configId: string
  phone: string
  params: string
  status: number
  resMsg: string
  createUser: string
  createTime: string
  updateUser: string
  updateTime: string
  createUserString: string
  updateUserString: string
}
export interface SmsLogQuery {
  configId: string | undefined
  phone: string | undefined
  status: number | undefined
  sort: Array<string>
}
export interface SmsLogPageQuery extends SmsLogQuery, PageQuery {}

/** 绑定三方账号信息 */
export interface BindSocialAccountRes {
  source: string
  description: string
}

/** 系统消息类型 */
export interface MessageResp {
  id: string
  title: string
  content: string
  type: number
  path: string
  isRead: boolean
  readTime?: string
  createUserString?: string
  createTime: string
}

export interface MessageQuery {
  title?: string
  type?: number
  isRead?: boolean
  sort: Array<string>
}

export interface MessagePageQuery extends MessageQuery, PageQuery {
}

/** 新增菜单请求参数 */
export interface MenuAddReq {
  menuName: string;
  menuType: string;
  orderNum: number;
  parentId: string;
  perms: string;
  terminalType: string;
  url: string;
  visible: string;
}

/** 新菜单树查询参数 */
export interface MenuTreeQuery {
  menuName?: string;
  terminalType?: string;
}

/** 新菜单详情响应类型 */
export interface MenuDetailResp {
  menuId: string;
  menuName: string;
  menuType: string;
  orderNum: number;
  parentId: string;
  perms: string;
  url: string;
  visible: string;
}

/** 菜单更新请求参数 */
export interface MenuUpdateReq {
  menuName: string;
  menuType: string;
  orderNum: number;
  parentId: string;
  perms: string;
  terminalType: string;
  url: string;
  visible: string;
}

/** 新角色信息请求实体 */
export interface RoleAddReq {
  remark: string;
  roleCode: string;
  roleKey: string;
  roleName: string;
  status: number;
}

/** 角色信息更新请求实体 */
export interface RoleUpdateReq {
  remark: string;
  roleCode: string;
  roleKey: string;
  roleName: string;
  status: number;
}

/** 新角色信息响应实体 */
export interface RoleNewResp {
  remark: string;
  roleCode: string;
  roleId: string;
  roleKey: string;
  roleName: string;
  status: string;
  isSystem?: boolean;
}

/** 角色菜单绑定请求 */
export interface RoleBindMenuReq {
  menuIds: string[];
  roleId: string;
}

/** 角色查询参数（新接口） */
export interface RoleNewQuery {
  roleName?: string;
}

// 岗位相关类型定义
export interface PostVO {
  postId: string;
  postName: string;
  postSort: number;
  remark: string;
  status: string | number;
  createTime?: string;
  updateTime?: string;
}

export interface PostPageQuery {
  postName?: string;
  page?: number;
  size?: number;
}

export interface PostAddReq {
  postName: string;
  postSort: number;
  remark: string;
  status: number;
}

export interface PostUpdateReq {
  postName: string;
  postSort: number;
  remark: string;
  status: number;
}
