import request from '@/utils/request'

/**
 * 获取微信公众号图文素材列表
 * @param {*} query type 类型： 1采美，2呵呵商城
 */
export function fetchList(query) {
  return request({
    url: '/wechat/article/list',
    method: 'get',
    params: query
  })
}

/**
 * 根据ID获取微信公众号图文素材
 */
export function getArticle(id) {
  return request({
    url: '/wechat/article/' + id,
    method: 'get'
  })
}

/**
 * 根据ID更新微信公众号图文素材
 */
export function updateArticle(id, data) {
  return request({
    url: '/wechat/article/update/' + id,
    method: 'post',
    data: data
  })
}

/**
 * 添加微信公众号图文素材
 */
export function createArticle(data) {
  return request({
    url: '/wechat/article/create',
    method: 'post',
    data: data
  })
}

/**
 * 根据ID删除微信公众号图文素材
 */
export function deleteArticle(id) {
  return request({
    url: '/wechat/article/delete/' + id,
    method: 'post'
  })
}
