Selaa lähdekoodia

Add detail button control

cg33 6 vuotta sitten
vanhempi
commit
24c9968bb7
1 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. 8 0
      main.go

+ 8 - 0
main.go

@@ -6,6 +6,7 @@ import (
 	"github.com/GoAdminGroup/go-admin/template"
 	"github.com/GoAdminGroup/go-admin/template/chartjs"
 	_ "github.com/GoAdminGroup/themes/adminlte"
+	"net/http"
 
 	"github.com/GoAdminGroup/go-admin/engine"
 	"github.com/GoAdminGroup/go-admin/examples/datamodel"
@@ -83,5 +84,12 @@ func main() {
 		})
 	})
 
+	r.POST("/admin/popup", func(ctx *gin.Context) {
+		ctx.JSON(http.StatusOK, gin.H{
+			"code": 0,
+			"data": "<h2>hello world</h2>",
+		})
+	})
+
 	_ = r.Run(":9033")
 }