import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PicVO, PicForm, PicQuery } from '@/api/system/business/pic/types';

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

export const listPic = (query?: PicQuery): AxiosPromise<PicVO[]> => {
  return request({
    url: '/business/pic/list',
    method: 'get',
    params: query
  });
};

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

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

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

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