approveflow/app/http/module/flow_instance/api.go

39 lines
1016 B
Go
Raw Normal View History

2024-11-14 17:02:41 +08:00
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)
2024-11-19 17:03:12 +08:00
instancesGroup.POST("/start/rule", api.InstancesStartRule)
2024-11-14 17:02:41 +08:00
stepsGroup := instancesGroup.Group("/steps")
{
stepsGroup.POST("/add", api.InstancesStepsAdd)
2024-11-19 17:03:12 +08:00
stepsGroup.POST("/approve", api.InstancesStepsApprove)
stepsGroup.POST("/reject", api.InstancesStepsReject)
stepsGroup.POST("/cancel", api.InstancesStepsCancel)
2024-11-14 17:02:41 +08:00
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
}