import request from '@/utils/request'

export function listSourceProject(query) {
  return request({
    url: '/generator/sourceProject/list',
    method: 'get',
    params: query
  })
}

export function getSourceProject(projectId) {
  return request({
    url: '/generator/sourceProject/' + projectId,
    method: 'get'
  })
}

export function addSourceProject(data) {
  return request({
    url: '/generator/sourceProject',
    method: 'post',
    data: data
  })
}

export function updateSourceProject(data) {
  return request({
    url: '/generator/sourceProject',
    method: 'put',
    data: data
  })
}

export function changeSourceProjectStatus(projectId, status) {
  return request({
    url: '/generator/sourceProject/changeStatus',
    method: 'put',
    data: { projectId, status }
  })
}

export function delSourceProject(projectId) {
  return request({
    url: '/generator/sourceProject/' + projectId,
    method: 'delete'
  })
}
