import { type GetHotSpotListResponse, type GetSceneDetailResponse } from '@/types/home';
import service from '@/utils/services';

const SCENE_BASE_URL = 'https://count.4dage.com/api';

export const homeApi = {
  getHotSpotList() {
    return service.get<GetHotSpotListResponse>(
      `${window.g_Prefix}/data/${window.number}/hot/js/data.js`
    );
  },

  getSceneDetail(sceneCode: string) {
    return service.get<GetSceneDetailResponse | null>(
      `${SCENE_BASE_URL}/count/detail/${sceneCode}`
    );
  },

  /**
   * 点赞
   */
  saveStar(sceneCode: string) {
    return service.get(`${SCENE_BASE_URL}/count/saveStar/${sceneCode}`);
  },
};
