package workflow

import (
	"github.com/gin-gonic/gin"
	v1 "server/api/v1"
	"server/middleware"
)

type NodeRouter struct{}

func (s *NodeRouter) InitNodeRouter(Router *gin.RouterGroup) {
	nodeRouter := Router.Group("node").Use(middleware.OperationRecord())
	nodeRouterWithoutRecord := Router.Group("node")

	nodeApi := v1.ApiGroupApp.WorkflowApiGroup.NodeApi
	{
		nodeRouter.POST("createNode", nodeApi.CreateNode)
		nodeRouter.PUT("updateNode", nodeApi.UpdateNode)
		nodeRouter.DELETE("deleteNode", nodeApi.DeleteNode)
	}
	{
		nodeRouterWithoutRecord.GET("queryAllNode", nodeApi.QueryAllNode)
		nodeRouterWithoutRecord.GET("queryNodeByApproverId", nodeApi.QueryNodeByApproverId)
		nodeRouterWithoutRecord.POST("queryNodeList", nodeApi.QueryNodeList)
	}
}
