import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ItemsVO, ItemsForm, ItemsQuery } from '@/api/system/playerItems/types';

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

export const listItems = (query?: ItemsQuery): AxiosPromise<ItemsVO[]> => {
  return request({
    url: '/business/playerItems/list',
    method: 'get',
    params: query
  });
};

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

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

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

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