package api

import (
	"fmt"
	"hakushi-crawl/utils"
	"log"
)

func GetPFEventInfoApi(eventId string, locale string) (*any, error) {
	url := fmt.Sprintf(
		"https://api.hakush.in/hsr/data/%s/story/%s.json",
		locale,
		eventId,
	)

	data, err := utils.GetĐataJSON[any](url)
	if err != nil {
		log.Println(err)
		return nil, nil
	}

	return data, nil
}

func GetListPFEventApi() (map[string]*any, error) {
	url := "https://api.hakush.in/hsr/data/maze_extra.json"

	data, err := utils.GetĐataJSON[map[string]*any](url)
	if err != nil {
		log.Println(err)
		return nil, nil
	}

	return *data, nil
}
