2023-11-05 22:08:53 +00:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
2023-11-09 18:53:19 +00:00
|
|
|
"github.com/goccy/go-json"
|
2023-11-09 18:42:28 +00:00
|
|
|
|
2023-11-05 22:08:53 +00:00
|
|
|
"github.com/ectrc/snow/aid"
|
2023-12-03 02:02:19 +00:00
|
|
|
"github.com/ectrc/snow/fortnite"
|
|
|
|
"github.com/ectrc/snow/person"
|
2023-11-09 18:42:28 +00:00
|
|
|
"github.com/ectrc/snow/storage"
|
2023-11-05 22:08:53 +00:00
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
func GetStorefrontCatalog(c *fiber.Ctx) error {
|
2023-12-03 02:02:19 +00:00
|
|
|
person := c.Locals("person").(*person.Person)
|
2023-11-26 22:39:05 +00:00
|
|
|
|
2023-12-03 02:02:19 +00:00
|
|
|
return c.Status(fiber.StatusOK).JSON(fortnite.StaticCatalog.GenerateFortniteCatalog(person))
|
2023-11-05 22:08:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func GetStorefrontKeychain(c *fiber.Ctx) error {
|
2023-11-09 18:42:28 +00:00
|
|
|
var keychain []string
|
|
|
|
err := json.Unmarshal(*storage.Asset("keychain.json"), &keychain)
|
|
|
|
if err != nil {
|
|
|
|
return c.Status(fiber.StatusInternalServerError).JSON(aid.JSON{"error":err.Error()})
|
|
|
|
}
|
|
|
|
|
|
|
|
return c.Status(fiber.StatusOK).JSON(keychain)
|
2023-11-05 22:08:53 +00:00
|
|
|
}
|