Add related resources parsing

This commit is contained in:
nyne
2025-05-23 16:21:58 +08:00
parent 926391dc85
commit 0bc97b1db5
4 changed files with 79 additions and 16 deletions

View File

@@ -2,7 +2,6 @@ package api
import (
"encoding/json"
"github.com/gofiber/fiber/v3/log"
"net/url"
"nysoure/server/dao"
"nysoure/server/model"
@@ -10,6 +9,8 @@ import (
"nysoure/server/utils"
"strconv"
"github.com/gofiber/fiber/v3/log"
"github.com/gofiber/fiber/v3"
)
@@ -54,7 +55,8 @@ func handleGetResource(c fiber.Ctx) error {
if err != nil {
return model.NewRequestError("Invalid resource ID")
}
resource, err := service.GetResource(uint(id))
host := c.Hostname()
resource, err := service.GetResource(uint(id), host)
if err != nil {
return err
}