import request from '@/utils/request'

// 查询首页配置列表
export function listPostHomePage(query) {
  return request({
    url: '/system/postHomePage/list',
    method: 'get',
    params: query
  })
}

// 查询岗位列表
export function listPost(query) {
  return request({
    url: '/system/postHomePage/postList',
    method: 'get',
    params: query
  })
}

// 查询角色列表
export function listRole(query) {
  return request({
    url: '/system/postHomePage/roleList',
    method: 'get',
    params: query
  })
}

// 查询首页配置详细
export function getPostHomePage(postId) {
  return request({
    url: '/system/postHomePage/' + postId,
    method: 'get'
  })
}

// 获取当前用户的首页配置
export function getCurrentUserHomePage() {
  return request({
    url: '/system/postHomePage/getHomePage',
    method: 'get'
  })
}

// 新增首页配置
export function addPostHomePage(data) {
  return request({
    url: '/system/postHomePage',
    method: 'post',
    data: data
  })
}

// 修改首页配置
export function updatePostHomePage(data) {
  return request({
    url: '/system/postHomePage',
    method: 'put',
    data: data
  })
}

// 删除首页配置
export function delPostHomePage(postIds) {
  return request({
    url: '/system/postHomePage/' + postIds.join(','),
    method: 'delete'
  })
}