import axiosApi from './AxiosApi.js'

const apiList = {
  addPromotion: `/promotion/addPromotion`,
  getList: `/promotion/findAdminPromotionList`,
  getDetails: `/promotion/query`,
  delPromotion: `/promotion/delete`,
  updatePromotion: `/promotion/updatePromotion`,
  finishPromotion: `/promotion/end`,
  applyShop: `/promotionApplyInfo/page`, // 参入店铺
  auditLog: `/promotionAuditLog/query`,
  getGoodList: `/product/findAdminProductListByIds`,
  auditPromotion: `/promotionApplyInfo/auditPromotion`,
  closeApplyInfo: `/promotionApplyInfo/closeApplyInfo`,
  getDetail: `/promotionStat/detail`,
  findTenantStatDetail: `/promotionStat/findTenantStatDetail`
}
export default {
  addPromotion(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.addPromotion,
      data
    })
  },
  getList(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.getList,
      data
    })
  },
  getDetails(id) {
    return axiosApi({
      method: 'GET',
      url: `${apiList.getDetails}/${id}`
    })
  },
  delPromotion(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.delPromotion,
      data
    })
  },
  updatePromotion(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.updatePromotion,
      data
    })
  },
  finishPromotion(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.finishPromotion,
      data
    })
  },
  // 参与店铺
  applyShop(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.applyShop,
      data
    })
  },
  // 审核记录
  auditLog(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.auditLog,
      data
    })
  },
  // 查看商品
  getGoodList(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.getGoodList,
      data
    })
  },
  // 报名审核
  auditPromotion(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.auditPromotion,
      data
    })
  },
  // 清退报名
  closeApplyInfo(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.closeApplyInfo,
      data
    })
  },
  /** 活动数据 */
  getDetail(id) {
    return axiosApi({
      method: 'GET',
      url: `${apiList.getDetail}/${id}`
    })
  },
  // 商家数据明细
  findTenantStatDetail(data) {
    return axiosApi({
      method: 'GET',
      url: apiList.findTenantStatDetail,
      data
    })
  }
}
