import httpRequest from '@/utils/axios'

/**
 * 新建学员
 */
export function createStudent(data) {
  return httpRequest.post('/api/certificate/v1/backend/student/create', data)
}

/**
 * 获取应用列表
 */
export function getAppList(params) {
  return httpRequest.get('/api/certificate/v1/backend/student/list', { params })
}

/**
 * 导入
 */
export function importPeople(data) {
  return httpRequest({
    url: '/api/certificate/v1/backend/student/import',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    timeout: 900000,
    data,
    withCredentials: true
  })
}

/**
 * 更新学员
 */
export function updateStudent(data) {
  return httpRequest.post('/api/certificate/v1/backend/student/update', data)
}

/**
 * 获取详情
 */
export function getDetails(params) {
  return httpRequest.get('/api/certificate/v1/backend/student/view', { params })
}

/**
 * 删除学员
 */
export function deleteStudent(data) {
  return httpRequest.post('/api/certificate/v1/backend/student/delete', data)
}

/**
 * 获取项目列表
 */
export function getProjectList(params) {
  return httpRequest.get('/api/certificate/v1/backend/project/list', { params })
}

/**
 * 获取模板列表
 */
export function getTemplateList(params) {
  return httpRequest.get('/api/certificate/v1/backend/template/list', { params })
}
