2022-03-01 13:50:13 +08:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
2023-01-18 15:40:27 +08:00
|
|
|
"cutego/modules/core/api/v1"
|
2022-03-01 13:50:13 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 初始化定时任务路由
|
|
|
|
func initCronJobRouter(router *gin.RouterGroup) {
|
|
|
|
v := new(v1.CronJobApi)
|
2022-03-01 17:43:41 +08:00
|
|
|
group := router.Group("/monitor/cronJob")
|
2022-03-01 13:50:13 +08:00
|
|
|
{
|
|
|
|
// 查询定时任务分页数据
|
|
|
|
group.GET("/list", v.List)
|
2022-03-01 17:43:41 +08:00
|
|
|
// 查询定时任务分页数据
|
|
|
|
group.GET("/:jobId", v.GetById)
|
2022-03-01 13:50:13 +08:00
|
|
|
// 修改定时任务
|
|
|
|
group.PUT("/modify", v.Edit)
|
|
|
|
// 新增定时任务
|
|
|
|
group.POST("/create", v.Add)
|
|
|
|
// 删除定时任务
|
2022-03-01 17:43:41 +08:00
|
|
|
group.DELETE("/:jobId/:funcAlias", v.Remove)
|
2022-03-01 13:50:13 +08:00
|
|
|
// 改变定时任务状态
|
2022-03-01 17:43:41 +08:00
|
|
|
group.PUT("/changeStatus", v.ChangeStatus)
|
2022-03-01 13:50:13 +08:00
|
|
|
}
|
|
|
|
}
|