

import { fetch } from '@utils/request'
import {
  API_QRCODE,
  API_BANNER_LIST,
  API_QUERY_CODE_SCENE,
  API_BURIED_POINT,
  API_CITY_LIST
} from '@constants/api'

/**
 * 获取二维码
 *  @param {*} payload
 * 
*/
export const getMiniQrcode = payload => fetch({ url: API_QRCODE, payload, method: 'POST' })

/**
 * 获取二维码参数
 *  @param {*} scene
 * 
*/
export const getCodeScene = scene => fetch({ url: `${API_QUERY_CODE_SCENE}/${scene}` })


/**
 * 获取banner列表
 *  @param {*} type 打开方式, 这里值为 banner(轮播图) 或者 screen(首屏广告)
 *  @param {*} payload 
 * 
 * 
*/
export const queryBanners = (type, payload) => fetch({ url: `${API_BANNER_LIST}/${type}`, payload })

/**
 * 新增埋点
 * @param {*} payload 
 */
export const savePoint = (payload) => fetch({ url: API_BURIED_POINT, payload, method: 'POST' })


/**
 * 更新埋点
 * @param {*} id 
 * @param {*} payload
 */
export const updatePoint = (id, payload) => fetch({ url: `${API_BURIED_POINT}/${id}`, payload, method: 'PUT' })


/**
 * 获取城市列表
 * @param {*} 
 */
export const queryCityList = () => fetch({ url: API_CITY_LIST })



