♻️ Refactored opener
✨ Support boost in opener
This commit is contained in:
19
pkg/internal/server/api/destinations_api.go
Normal file
19
pkg/internal/server/api/destinations_api.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user