mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Add: Ping router
This commit is contained in:
14
routers/controllers/ping.go
Normal file
14
routers/controllers/ping.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"Cloudreve/serializer"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// Ping 状态检查页面
|
||||
func Ping(c *gin.Context) {
|
||||
c.JSON(200, serializer.Response{
|
||||
Code: 0,
|
||||
Msg: "Pong",
|
||||
})
|
||||
}
|
||||
18
routers/router.go
Normal file
18
routers/router.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"Cloudreve/routers/controllers"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func InitRouter() *gin.Engine {
|
||||
r := gin.Default()
|
||||
|
||||
// 路由
|
||||
v3 := r.Group("/Api/V3")
|
||||
{
|
||||
v3.GET("Ping", controllers.Ping)
|
||||
|
||||
}
|
||||
return r
|
||||
}
|
||||
Reference in New Issue
Block a user