import { frogHttp } from '@/lib/http/instances'
import {
  AiCarouselListOutput,
  AiChatRankOutput,
  AiGiftRankOutput,
  AiHeartbeatRankOutput,
  ExploreInfoOutput,
  GetMeetListRequest,
  GetMeetListResponse,
  HomeRecommendV2Output,
  SignInRoundOutput,
} from './types'

export const homeService = {
  // 发现
  getExplore: (): Promise<ExploreInfoOutput> => {
    return frogHttp.post('/web/explore/info')
  },

  // 首页分类列表
  getMeetList: (data: GetMeetListRequest): Promise<GetMeetListResponse[]> => {
    return frogHttp.post('/web/home/classification-list', data)
  },

  // 热聊榜
  getChatRank: (): Promise<AiChatRankOutput[]> => {
    return frogHttp.post('/web/rank/chat')
  },

  // 心动榜
  getHeartbeatRank: (): Promise<AiHeartbeatRankOutput[]> => {
    return frogHttp.post('/web/rank/heartbeat')
  },

  // 送礼榜
  getGiftRank: (): Promise<AiGiftRankOutput[]> => {
    return frogHttp.post('/web/rank/gift')
  },

  // 七天签到列表
  getSevenDaysSignList: (): Promise<SignInRoundOutput> => {
    return frogHttp.post('/web/si/list')
  },

  // 签到
  signIn: (): Promise<boolean> => {
    return frogHttp.post('/web/si/asi')
  },

  // 首页AI轮播列表
  getHomeAiCarouselList: (): Promise<AiCarouselListOutput[]> => {
    return frogHttp.post('/web/home/ai-carousel-list')
  },

  // 首页聚合推荐
  getHomeAggregateRecommend: (): Promise<HomeRecommendV2Output> => {
    return frogHttp.post('/web/home/agg-recommend')
  },
}
