add youtube webhook

This commit is contained in:
Jay
2018-09-15 23:09:41 +08:00
parent e954afe80b
commit 16190c49c4
7 changed files with 350 additions and 27 deletions
+13
View File
@@ -5,6 +5,8 @@ import (
"git.trj.tw/golang/mtfosbot/module/context"
"git.trj.tw/golang/mtfosbot/router/api"
"git.trj.tw/golang/mtfosbot/router/google"
"git.trj.tw/golang/mtfosbot/router/line"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/contrib/sessions"
"github.com/gin-gonic/gin"
@@ -43,4 +45,15 @@ func SetRoutes(r *gin.Engine) {
{
apiGroup.POST("/login", context.PatchCtx(api.UserLogin))
}
lineApis := r.Group("/line")
{
lineApis.POST("/", context.PatchCtx(line.GetRawBody), context.PatchCtx(line.VerifyLine), context.PatchCtx(line.GetLineMessage))
}
googleApis := r.Group("/google")
{
googleApis.GET("/youtube/webhook", context.PatchCtx(google.VerifyWebhook))
googleApis.POST("/youtube/webhook", context.PatchCtx(google.GetNotifyWebhook))
}
}