wip: alpha

This commit is contained in:
loveuer
2025-03-31 09:38:49 +08:00
commit 1e7127bf67
32 changed files with 3809 additions and 0 deletions

38
internal/api/api.go Normal file
View File

@ -0,0 +1,38 @@
package api
import (
"fmt"
"time"
"github.com/loveuer/upipe/internal/handler"
api_nf "github.com/loveuer/uzone/pkg/api.nf"
uapi "github.com/loveuer/uzone/pkg/uapi"
)
func New() uapi.Engine {
start := time.Now()
engine := api_nf.New()
api := engine.Group("/api")
{
api.GET("/available", func(c uapi.Context) error {
return c.JSON(map[string]any{
"status": 200,
"msg": "success",
"err": nil,
"data": map[string]any{
"ok": true,
"version": "v0.0.1",
"uptime": fmt.Sprintf("%v", time.Since(start)),
},
})
})
}
{
g := api.Group("/task")
g.POST("/create", handler.TaskCreate)
}
return engine
}