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 getBannerList(data) {
  return api.post('Banners.Banner/getBannerList', data);
}

/**
 * 删除轮播图
 * @param {Object} data
 * @return {Promise} api
 */
export function deleteBanner(data) {
  return api.post('Banners.Banner/deleteBanner', data, {
    isTransformResponse: true,
    isShowSuccessMessage: true,
    errorMessageText: '删除失败'
  });
}

/**
 * 添加轮播图
 * @param {Object} data
 * @return {Promise} api
 */
export function addBanner(data) {
  return api.post('Banners.Banner/addBanner', data, {
    isTransformResponse: true,
    isShowSuccessMessage: true,
    errorMessageText: '添加失败'
  });
}
/**
 * 编辑轮播图
 * @param {Object} data
 * @return {Promise} api
 */
export function editBanner(data) {
  return api.post('Banners.Banner/editBanner', data, {
    isTransformResponse: true,
    isShowSuccessMessage: true,
    errorMessageText: '编辑失败'
  });
}