import { defHttp } from '/@/utils/http/axios';

import { setParams } from '/@/utils/index';

enum Api {
  articleNumber = '/biz/educationLibrary/statusNumber',
  articleStatus = '/biz/educationLibrary/status',
  articleList = '/biz/educationLibrary/query/page',
  articleDel = '/biz/educationLibrary/removeByIds',
  articleAdd = 'biz/educationLibrary/add',
  articleEdit = '/biz/educationLibrary/edit',
  articleById = '/biz/educationLibrary/detail',
}

export const articleList = (params?: object) => {
  return defHttp.post({ url: Api.articleList, params: setParams(params) });
};

export const articleStatus = (id?: String) => {
  return defHttp.get({ url: Api.articleStatus + '/' + id });
};

export const articleDel = (params?: object) => {
  return defHttp.post({ url: Api.articleDel, params: params });
};
export const articleNumber = () => {
  return defHttp.get({ url: Api.articleNumber });
};

export const articleAdd = (params?: object) => {
  return defHttp.post({ url: Api.articleAdd, params: params });
};

export const articleEdit = (params?: object) => {
  return defHttp.post({ url: Api.articleEdit, params: params });
};

export const articleById = (id: string) => {
  return defHttp.get({ url: Api.articleById + '/' + id });
};
