import { requestClient } from '#/api/request';

const prefix = 'product-image/';
/**
 * 分页查询商品图片列表
 * @param data
 */
export async function getProductImageListApi(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

/**
 * 获取商品图片详情
 * @param id
 */
export async function getProductImageInfoApi(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增商品图片
 * @param data
 */
export async function createProductImageApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑商品图片
 * @param data
 */
export async function updateProductImageApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除商品图片
 * @param data
 */
export async function deleteProductImageApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
