import { appservice } from '@/utils/apiService'

const baseUrl = '/api/samples'

export function get(id) {
  return appservice({
    url: `${baseUrl}/${id}`,
    method: 'get'
  })
}

export function getList(params) {
  return appservice({
    url: `${baseUrl}`,
    method: 'get',
    params
  })
}

export function create(data) {
  return appservice({
    url: `${baseUrl}`,
    method: 'post',
    data
  })
}

export function update(id, data) {
  return appservice({
    url: `${baseUrl}/${id}`,
    method: 'put',
    data
  })
}

export function remove(id) {
  return appservice({
    url: `${baseUrl}/${id}`,
    method: 'delete'
  })
}

export function submit(id, data) {
  return appservice({
    url: `${baseUrl}/submit/${id}`,
    method: 'post',
    data
  })
}

export function revoke(id, concurrencyStamp) {
  return appservice({
    url: `${baseUrl}/revoke/${id}`,
    method: 'post',
    params: { concurrencyStamp }
  })
}
