From c40fe4fc1a6e62dfc991f6b6c373c0d20af66964 Mon Sep 17 00:00:00 2001 From: chengxiao Date: Fri, 24 Apr 2020 06:36:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E7=AB=AF=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E4=B8=BA=E6=96=87=E6=A1=A3=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/system/index.go | 42 ++++++++++++++++++++++++++++++++++++++++++ router/router.go | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 apis/system/index.go diff --git a/apis/system/index.go b/apis/system/index.go new file mode 100644 index 00000000..31c0134b --- /dev/null +++ b/apis/system/index.go @@ -0,0 +1,42 @@ +package system + +import( + "github.com/gin-gonic/gin" +) + +const INDEX = ` + + + + +GO-ADMIN欢迎您 + + + + + + + + +` + + +func HelloWorld(c *gin.Context){ + c.Header("Content-Type", "text/html; charset=utf-8") + c.String(200, INDEX) + + +} diff --git a/router/router.go b/router/router.go index 7a3ae830..af404731 100644 --- a/router/router.go +++ b/router/router.go @@ -28,7 +28,7 @@ func InitRouter() *gin.Engine { r.Use(middleware.RequestId()) r.Use(middleware.DemoEvn()) - r.GET("/", handler.HelloGoAdmin) + r.GET("/", system.HelloWorld) r.Static("/static", "./static") r.GET("/info", handler.Ping)