Files
mayfly-go/server/devops/routers/machine.go

30 lines
612 B
Go
Raw Normal View History

2021-04-16 15:10:07 +08:00
package routers
import (
"mayfly-go/base/ctx"
"mayfly-go/server/devops/apis"
"mayfly-go/server/devops/application"
2021-04-16 15:10:07 +08:00
"github.com/gin-gonic/gin"
)
func InitMachineRouter(router *gin.RouterGroup) {
m := &apis.Machine{MachineApp: application.Machine}
2021-04-16 15:10:07 +08:00
db := router.Group("machines")
{
db.GET("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).Handle(m.Machines)
2021-04-16 15:10:07 +08:00
})
db.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).Handle(m.SaveMachine)
2021-04-16 15:10:07 +08:00
})
db.GET(":machineId/top", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).Handle(m.Top)
2021-04-16 15:10:07 +08:00
})
db.GET(":machineId/terminal", m.WsSSH)
2021-04-16 15:10:07 +08:00
}
}