import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BlindLevelsVO, BlindLevelsForm, BlindLevelsQuery } from '@/api/system/physical/blindLevels/types';

/**
 * 查询线下盲注等级列表
 * @param query
 * @returns {*}
 */

export const listBlindLevels = (query?: BlindLevelsQuery): AxiosPromise<BlindLevelsVO[]> => {
  return request({
    url: '/physical/blindLevels/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询线下盲注等级详细
 * @param id
 */
export const getBlindLevels = (id: string | number): AxiosPromise<BlindLevelsVO> => {
  return request({
    url: '/physical/blindLevels/' + id,
    method: 'get'
  });
};

/**
 * 新增线下盲注等级
 * @param data
 */
export const addBlindLevels = (data: BlindLevelsForm) => {
  return request({
    url: '/physical/blindLevels',
    method: 'post',
    data: data
  });
};

/**
 * 修改线下盲注等级
 * @param data
 */
export const updateBlindLevels = (data: BlindLevelsForm) => {
  return request({
    url: '/physical/blindLevels',
    method: 'put',
    data: data
  });
};

/**
 * 删除线下盲注等级
 * @param id
 */
export const delBlindLevels = (id: string | number | Array<string | number>) => {
  return request({
    url: '/physical/blindLevels/' + id,
    method: 'delete'
  });
};
export const selectPhysicalBlindLevelsById = (id: number): AxiosPromise<BlindLevelsVO[]> => {
  return request({
    url: '/physical/blindLevels/selectPhysicalBlindLevelsById/' + id,
    method: 'get'
  });
};
