mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-25 17:16:33 +08:00
30 lines
612 B
Go
30 lines
612 B
Go
package routers
|
|
|
|
import (
|
|
"mayfly-go/base/ctx"
|
|
"mayfly-go/server/devops/apis"
|
|
"mayfly-go/server/devops/application"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func InitMachineRouter(router *gin.RouterGroup) {
|
|
m := &apis.Machine{MachineApp: application.Machine}
|
|
db := router.Group("machines")
|
|
{
|
|
db.GET("", func(c *gin.Context) {
|
|
ctx.NewReqCtxWithGin(c).Handle(m.Machines)
|
|
})
|
|
|
|
db.POST("", func(c *gin.Context) {
|
|
ctx.NewReqCtxWithGin(c).Handle(m.SaveMachine)
|
|
})
|
|
|
|
db.GET(":machineId/top", func(c *gin.Context) {
|
|
ctx.NewReqCtxWithGin(c).Handle(m.Top)
|
|
})
|
|
|
|
db.GET(":machineId/terminal", m.WsSSH)
|
|
}
|
|
}
|