import request from '@/utils/request'

export function getApplicationList(query) {
  return request({
    url: '/project/application/',
    method: 'get',
    params: query
  })
}

export function createApplication(data) {
  return request({
    url: '/project/application/',
    method: 'post',
    data
  })
}

export function deleteApplication(id) {
  return request({
    url: `/project/application/${id}/`,
    method: 'delete'
  })
}


export function updateApplication(id, data) {
  return request({
    url: `/project/application/${id}/`,
    method: 'put',
    data
  })
}

export function getApplication(id) {
  return request({
    url: `/project/application/${id}/`,
    method: 'get',
  })
}

export function createSubApplication(data) {
  return request({
    url: '/project/subapplication/',
    method: 'post',
    data
  })
}

export function getSubApplicationList(query) {
  return request({
    url: '/project/subapplication/',
    method: 'get',
    params: query
  })
}