浏览代码

fix: add missing routes and register them

ntorga 1 年之前
父节点
当前提交
0045bedfd3
共有 2 个文件被更改,包括 14 次插入0 次删除
  1. 1 0
      src/presentation/api/router.go
  2. 13 0
      src/presentation/cli/router.go

+ 1 - 0
src/presentation/api/router.go

@@ -189,6 +189,7 @@ func (router Router) RegisterRoutes() {
 	router.marketplaceRoutes()
 	router.o11yRoutes()
 	router.runtimeRoutes()
+	router.scheduledTaskRoutes()
 	router.servicesRoutes()
 	router.sslRoutes()
 	router.vhostsRoutes()

+ 13 - 0
src/presentation/cli/router.go

@@ -139,6 +139,18 @@ func (router Router) runtimeRoutes() {
 	phpCmd.AddCommand(runtimeController.UpdatePhpModule())
 }
 
+func (router *Router) scheduledTaskRoutes() {
+	var scheduledTaskCmd = &cobra.Command{
+		Use:   "task",
+		Short: "ScheduledTaskManagement",
+	}
+
+	scheduledTaskController := cliController.NewScheduledTaskController(router.persistentDbSvc)
+	scheduledTaskCmd.AddCommand(scheduledTaskController.Read())
+	scheduledTaskCmd.AddCommand(scheduledTaskController.Update())
+	rootCmd.AddCommand(scheduledTaskCmd)
+}
+
 func (router Router) serveRoutes() {
 	var serveCmd = &cobra.Command{
 		Use:   "serve",
@@ -223,6 +235,7 @@ func (router Router) RegisterRoutes() {
 	router.marketplaceRoutes()
 	router.o11yRoutes()
 	router.runtimeRoutes()
+	router.scheduledTaskRoutes()
 	router.serveRoutes()
 	router.servicesRoutes()
 	router.sslRoutes()