import { defHttp } from '@/utils/http/axios';
enum Api {
  imageUpload = '/api/goview/project/image/upload',
  imageList = '/api/goview/project/image/list',
  imageDelete = '/api/goview/project/image/delete',
  imageGroupList = '/api/goview/project/imageGroup/list',
}

export const imageList = (params:{GroupName:string,page:number,limit:number,key?:string}) =>
  defHttp.get({ 
    url: Api.imageList,
    params
  });

export const getImageGroupList = () =>
  defHttp.get({ url: Api.imageGroupList });

export const imageDelete = (id:string) =>
  defHttp.post({ 
    url: `${Api.imageDelete}?ids=${id}`
  });

export const imageUpload = (params,groupName) =>
  defHttp.post({
    url: `${Api.imageUpload}?groupName=${groupName}`,
    params,
    headers: {
      'Content-type': 'multipart/form-data',
    },
  });