32 lines
705 B
Go
Raw Normal View History

2025-01-25 18:33:11 +08:00
package api
import (
"github.com/gofiber/fiber/v2"
)
func MapAPIs(app *fiber.App, baseURL string) {
api := app.Group(baseURL).Name("API")
{
2025-01-29 14:01:34 +08:00
wallet := api.Group("/wallets").Name("Wallet API")
2025-01-25 18:33:11 +08:00
{
wallet.Post("/me", createWallet)
2025-01-25 18:33:11 +08:00
wallet.Get("/me", getMyWallet)
}
2025-01-29 14:01:34 +08:00
transaction := api.Group("/transactions").Name("Transaction API")
2025-01-25 18:33:11 +08:00
{
transaction.Get("/me", listTransaction)
transaction.Get("/:id", getTransactionByID)
transaction.Post("/", makeTransaction)
2025-01-25 18:33:11 +08:00
}
2025-02-02 22:20:10 +08:00
order := api.Group("/orders").Name("Order API")
{
2025-02-02 22:49:49 +08:00
order.Get("/:orderId", getOrder)
order.Post("/:orderId/pay", payOrder)
2025-02-03 13:23:45 +08:00
order.Post("/:orderId/cancel", cancelOrder)
2025-02-02 22:46:01 +08:00
order.Post("/", createOrder)
2025-02-02 22:20:10 +08:00
}
2025-01-25 18:33:11 +08:00
}
}