import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CardToolsVO, CardToolsForm, CardToolsQuery } from '@/api/system/business/cardTools/types';

/**
 * 查询配牌记录列表
 * @param query
 * @returns {*}
 */

export const listCardTools = (query?: CardToolsQuery): AxiosPromise<CardToolsVO[]> => {
  return request({
    url: '/business/cardTools/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询配牌记录详细
 * @param id
 */
export const getCardTools = (id: string | number): AxiosPromise<CardToolsVO> => {
  return request({
    url: '/business/cardTools/' + id,
    method: 'get'
  });
};

/**
 * 新增配牌记录
 * @param data
 */
export const addCardTools = (data: CardToolsForm) => {
  return request({
    url: '/business/cardTools',
    method: 'post',
    data: data
  });
};

/**
 * 修改配牌记录
 * @param data
 */
export const updateCardTools = (data: CardToolsForm) => {
  return request({
    url: '/business/cardTools',
    method: 'put',
    data: data
  });
};

/**
 * 删除配牌记录
 * @param id
 */
export const delCardTools = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/cardTools/' + id,
    method: 'delete'
  });
};
/**
 * 查询最新配牌记录
 */
export const selectBusinessCardToolsMaxNew = (): AxiosPromise<CardToolsVO> => {
  return request({
    url: '/business/cardTools/selectBusinessCardToolsMaxNew',
    method: 'get'
  });
};
export const removeRedisPokerHands = () => {
  return request({
    url: '/business/cardTools/removeRedisPokerHands',
    method: 'GET'
  });
};
