mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
34 lines
1.3 KiB
Go
34 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"backend/internal/controllers"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
type Route struct {
|
|
Method []string
|
|
Path string
|
|
Handler func(c echo.Context) error
|
|
}
|
|
|
|
var routes = []Route{
|
|
{Method: []string{"POST"}, Path: "/file/create", Handler: controllers.CreateUploadTask},
|
|
{Method: []string{"POST"}, Path: "/file/slice", Handler: controllers.UploadFileSlice},
|
|
{Method: []string{"POST"}, Path: "/file/finish", Handler: controllers.FinishUploadTask},
|
|
|
|
{Method: []string{"GET"}, Path: "/share/:id", Handler: controllers.GetShareInfo},
|
|
{Method: []string{"POST"}, Path: "/share", Handler: controllers.CreateShareInfo},
|
|
|
|
{Method: []string{"GET"}, Path: "/download", Handler: controllers.DownloadShare},
|
|
{Method: []string{"POST"}, Path: "/download", Handler: controllers.VaildateShare},
|
|
{Method: []string{"GET"}, Path: "/share/pickup/:code", Handler: controllers.GetShareByPickupCode},
|
|
|
|
{Method: []string{"GET"}, Path: "/stat", Handler: controllers.GetStat},
|
|
{Method: []string{"GET"}, Path: "/config", Handler: controllers.GetConfig},
|
|
{Method: []string{"GET"}, Path: "/about", Handler: controllers.GetAbout},
|
|
|
|
{Method: []string{"POST"}, Path: "/task/:type", Handler: controllers.CreateTask},
|
|
{Method: []string{"GET"}, Path: "/task/:id", Handler: controllers.GetTask},
|
|
}
|