import { request } from '@/service/request';

/**
 * 员工列表-积分统计
 */
export function fetchGetUserList(params: any) {
  return request<Api.government.userList[]>({
    url: '/admin/enterprise/enterpriseUserList',
    method: 'get',
    params
  });
}

/**
 * 新增员工
 */
export function fetchAddUser(data: any) {
  return request({
    url: '/admin/enterprise/addUser',
    method: 'POST',
    data
  });
}

/**
 * 修改员工
 */
export function fetchEditUser(data: any) {
  return request({
    url: '/admin/enterprise',
    method: 'PUT',
    data
  });
}

/**
 * 删除员工
 */
export function fetchDeleteUser(id: number) {
  return request({
    url: `/admin/enterprise/deleteUserById?userId=${id}`,
    method: 'DELETE'
  });
}

/**
 * 导入员工
 * @param data
 * @returns
 */
export function fetchExportUser(data: { file: File }) {
  return request({
    url: '/admin/enterprise/uploadExcelGoods',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

/**
 * 导入记录
 */

export function fetchGetImportRecordList() {
  return request<Api.government.importRecordList[]>({
    url: '/admin/enterprise/enterpriseUserLogList',
    method: 'get'
  });
}
