import request from '@/utils/request'

// 查询参数列表
export function listConfig(query) {
  return request({
    url: '/system/config/list',
    method: 'get',
    params: query
  })
}

export function listIndextwo(query) {
  return request({
    url: '/system/dict/data/type/' + query,
    method: 'get'
    // params: query
  })
}
export function listIndextherr(query) {
  return request({
    url: '/system/dict/data/type/' + query,
    method: 'get'
    // params: query listIndextherr
  })
}

// 查询参数详细
export function getConfig(id) {
  return request({
    url: '/system/config/' + id,
    method: 'get'
  })
}

// 根据参数键名查询参数值
export function getConfigKey(configKey) {
  return request({
    url: '/system/config/configKey/' + configKey,
    method: 'get'
  })
}

// 新增参数配置
export function addConfig(data) {
  return request({
    url: '/system/config',
    method: 'post',
    data: data
  })
}
export function addConfigindex(data) {
  return request({
    url: '/boman-web-core/p/cs/objectSave',
    method: 'post',
    data: data
  })
}

export function listIndex(data) {
  return request({
    url: '/boman-web-core/p/cs/queryList',
    method: 'post',
    data: data
  })
}
export function listIndexfou(data) {
  return request({
    url: '/boman-web-core/p/cs/queryList',
    method: 'post',
    data: data
  })
}
// export function listIndextanl(data) {
//   return request({
//     url: '/boman-web-core/p/cs/table/getByTableName',
//     method: 'post',
//     data: data
//   })
// }

export function listIndextanl(data) {
  return request({
    url: '/boman-web-core/p/cs/getObject',
    method: 'post',
    data: data
  })
}
// 修改参数配置
export function updateConfig(data) {
  return request({
    url: '/system/config',
    method: 'put',
    data: data
  })
}

// 删除参数配置
export function delConfig(id) {
  return request({
    url: '/system/config/' + id,
    method: 'delete'
  })
}

export function delIndexnabd(data) {
  return request({
    url: 'boman-web-core/p/cs/objectDelete',
    method: 'POST',
    data
  })
}

// 清理参数缓存
export function clearCache() {
  return request({
    url: '/system/config/clearCache',
    method: 'delete'
  })
}
// 查询用户个人信息
export function getUserProfile() {
  return request({
    url: '/system/user/profile',
    method: 'get'
  })
}
