import request from '@/router/axios';
/**获取文章列表 */
export const getList =(current, size, params) => {
      return request({
        url: '/api/jobslink-api/desk/article/getAllArticle',
        method: 'get',
        params: {
          ...params,
          current,
          size,
        }
      })
    }

/**添加文章 */
export const addNews=(articleTitle,headPic,articleSrc,articleSrcUrl,author,description,note,type)=>{
  return request({
    url:'/api/jobslink-api/desk/article/save',
    method:'post',
    data:{
      articleTitle,
      headPic,
      articleSrc,
      articleSrcUrl,
      author,
      description,
      note,
      type
    }
  })
}

/**获取文章详情 */
export const getNewsDetail=(id)=>{
  return request({
    url:'/api/jobslink-api/desk/front/getArticle/'+id,
    method:'get'
  })
}

/**修改文章 */
export const editNews=(id,articleTitle,headPic,articleSrc,articleSrcUrl,author,description,note, type)=>{
  return request({
    url:'/api/jobslink-api/desk/article/save',
    method:'post',
    data:{
      id,
      articleTitle,
      headPic,
      articleSrc,
      articleSrcUrl,
      author,
      description,
      note,
      type
    }
  })
}

/**删除文章 */
export const delNews=(id)=>request({
  url:'/api/jobslink-api/desk/article/remove',
  method:'post',
  params:{
    id
  }
})

/**文章排序 */
export const order=(id,sort,move)=>{
  return request({
    url:'/api/jobslink-api/desk/article/mobile',
    method:'post',
    data:{
      id,sort,move
    }
  })
}

/**发布文章 */
export const release=(id,status)=>{
  return request({
    url:'/api/jobslink-api/desk/article/release',
    method:'post',
    data:{
      id,status
    }
  })
}
