import http from '@/utils/axios'

/**
 * 点赞
 */
export const API_setLike = (type: 'star' | 'visit') => {
  // 这个项目暂时没有 visit 访问量
  return http.get(`show/visit/add/${type}`)
}

/**
 * 获取点赞详情
 */
export const API_getLike = () => {
  return http.get('show/visit/detail')
}

/**
 * 获取留言列表
 */
export const API_getMsgList = () => {
  const data = {
    pageNum: 1,
    pageSize: 99999
  }
  return http.post('show/message/pageList', data)
}

/**
 * 获取验证码
 */
export const API_getCode = () => {
  return http.get('admin/getRandCode', { responseType: 'blob' })
}

/**
 * 留言列表新增
 */
export const API_msgSave = (data: any) => {
  return http.post('show/message/save', data)
}
