import request from '@/utils/request'

/**
 * 获取展商列表接口
 * @param {number} page 页码
 * @param {number} page_size 每页数量
 * @param {string} expo_name 展商名称
 * @returns {*}
 */
export function getExpoList(page, page_size, expo_name) {
  return request({
    url: '/api/expo/list',
    method: 'get',
    params: {
      page,
      page_size,
      expo_name
    }
  })
}
/**
 * 获取自己展商详情接口
 * @param id 展商ID
 * @returns {*}
 */
export function getMyExpoInfo(id) {
  return request({
    url: '/api/expo/my-info',
    method: 'get',
    params: {
      id
    }
  })
}
/**
 * 获取展会详情接口
 * @param key 展商urla
 * @returns {*}
 */
export function getExpoInfo(key) {
  return request({
    url: '/api/expo/info',
    method: 'get',
    params: {
      key
    }
  })
}
/**
 * 保存展会信息
 * @param {number} id
 * @param {string} expo_name
 * @param {string} start_date
 * @param {string} end_date
 * @param {string} location
 * @param {string} organizer
 * @param {string} contact_phone
 * @param {string} contact_email
 * @param {string} content
 * @param {string} logo
 * @param {array} images
 * @param {object} social_links
 * @param {string} form_template_id
 * @param {string} page_template_id
 * @param {string} urla
 * @param {string} seo_title
 * @param {string} seo_description
 * @param {string} seo_keywords
 * @returns {*}
 */
export function saveExpo(id,expo_name,start_date,end_date,location,organizer,contact_phone,contact_email,content,logo,images,social_links,form_template_id,page_template_id,urla,seo_title,seo_description,seo_keywords) {
  return request({
    url: '/api/expo/info',
    method: 'post',
    data:{
      id,
      expo_name,
      start_date,
      end_date,
      location,
      organizer,
      contact_phone,
      contact_email,
      content,
      logo,
      images,
      social_links,
      form_template_id,
      page_template_id,
      urla,
      seo_title,
      seo_description,
      seo_keywords
    }
  })
}
/**
 * 删除展会接口
 * @param id 展商ID
 * @returns {*}
 */
export  function deleteExpo(id) {
  return request({
    url: '/api/expo/info',
    method: 'delete',
    data:{
      id
    }
  })
}
/**
 * 设置展会状态接口
 * @param id 展商ID
 * @param status 状态
 * @returns {*}
 */
export function setExpoStatus(id,status) {
  return request({
    url: '/api/expo/status',
    method: 'post',
    data:{
      id,
      status
    }
  })
}
