2024-06-22 04:29:20 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import "github.com/gofiber/fiber/v2"
|
|
|
|
|
2024-07-16 09:02:16 +00:00
|
|
|
func MapAPIs(app *fiber.App, baseURL string) {
|
2024-06-22 04:29:20 +00:00
|
|
|
app.Get("/.well-known/destinations", getDestinations)
|
|
|
|
|
2024-07-16 09:02:16 +00:00
|
|
|
api := app.Group(baseURL).Name("API")
|
2024-06-22 04:29:20 +00:00
|
|
|
{
|
2024-07-25 14:12:00 +00:00
|
|
|
api.Get("/attachments", listAttachment)
|
2024-06-22 04:29:20 +00:00
|
|
|
api.Get("/attachments/:id/meta", getAttachmentMeta)
|
|
|
|
api.Get("/attachments/:id", openAttachment)
|
|
|
|
api.Post("/attachments", createAttachment)
|
|
|
|
api.Put("/attachments/:id", updateAttachmentMeta)
|
|
|
|
api.Delete("/attachments/:id", deleteAttachment)
|
2024-08-03 07:43:15 +00:00
|
|
|
|
2024-08-03 08:16:14 +00:00
|
|
|
api.Get("/stickers/manifest", listStickerManifest)
|
2024-08-03 07:43:15 +00:00
|
|
|
api.Get("/stickers/packs", listStickerPacks)
|
|
|
|
api.Post("/stickers/packs", createStickerPack)
|
|
|
|
api.Put("/stickers/packs/:packId", updateStickerPack)
|
|
|
|
api.Delete("/stickers/packs/:packId", deleteStickerPack)
|
|
|
|
|
2024-08-03 08:16:14 +00:00
|
|
|
api.Get("/stickers", listStickers)
|
2024-08-03 07:43:15 +00:00
|
|
|
api.Get("/stickers/:stickerId", getSticker)
|
|
|
|
api.Post("/stickers", createSticker)
|
|
|
|
api.Put("/stickers/:stickerId", updateSticker)
|
|
|
|
api.Delete("/stickers/:stickerId", deleteSticker)
|
2024-06-22 04:29:20 +00:00
|
|
|
}
|
|
|
|
}
|