plugai_updsrv/pkg/routers/router_deploy.go

39 lines
1.1 KiB
Go

package routers
import (
"intent-system/pkg/api"
"intent-system/pkg/middleware"
"github.com/civet148/log"
"github.com/gin-gonic/gin"
)
const (
GroupRouterDeployV1 = "/api/v1/deploy"
)
const (
RouterPathDeployDeploy = "/deploy"
RouterPathDeployStatus = "/status"
RouterPathDeployDelete = "/delete"
RouterPathDeployStart = "/start"
RouterPathDeployStop = "/stop"
)
func InitRouterGroupDeploy(r *gin.Engine, handlers api.DeployApi) {
log.Infof(".......routers.................Deploy.......................\n\n")
g := r.Group(GroupRouterDeployV1)
g.POST(RouterPathDeployDeploy, handlers.DeployDeploy) //do not need JWT authentication
g.POST(RouterPathDeployStatus, handlers.DeployStatus) //do not need JWT authentication
g.POST(RouterPathDeployDelete, handlers.DeployDelete) //do not need JWT authentication
g.POST(RouterPathDeployStart, handlers.DeployStart) //do not need JWT authentication
g.POST(RouterPathDeployStop, handlers.DeployStop) //do not need JWT authentication
g.Use(middleware.JWT()) //use JWT token middleware
{
//g.POST(RouterSubPathDeployDeploy, handlers.DeployDeploy)
}
}