import request from '@/utils/request';

interface MetaData {
  EID: string;
  ECODE: string;
  ENAME: string;
  PUBLISHER: string;
  PUBLISHDATE: string;
}

export interface RegisterResp {
  data: Record<any, any>;
  success: boolean;
}

interface deleteData {
  EID: string;
}

// 新增
export async function addList(data: MetaData) {
  return request.request<MetaData, RegisterResp>({
    url: '/practice/tclBook/add',
    method: 'POST',
    data,
  });
}

// 查询
export async function searchList(data: MetaData) {
  return request.request<MetaData, RegisterResp>({
    url: '/practice/tclBook/list ',
    method: 'POST',
    data,
  });
}

export async function deleteList(data: deleteData) {
  return request.request<deleteData, RegisterResp>({
    url: '/practice/tclBook/delete',
    method: 'POST',
    data,
  });
}

export async function updateList(data: MetaData) {
  return request.request<MetaData, RegisterResp>({
    url: '/practice/tclBook/update',
    method: 'POST',
    data,
  });
}
