123456789101112131415161718192021222324252627282930313233343536373839 |
- package pages
- import (
- site "codeberg.org/vnpower/pixivfe/v2/core/http"
- core "codeberg.org/vnpower/pixivfe/v2/core/webapi"
- "github.com/gofiber/fiber/v2"
- )
- func DiscoveryPage(c *fiber.Ctx) error {
- mode := c.Query("mode", "safe")
- works, err := core.GetDiscoveryArtwork(c, mode)
- if err != nil {
- return err
- }
- urlc := site.NewURLConstruct("discovery", map[string]string{"mode": mode})
- return c.Render("discovery", fiber.Map{
- "Artworks": works,
- "Title": "Discovery",
- "Queries": urlc,
- })
- }
- func NovelDiscoveryPage(c *fiber.Ctx) error {
- mode := c.Query("mode", "safe")
- works, err := core.GetDiscoveryNovels(c, mode)
- if err != nil {
- return err
- }
- return c.Render("novelDiscovery", fiber.Map{
- "Novels": works,
- "Title": "Discovery",
- })
- }
|