/**
 * 门店管理相关API
 */

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

export interface ShopQueryParams {
  page?: number;
  pageSize?: number;
  name?: string;
  city?: string;
  status?: number;
}

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

/**
 * 获取门店列表
 */
export async function getShopList(params: ShopQueryParams = {}): Promise<ShopListResponse> {
  return get('/shops/list', params);
}

/**
 * 获取门店详情
 */
export async function getShopDetail(shopId: string): Promise<any> {
  return get(`/shops/${shopId}`);
}

/**
 * 获取门店统计数据
 */
export async function getShopStatistics(): Promise<any> {
  return get('/shops/statistics');
}

/**
 * 获取启用门店列表（下拉选择）
 */
export async function getEnabledShops(): Promise<any[]> {
  return get('/shops/enabled');
}

/**
 * 获取门店关联设备
 */
export async function getShopDevices(shopId: string): Promise<any[]> {
  return get(`/shops/${shopId}/devices`);
}
