import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HotVO, HotForm, HotQuery } from '@/api/system/hot/types';

/**
 * 查询【请填写功能名称】列表
 * @param query
 * @returns {*}
 */

export const listHot = (query?: HotQuery): AxiosPromise<HotVO[]> => {
  return request({
    url: '/system/hot/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param hotId
 */
export const getHot = (hotId: string | number): AxiosPromise<HotVO> => {
  return request({
    url: '/system/hot/' + hotId,
    method: 'get'
  });
};

/**
 * 新增【请填写功能名称】
 * @param data
 */
export const addHot = (data: HotForm) => {
  return request({
    url: '/system/hot',
    method: 'post',
    data: data
  });
};

/**
 * 修改【请填写功能名称】
 * @param data
 */
export const updateHot = (data: HotForm) => {
  return request({
    url: '/system/hot',
    method: 'put',
    data: data
  });
};

/**
 * 删除【请填写功能名称】
 * @param hotId
 */
export const delHot = (hotId: string | number | Array<string | number>) => {
  return request({
    url: '/system/hot/' + hotId,
    method: 'delete'
  });
};
