Add: Ping router

This commit is contained in:
HFO4
2019-11-05 12:31:22 +08:00
parent 86896aedd0
commit 74b5bf24a8
5 changed files with 52 additions and 3 deletions

View 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
View 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
}