import request from '@/utils/request'

// 查询cmc学习资料列表
export function listResource(query) {
  return request({
    url: '/oa/resource/list',
    method: 'get',
    params: query
  })
}
// 查询cmc学习资料列表根据类名
export function getListBelow(query) {
  return request({
    url: '/oa/resource/getListBelow',
    method: 'get',
    params: query
  })
}
// 查询cmc学习资料详细
export function getResource(resourceId) {
  return request({
    url: '/oa/resource/' + resourceId,
    method: 'get'
  })
}

// 新增cmc学习资料
export function addResource(data) {
  return request({
    url: '/oa/resource',
    method: 'post',
    data: data
  })
}

// 修改cmc学习资料
export function updateResource(data) {
  return request({
    url: '/oa/resource',
    method: 'put',
    data: data
  })
}

// 删除cmc学习资料
export function delResource(resourceId) {
  return request({
    url: '/oa/resource/' + resourceId,
    method: 'delete'
  })
}
