EUGENIO SOUZA CARVALHO 4 years ago
parent
commit
8c85158d01
2 changed files with 5 additions and 15 deletions
  1. 1 0
      api/debug.go
  2. 4 15
      translate/got/resources.go

+ 1 - 0
api/debug.go

@@ -95,6 +95,7 @@ type Debugger struct {
 func (debug *Debugger) Handler() func(context.Context) {
 	return func(ctx context.Context) {
 		ctx.Values().Set("#debug", debug.CreateTask())
+		ctx.Next()
 	}
 }
 

+ 4 - 15
translate/got/resources.go

@@ -424,21 +424,6 @@ func GenIndexApi(p *Project) error {
 	// 	G.Id(fmt.Sprintf(`FilterHandle("../api/%s/filters")`, p.Package)),
 	// ))
 
-	statments = append(statments, G.Line().Comment("Debug eventstream").Line().Id("app").Dot("Get").Call(
-		G.Lit("/debug"),
-		G.Id(`apply("debug", Debug.EventStream())`),
-		// G.Func().Params(G.Id("ctx").Qual(IRIS_CTX, "Context")).Block(
-
-		// 	G.Id(`
-		// 		if err = asyncTaskManagerService.Hub.UpgradeConnection(
-		// 		 	ctx,
-		// 		 	fmt.Sprintf("async.task.%s", asyncTaskId),
-		// 		); err != nil {
-		// 			ctx.
-		// 		}
-		// 	`),
-		// ),
-	))
 	// Cria a funcao que trata os metodos options
 	statments = append(statments, G.Line().Comment("Options request").Line().Id("app").Dot("Options").Call(
 		G.Lit("/{url:path}"),
@@ -447,6 +432,10 @@ func GenIndexApi(p *Project) error {
 		),
 	))
 
+	statments = append(statments, G.Line().Comment("Debug eventstream").Line().Id("app").Dot("Get").Call(
+		G.Lit("/api/v1/debug"),
+		G.Id(`apply("debug", Debug.EventStream())`),
+	))
 	// Cria a funcao que registra as urls da api no arquivo api_index_gen.go
 	Index.Func().Id("Register").Params(
 		G.Id("app").Op("*").Qual(IRIS, "Application"),