import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ImgVO, ImgForm, ImgQuery } from '@/api/system/img/types';

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

export const listImg = (query?: ImgQuery): AxiosPromise<ImgVO[]> => {
  return request({
    url: '/system/img/list',
    method: 'get',
    params: query
  });
};

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

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

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

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

/**
 * 获取定位列表
 * @param query
 */
export const listPosition = () => {
  return request({
    url: '/system/position/group',
    method: 'get'
  });
};
