import {
  api,
  downloadFile,
  createApiUrl
} from '~/utils/axios';



/**
 * 获取字典值
 * @param {Object} data
 * @return {Promise} api
 */
export function getDictionary(data) {
  return api.post('Dictionary.Dictionary/getDictionary', data, {});
}


/**
 * 获取海报列表
 * @param {Object} data
 * @return {Promise} api
 */
export function getPosterList(data) {
  return api.post('Banners.Poster/getPosterList', data);
}

/**
 * 删除海报
 * @param {Object} data
 * @return {Promise} api
 */
export function deletePoster(data) {
  return api.post('Banners.Poster/deletePoster', data, {
    isTransformResponse: true,
    isShowSuccessMessage: true,
    errorMessageText: '删除失败'
  });
}

/**
 * 添加海报
 * @param {Object} data
 * @return {Promise} api
 */
export function addPoster(data) {
  return api.post('Banners.Poster/addPoster', data, {
    isTransformResponse: true,
    isShowSuccessMessage: true,
    errorMessageText: '添加失败'
  });
}
/**
 * 编辑海报
 * @param {Object} data
 * @return {Promise} api
 */
export function editPoster(data) {
  return api.post('Banners.Poster/editPoster', data, {
    isTransformResponse: true,
    isShowSuccessMessage: true,
    errorMessageText: '编辑失败'
  });
}