import request from "@/utils/request";

/**
 * @param { Object } params
 * @return { Promise }
 * @description 轮博图
 */
export const apiAdLists = (params: any) =>
  request.get({ url: "/ad/lists", data: params });

// 服务分类-分页列表
export const apiCategoryLists = () => request.get({ url: "/category/list" });

// 商品服务分类-父级
export const apiGoodsCategoryLists = (params: any) =>
  request.get({ url: "/category/commonList", data: params });

/**
 * @param { Object } params
 * @return { Promise }
 * @description 服务列表
 */
export const apiGoodsLists = (params: any) =>
  request.get({ url: "/goods/list", data: params }, { ignoreCancel: true });

/**
 * @param { Object } params
 * @return { Promise }
 * @description 服务师傅列表
 */
export const apiStaffLists = (params: any) =>
  request.post({ url: "/staff/list", data: params });

/**
 * @param { Object } params
 * @return { Promise }
 * @description 师傅详情
 */
export const apiStaffDetail = (params: any) =>
  request.get({ url: "/staff/detail", data: params });

/**
 * @param { Object } params
 * @return { Promise }
 * @description 获取地级市列表
 */
export const apiRegionCity = () => request.get({ url: "/region/char/city" });

/**
 * @description 热门搜索
 * @return { Promise }
 */
export function getHotSearch() {
  return request.get({ url: "/hotSearch" });
}

/**
 * @description 搜索
 * @param { string } keyword 关键词
 * @return { Promise }
 */
export function getSearch(data: {
  keyword: string;
  pageNo: number;
  pageSize: number;
}) {
  return request.get({ url: "/search", data });
}
