import request from '@/utils/request'

export function listCampaign(query) {
  return request({
    url: '/campaign/list',
    method: 'get',
    params: query
  })
}

export function createCampaign(data) {
  return request({
    url: '/campaign/create',
    method: 'post',
    data
  })
}

export function readCampaign(data) {
  return request({
    url: '/ad/read',
    method: 'get',
    data
  })
}

export function updateCampaign(data) {
  return request({
    url: '/campaign/update',
    method: 'post',
    data
  })
}

export function deleteCampaign(data) {
  return request({
    url: '/campaign/delete',
    method: 'post',
    data
  })
}

export function allSkillGroup() {
  return request({
    url: '/campaign/allSkillGroup',
    method: 'get'
  })
}

/* 获取已分配的用户或技能组信息*/
export function readAssigned(data) {
  return request({
    url: '/campaign/readAssigned',
    method: 'get',
    params: data
  })
}

// 分配结果保存
export function assignedCampaign(data) {
  return request({
    url: '/campaign/assigned',
    method: 'post',
    data
  })
}
