import request from '@/utils/request'

// ******商家列表******
// 商家管理查询
export function businessListGetAll(data) {
  return request({
    url: '/shop/getAll',
    method: 'post',
    data
  })
}

// 新增商家
export function businessListSave(data) {
  return request({
    url: '/shop/save',
    method: 'post',
    data
  })
}

// 商家编辑查询
export function businessListGetById(data) {
  return request({
    url: '/shop/getById',
    method: 'post',
    data
  })
}

//   修改商家
export function businessListUpdate(data) {
  return request({
    url: '/shop/update',
    method: 'post',
    data
  })
}

// 启停用商家
export function businessListStart(data) {
  return request({
    url: '/shop/start',
    method: 'post',
    data
  })
}

export function delBusinessById(data) {
  return request({
    url: '/shop/cleanShop',
    method: 'post',
    data
  })
}

// 入驻申请
// 入驻申请管理查询
export function settlementGetAll(data) {
  return request({
    url: '/check/getAll',
    method: 'post',
    data
  })
}

// 入驻申请详情
export function settlementGetById(data) {
  return request({
    url: '/check/getById',
    method: 'post',
    data
  })
}

// 处理
export function settlementHandle(data) {
  return request({
    url: '/check/handle',
    method: 'post',
    data
  })
}

// 删除
export function settlementDelete(data) {
  return request({
    url: '/check/delete',
    method: 'post',
    data
  })
}

// **********************关键词**********************
// 启停用
export function wordStart(data) {
  return request({
    url: '/word/start',
    method: 'post',
    data
  })
}

// 启停用
export function wordGetAll(data) {
  return request({
    url: '/word/getAll',
    method: 'post',
    data
  })
}

// 添加关键词
export function wordAdd(data) {
  return request({
    url: '/word/save',
    method: 'post',
    data
  })
}

// 修改关键词查询
export function wordGetById(data) {
  return request({
    url: '/word/getById',
    method: 'post',
    data
  })
}

// 修改关键词
export function wordUpdate(data) {
  return request({
    url: '/word/update',
    method: 'post',
    data
  })
}

// 删除关键词
export function wordDelete(data) {
  return request({
    url: '/word/delete',
    method: 'post',
    data
  })
}

// **********************商家分类**********************
// 添加商家分类
export function businessClassList(data) {
  return request({
    url: '/shopCategory/getAll',
    method: 'post',
    data
  })
}

// 根据一级获取
export function businessClassListById(data) {
  return request({
    url: '/shopCategory/getById',
    method: 'post',
    data
  })
}

// 删除标签分类
export function deleteBusinessClass(data) {
  return request({
    url: '/shopCategory/deleteCategory',
    method: 'post',
    data
  })
}

// 更新标签
export function updateBusinessClass(data) {
  return request({
    url: '/shopCategory/updateCategory',
    method: 'post',
    data
  })
}

// 添加分类
export function addBusinessClass(data) {
  return request({
    url: '/shopCategory/addCategory',
    data,
    method: 'post'
  })
}

// **********品牌工厂***********
// 获取所有分类

export function factoryClassList(data) {
  return request({
    url: '/shopCategoryMall/getAll',
    method: 'post',
    data
  })
}

export function factoryClassListById(data) {
  return request({
    url: '/shopCategoryMall/getById',
    method: 'post',
    data
  })
}

// 删除标签分类
export function deleteFactoryClass(data) {
  return request({
    url: '/shopCategoryMall/deleteCategory',
    method: 'post',
    data
  })
}

// 更新标签
export function updateFactoryClass(data) {
  return request({
    url: '/shopCategoryMall/updateCategory',
    method: 'post',
    data
  })
}

// 添加分类
export function addFactoryClass(data) {
  return request({
    url: '/shopCategoryMall/addCategory',
    data,
    method: 'post'
  })
}

// 获取所有分类树
export function getAllCategoryClassTree(data) {
  return request({
    url: 'shopCategory/getAllTree',
    data,
    method: 'get'
  })
}

//  分页查询商家的收款码
export function getAllPaymentCode(data) {
  return request({
    url: '/paymentCode/getAll',
    data,
    method: 'post'
  })
}

//  禁用该收款码
export function disablePaymentCode(data) {
  return request({
    url: '/paymentCode/handle',
    data,
    method: 'post'
  })
}

// **********商家代金券提现申请***********

//  查询申请列表
export function getWithdrawalApplicationList(data) {
  return request({
    url: '/shop-vouchers-withdrawal-qualification/getWithdrawalQualificationAll',
    data,
    method: 'post'
  })
}

// 审核
export function examineWithdrawalApplication(data) {
  return request({
    url: '/shop-vouchers-withdrawal-qualification/auditWithdrawalQualification',
    data,
    method: 'post'
  })
}

// 代金券提现记录
export function getWithdrawalRecortAllApi(data) {
  return request({
    url: '/shop-vouchers-withdrawal-qualification/getWithdrawalRecortAll',
    data,
    method: 'post'
  })
}

// **********同城联盟卡1***********

// 获取联盟卡列表
export function getAllianceCardListApi(params) {
  return request({
    url: '/alliance-card/getAll',
    params,
    method: 'get'
  })
}

// 获取联盟卡列表
export function auditAllianceCardApi(data) {
  return request({
    url: '/alliance-card/auditAllianceCard',
    data,
    method: 'POST'
  })
}

// 获取联盟卡加盟商家列表
export function getRegistrationShopsByIdApi(params) {
  return request({
    url: '/alliance-card/getRegistrationShopsById',
    params,
    method: 'GET'
  })
}

// 查询购买联盟卡的用户列表
export function getBuyerPurchaseByByIdApi(params) {
  return request({
    url: '/alliance-card/getBuyerPurchaseByById',
    params,
    method: 'GET'
  })
}

// 查询用户联盟卡消费记录
export function getConsumptionRecordByUserIdAndAllianceCardIdApi(params) {
  return request({
    url: '/alliance-card/getConsumptionRecordByUserIdAndAllianceCardId',
    params,
    method: 'GET'
  })
}
