/*
 * @Author: wj 1454560336@qq.com
 * @Date: 2023-11-16 15:14:42
 * @LastEditors: wenjie 1454560336@qq.com
 * @LastEditTime: 2024-08-19 16:52:26
 * @FilePath: \admin-manage\src\api\common.js
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */

import request from '@/utils/request'

// 同步推送状态
export function syncNotified(params) {
  return request({
    url: '/vipserver/group/notified',
    method: 'post',
    params
  })
}

// 后台激活指定账号
export function labourActivation(params) {
  return request({
    url: '/vipserver/group/activation',
    method: 'post',
    params
  })
}

// 查看激活码列表
export function checkoutActivationCode(data) {
  return request({
    url: '/vipserver/group/activationList',
    method: 'post',
    data
  })
}

// 生成激活码
export function generateCode(data) {
  return request({
    url: '/vipserver/group/createTicket',
    method: 'post',
    data
  })
}

// 获取集团列表
export function getGroupList(data) {
  return request({
    url: '/vipserver/group/groupList',
    method: 'post',
    data
  })
}

// 获取套餐字典
export function getSetMealNameAndId(params) {
  return request({
    url: '/zswl-cloud-shop/setMeal/getSetMealNameAndId',
    method: 'get',
    params
  })
}

// 获取套餐列表
export function getList(params) {
    return request({
      url: '/zswl-cloud-shop/setMeal/list',
      method: 'get',
      params
    })
}

// 获取套餐详情
export function detail(params) {
    return request({
      url: '/zswl-cloud-shop/setMeal/detail',
      method: 'get',
      params
    })
}

// 添加修改套餐
export function addOrUpdate(data) {
    return request({
      url: '/zswl-cloud-shop/setMeal/addOrUpdate',
      method: 'post',
      data
    })
}

// 删除套餐
export function delMeal(params) {
  return request({
    url: '/zswl-cloud-shop/setMeal/del',
    method: 'get',
    params
  })
}

// 启用、禁用
export function operate(params) {
    return request({
      url: '/zswl-cloud-shop/setMeal/operate',
      method: 'get',
      params
    })
}


// 获取oss上传配置
export function getOssConfig(params) {
  return request({
    url: '/zswl-cloud-shop/shopInfo/getAppKeyAndSecure',
    method: 'get',
    params
  })
}

// 上传图片
export function requestUploadImg(data) {
  return request({
    url: '/zswl-cloud-shop/shopInfo/requestUploadImg',
    method: 'post',
    data
  })
}

// 上传完成
export function finishUploadImg(data) {
  return request({
    url: '/zswl-cloud-shop/shopInfo/finishUploadImg',
    method: 'post',
    data
  })
}

// 根据店铺id获取主体id
export function getMainId(data) {
  return request({
    url: '/zswl-cloud-shop/shopInfo/getMainId',
    method: 'post',
    data
  })
}

// 获取商品类型字典
export function getType(params) {
  return request({
    url: '/zswl-cloud-shop/goodsCoupon/getMsg',
    method: 'get',
    params
  })
}

// 地图搜索
export function getSearchList(params) {
  return request({
    url: '/baidu/place/v2/suggestion',
    method: 'get',
    params
  })
}


// 通过uid查询地址
export function uidToAddress(params) {
  return request({
    url: '/baidu/place/v2/detail',
    method: 'get',
    params
  })
}

// 城市列表
export function getCityList(params) {
  return request({
    url: '/productcenterserver/region/list',
    method: 'post',
    params
  })
}

// 平台城市列表
export function getChildRegionsList(params) {
  return request({
    url: '/productcenterserver/region/childRegionsList',
    method: 'post',
    params
  })
}

// 新增修改城市
export function putCity(data) {
  return request({
    url: '/productcenterserver/region/put',
    method: 'post',
    data
  })
}

// 删除城市
export function delCity(params) {
  return request({
    url: '/productcenterserver/region/remove',
    method: 'post',
    params
  })
}
