♻️ Refactored opener

 Support boost in opener
This commit is contained in:
2024-12-28 23:10:57 +08:00
parent 8888f7661a
commit 49a8159e35
6 changed files with 220 additions and 55 deletions

View File

@@ -0,0 +1,19 @@
package api
import (
"git.solsynth.dev/hypernet/paperclip/pkg/internal/models"
"github.com/gofiber/fiber/v2"
jsoniter "github.com/json-iterator/go"
"github.com/spf13/viper"
)
func listDestination(c *fiber.Ctx) error {
var destinations []models.BaseDestination
for _, value := range viper.GetStringSlice("destinations") {
var parsed models.BaseDestination
raw, _ := jsoniter.Marshal(value)
_ = jsoniter.Unmarshal(raw, &parsed)
destinations = append(destinations, parsed)
}
return c.JSON(destinations)
}