mirror of
https://github.com/aykhans/slash-e.git
synced 2025-12-13 20:29:21 +00:00
feat: migrate system to api v1
This commit is contained in:
26
api/v1/system.go
Normal file
26
api/v1/system.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/boojack/shortify/server/profile"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type SystemStatus struct {
|
||||
Profile *profile.Profile `json:"profile"`
|
||||
}
|
||||
|
||||
func (s *APIV1Service) registerSystemRoutes(g *echo.Group) {
|
||||
g.GET("/ping", func(c echo.Context) error {
|
||||
return c.JSON(http.StatusOK, s.Profile)
|
||||
})
|
||||
|
||||
g.GET("/status", func(c echo.Context) error {
|
||||
systemStatus := SystemStatus{
|
||||
Profile: s.Profile,
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, systemStatus)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user