1. add youtube command
2. add google webhook
3. add twitch oauth route
4. add api checkSession middleware
This commit is contained in:
Jay
2018-09-16 23:39:15 +08:00
parent 3318352135
commit e8db6fdab5
12 changed files with 487 additions and 13 deletions
+8
View File
@@ -7,6 +7,7 @@ import (
"git.trj.tw/golang/mtfosbot/router/api"
"git.trj.tw/golang/mtfosbot/router/google"
"git.trj.tw/golang/mtfosbot/router/line"
"git.trj.tw/golang/mtfosbot/router/twitch"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/contrib/sessions"
"github.com/gin-gonic/gin"
@@ -44,6 +45,7 @@ func SetRoutes(r *gin.Engine) {
apiGroup := r.Group("/api")
{
apiGroup.POST("/login", context.PatchCtx(api.UserLogin))
apiGroup.POST("/logout", context.PatchCtx(api.UserLogout))
}
lineApis := r.Group("/line")
@@ -56,4 +58,10 @@ func SetRoutes(r *gin.Engine) {
googleApis.GET("/youtube/webhook", context.PatchCtx(google.VerifyWebhook))
googleApis.POST("/youtube/webhook", context.PatchCtx(google.GetNotifyWebhook))
}
twitchApis := r.Group("/twitch")
{
twitchApis.GET("/login", context.PatchCtx(twitch.OAuthLogin))
twitchApis.GET("/oauth", context.PatchCtx(twitch.OAuthProc))
}
}