/**
 * 商品管理相关API
 */

import { get } from '@/utils/request';

export interface ProductQueryParams {
  page?: number;
  pageSize?: number;
  name?: string;
  barcode?: string;
  category?: string;
  syncStatus?: number;
}

export interface ProductListResponse {
  list: any[];
  total: number;
  page: number;
  pageSize: number;
}

/**
 * 获取商品列表
 */
export async function getProductList(params: ProductQueryParams = {}): Promise<ProductListResponse> {
  return get('/products/list', params);
}

/**
 * 获取商品详情
 */
export async function getProductDetail(productId: string): Promise<any> {
  return get(`/products/${productId}`);
}

/**
 * 获取商品统计数据
 */
export async function getProductStatistics(): Promise<any> {
  return get('/products/statistics');
}
