import http from '@/utils/request'

/**
 * 列表前端配置表
 * @param { Object } data
 * @param data.entity.webSettingCategory
 * 配置类型
 * 默认 tableTitle => 默认字段 暂未使用
 *      chartClass => 自动图表->图表分类
 *      chartList => 自动图表类型
 *      chartLibrary => 图表库
 *      tableManage => 表头管理
 * @returns
 */
export function getSettingList (data) {
  return http.post('/authentication/web/setting/list', data)
}

// 列表前端配置表 保存
export function saveSettingList (data) {
  return http.post('/authentication/web/setting/save', data)
}

// 列表前端配置表 删除
export function deleteSettingList (data) {
  return http.post('/authentication/web/setting/del', data)
}

// 修改个性化配置
export function updateSystemSetting (data) {
  return http.post('/authentication/companyInfo/setting/update', data)
}

// 查询租户配置
export function getSettingInfo (data) {
  return http.post('/authentication/companyInfo/tenantcode', data)
}

// 业务应用程序更新===============================================
// 上传更新包
export function uploadVersionPackage (params) {
  return http.upload('/op_maintenance/install/package/upload', params)
}

// 查询更新包列表
export function uploadVersionPackageList (params) {
  return http.post('/op_maintenance/install/package/list', params)
}

// 执行更新包
export function runVersionPackage (params) {
  return http.post('/op_maintenance/install/package/run', params)
}

// 获取手机验证码
export function getVerificationCode (params) {
  return http.post('/authentication/send/shot/message/verification/code', params)
}

// 执行更新包日志
export function versionPackageLog (params) {
  return http.post('/op_maintenance/log/list', params)
}

// 日志下载 当前
export function versionLogDownload () {
  return http.download('/op_maintenance/log/download')
}

// 版本日志下载 带参数
export function versionLogDownloadHasParam (params) {
  return http.download('/op_maintenance/log/download2', params)
}

// 查看更新历史
export function versionLogHistory (params) {
  return http.post('/op_maintenance/version/upgradation/log', params)
}

// 查看更新历史
export function versionLogDetails (params) {
  return http.post('/op_maintenance/log/history', params)
}

// 运维应用程序更新================================================
// 上传文件并执行文件
export function uploadRunPackage (params) {
  return http.upload('/op_maintenance/upgradation/run', params)
}

// 程序监控=======================================================
// 程序列表
export function appList (params) {
  return http.post('/op_maintenance/app/list', params)
}

// 重启程序
export function appRestart (params) {
  return http.post('/op_maintenance/app/restart', params)
}

// 程序日志
export function appLog (params) {
  return http.post('/op_maintenance/app/logs', params)
}

// 程序日志清理
export function appLogClean (params) {
  return http.post('/op_maintenance/app/clean/logs', params)
}

// 解锁运行状态
export function cancelRunState () {
  return http.post('/op_maintenance/install/run/state/cancel')
}

// =============== 站内信 ================ //
// 站内信列表
export function getMessageList (params) {
  return http.post('/authentication/message/website/list', params)
}

// 站内信已读
export function setMessageRead (params) {
  return http.post('/authentication/message/website/read', params)
}

// 站内信删除
export function deleteMessage (params) {
  return http.post('/authentication/message/website/del', params)
}

// 站内信全设已读
export function setAllMessageRead () {
  return http.post('/authentication/message/website/read/all')
}

// 站内信已读全删除
export function deleteAllMessageRead () {
  return http.post('/authentication/message/website/read/del')
}

// 刷新token
export function refreshToken () {
  return http.post('/authentication/user/token/refresh')
}

// 获取树状机构
export function getOrganizationTree () {
  return http.post('/digitizationData/organization/tree')
}

// 导入树状机构
export function uploadOrganizationTree () {
  return http.upload('/digitizationData/organization/upload')
}

// 导出树状机构
export function exportOrganizationTree () {
  return http.download('/digitizationData/organization/export')
}

// 导出树状机构模板
export function exportOrganizationTreeTemplate () {
  return http.download('/digitizationData/organization/download/tmp')
}

// 保存机构树
export function saveOrganizationTree (params) {
  return http.post('/digitizationData/organization/save', params)
}

// 删除树状机构
export function deleteOrganization (params) {
  return http.post('/digitizationData/organization/del', params)
}

// 设置埋点
export function setBurialPoint (params) {
  return http.post('/authentication/access/record/log/save', params)
}

// 获取统计信息
export function getBurialPointStatistics () {
  return http.get('/authentication/access/record/log/home/statistics')
}

// 花名册列表
export function getRosterList (params) {
  return http.post('/digitizationData/t/raw/employee/list/list', params)
}

// 花名册详情
export function getRosterDetails (params) {
  return http.post('/digitizationData/t/raw/employee/list/detail', params)
}

// 花名册保存
export function saveRoster (params) {
  return http.post('/digitizationData/t/raw/employee/list/save', params)
}

// 花名册删除
export function deleteRoster (params) {
  return http.post('/digitizationData/t/raw/employee/list/del', params)
}

// 花名册上传
export function uploadRoster (params) {
  return http.upload('/digitizationData/t/raw/employee/list/upload', params)
}
