import http from '../utils/http'

/**
 * 用户相关的
 */
// 登录
export const apiLogin = data => {
  return http({ url: '/lz_management/sys/login', method: 'post', data })
}

// 退出登录
export const apiLogout = data => {
  return http({ url: '/lz_management/sys/logout', method: 'post', data })
}

// 修改密码
export const apiSysUserPassword = data => {
  return http({ url: '/lz_management/sys/user/password', method: 'post', data })
}

// 获取用户相关
export const apiGetUserInfo = (params, id) => {
  return http({ url: `/lz_management/sys/user/info${id}`, method: 'get', params })
}

// 获取用户相关
export const apiSsysSendSMS = (params, id) => {
  return http({ url: `/lz_management/sys/sendSMS`, method: 'post', params })
}
/**
 * 管理员列表
 */
// 获取管理员列表
export const apiSysUserList = params => {
  return http({ url: '/lz_management/sys/user/list', method: 'get', params })
}

// 获取角色选择列表
export const apiSysRoleSelect = params => {
  return http({ url: '/lz_management/sys/role/select', method: 'get', params })
}

// 编辑用户
export const apiSysUserInfo = (params, id) => {
  return http({ url: `/lz_management/sys/user/info${id}`, method: 'get', params })
}

// 提交用户
export const apiSysUserConfirm = (data, type) => {
  return http({ url: `/lz_management/sys/user${type}`, method: 'post', data })
}

// 删除用户
export const apiSysUserDelete = data => {
  return http({ url: `/lz_management/sys/user/delete`, method: 'post', data })
}

/**
 * 角色管理
 */
// 角色管理列表
export const apiSysRoleList = params => {
  return http({ url: '/lz_management/sys/role/list', method: 'get', params })
}

// 编辑角色
export const apiSysRoleInfo = (params, id) => {
  return http({ url: `/lz_management/sys/role/info${id}`, method: 'get', params })
}

// 提交角色
export const apiSysRoleConfirm = (data, type) => {
  return http({ url: `/lz_management/sys/role${type}`, method: 'post', data })
}

// 删除角色
export const apiSysRoleDelete = data => {
  return http({ url: `/lz_management/sys/role/delete`, method: 'post', data })
}

/**
 * 菜单管理
 */
// 菜单管理列表
export const apiSysMenuList = params => {
  return http({ url: '/lz_management/sys/menu/list', method: 'get', params })
}

// 获取菜单选择列表
export const apiSysMenuSelect = params => {
  return http({ url: '/lz_management/sys/menu/select', method: 'get', params })
}

// 编辑菜单
export const apiSysMenuInfo = (params, id) => {
  return http({ url: `/lz_management/sys/menu/info${id}`, method: 'get', params })
}

// 提交菜单
export const apiSysMenuConfirm = (data, type) => {
  return http({ url: `/lz_management/sys/menu${type}`, method: 'post', data })
}

// 删除菜单
export const apiSysMenuDelete = (data, id) => {
  return http({ url: `/lz_management/sys/menu/delete${id}`, method: 'post', data })
}

/**
 * 定时任务
 */
// 定时任务列表
export const apiSysScheduleList = params => {
  return http({ url: '/lz_management/sys/schedule/list', method: 'get', params })
}

// 删除定时任务
export const apiSysScheduleDelete = data => {
  return http({ url: `/lz_management/sys/schedule/delete`, method: 'post', data })
}

// 暂停定时任务
export const apiSysSchedulePause = data => {
  return http({ url: `/lz_management/sys/schedule/pause`, method: 'post', data })
}

// 恢复定时任务
export const apiSysScheduleResume = data => {
  return http({ url: `/lz_management/sys/schedule/resume`, method: 'post', data })
}

// 立即执行定时任务
export const apiSysScheduleRun = data => {
  return http({ url: `/lz_management/sys/schedule/run`, method: 'post', data })
}

// 定时任务日志列表
export const apiSysScheduleLogList = params => {
  return http({ url: '/lz_management/sys/scheduleLog/list', method: 'get', params })
}

// 定时任务日志失效信息
export const apiSysScheduleLogInfo = (params, id) => {
  return http({ url: `/lz_management/sys/scheduleLog/info${id}`, method: 'get', params })
}

// 编辑定时任务
export const apiSysScheduleInfo = (params, id) => {
  return http({ url: `/lz_management/sys/schedule/info${id}`, method: 'get', params })
}

// 提交定时任务
export const apiSysScheduleConfirm = (data, type) => {
  return http({ url: `/lz_management/sys/schedule${type}`, method: 'post', data })
}

/**
 * 参数管理
 */
// 定时任务列表
export const apiSysConfigList = params => {
  return http({ url: '/lz_management/sys/config/list', method: 'get', params })
}

// 删除参数
export const apiSysConfigDelete = data => {
  return http({ url: `/lz_management/sys/config/delete`, method: 'post', data })
}

// 编辑参数
export const apiSysConfigInfo = (params, id) => {
  return http({ url: `/lz_management/sys/config/info${id}`, method: 'get', params })
}

// 提交参数
export const apiSysConfigConfirm = (data, type) => {
  return http({ url: `/lz_management/sys/config${type}`, method: 'post', data })
}

/**
 * 日志管理
 */
// 日志管理列表
export const apiSysLogList = params => {
  return http({ url: '/lz_management/sys/log/list', method: 'get', params })
}

/**
 * 文件上传
 */
// 文件上传列表
export const apiSysOssList = params => {
  return http({ url: '/lz_management/sys/oss/list', method: 'get', params })
}

// 删除文件上传记录
export const apiSysOssDelete = data => {
  return http({ url: `/lz_management/sys/oss/delete`, method: 'post', data })
}

// 编辑云储存配置
export const apiSysOssConfig = params => {
  return http({ url: `/lz_management/sys/oss/config`, method: 'get', params })
}

// 提交云储存配置
export const apiSysOssSaveConfig = params => {
  return http({ url: `/lz_management/sys/oss/saveConfig`, method: 'get', params })
}
