import request from '@/utils/request';

/**
 * 获取历史记录
 * @returns 
 */
export function fetchHistory() {
  return request({
    url: `/console/hot_search_history/list`,
    method: 'get'
  });
}

/**
 * 增加历史记录
 * @param keyword {string}
 * @returns 
 */
export function addHistory(keyword: string) {
  return request({
    url: `/console/hot_search_history/add`,
    method: 'post',
    data: {
      keyword: keyword
    }
  });
}

/**
 * 删除所有的历史记录
 * @returns
 */
export function clearHistory() {
  return request({
    url: `/console/hot_search_history/clear`,
    method: 'post'
  });
}
