add line webhook router

This commit is contained in:
Jay
2018-12-24 17:34:24 +08:00
parent 9d9fe262f4
commit 4726070ea5
19 changed files with 969 additions and 142 deletions
+9 -1
View File
@@ -1,6 +1,10 @@
package routes
import "github.com/gin-gonic/gin"
import (
"git.trj.tw/golang/mtgbot/modules/context"
"git.trj.tw/golang/mtgbot/router/line"
"github.com/gin-gonic/gin"
)
var r *gin.Engine
@@ -16,4 +20,8 @@ func SetRoutes(r *gin.Engine) {
r.GET("/", func(c *gin.Context) {
c.String(200, "Hello")
})
r.POST("/line", context.PatchCtx(line.GetRawBody), context.PatchCtx(line.VerifyLine), context.PatchCtx(line.LineWebhook))
r.POST("/line/", context.PatchCtx(line.GetRawBody), context.PatchCtx(line.VerifyLine), context.PatchCtx(line.LineWebhook))
}