import request from '@/utils/request'
import { postForm } from '@/utils/legacyRequest'

const headers = { isToken: false }

export function listTemplate(query) {
  return postForm('/risk/template/list', query, { headers })
}

export function getTemplate(templateId) {
  return request({
    url: '/risk/template/' + templateId,
    method: 'get',
    headers
  })
}

export function addTemplate(data) {
  return postForm('/risk/template/add', data, { headers })
}

export function updateTemplate(data) {
  return postForm('/risk/template/edit', data, { headers })
}

export function delTemplate(templateId) {
  return postForm('/risk/template/remove', { ids: templateId }, { headers })
}
