39 lines
1016 B
Go
39 lines
1016 B
Go
package flow_instance
|
|
|
|
import (
|
|
"github.com/Superdanda/hade/framework/gin"
|
|
)
|
|
|
|
type FlowInstanceApi struct{}
|
|
|
|
// 注册路由
|
|
func RegisterRoutes(r *gin.Engine) error {
|
|
|
|
api := FlowInstanceApi{}
|
|
|
|
Group := r.Group("/")
|
|
{
|
|
instancesGroup := Group.Group("/instances")
|
|
{
|
|
instancesGroup.POST("/create", api.InstancesCreate)
|
|
instancesGroup.POST("/start", api.InstancesStart)
|
|
instancesGroup.POST("/start/rule", api.InstancesStartRule)
|
|
stepsGroup := instancesGroup.Group("/steps")
|
|
{
|
|
stepsGroup.POST("/add", api.InstancesStepsAdd)
|
|
stepsGroup.POST("/approve", api.InstancesStepsApprove)
|
|
stepsGroup.POST("/reject", api.InstancesStepsReject)
|
|
stepsGroup.POST("/cancel", api.InstancesStepsCancel)
|
|
stepsGroup.POST("/update", api.InstancesStepsUpdate)
|
|
stepsGroup.POST("/revert", api.InstancesStepsRevert)
|
|
}
|
|
queryGroup := instancesGroup.Group("/query")
|
|
{
|
|
queryGroup.POST("/", api.InstancesQuery)
|
|
queryGroup.POST("/list", api.InstancesQueryList)
|
|
}
|
|
}
|
|
}
|
|
return nil
|
|
}
|