From e1950caa3d6c3264df44d7177c841cfca0d4bfee Mon Sep 17 00:00:00 2001 From: dugulingping Date: Wed, 13 Dec 2023 17:42:38 +0800 Subject: [PATCH] ADD dir structure --- main.go => cmd/APP/main.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) rename main.go => cmd/APP/main.go (70%) diff --git a/main.go b/cmd/APP/main.go similarity index 70% rename from main.go rename to cmd/APP/main.go index 616bf92..6867ff8 100644 --- a/main.go +++ b/cmd/APP/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "github.com/gin-gonic/gin" "net/http" ) @@ -20,9 +21,17 @@ func main() { // 处理 webhook 数据 // 在这里,我们只是简单地打印出接收到的数据 - println("Received webhook:", json) + //println("Received webhook:", len(json)) - c.JSON(http.StatusOK, gin.H{"status": "received"}) + fmt.Printf("q: %v\n", json) + c.String(http.StatusBadRequest, "success") + }) + + router.GET("/q", func(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{ + "sss": "sss", + }) + println("123") }) // 启动服务器