add twitch apis , bar api not ok

This commit is contained in:
Jay
2018-09-18 00:35:48 +08:00
parent 67eeab4ba1
commit ce62048c18
7 changed files with 354 additions and 9 deletions
+14 -1
View File
@@ -17,7 +17,7 @@ import (
func NewServ() *gin.Engine {
r := gin.New()
store, err := sessions.NewRedisStore(10, "tcp", "localhost:6379", "")
store, err := sessions.NewRedisStore(10, "tcp", "localhost:6379", "", []byte("seckey"))
if err != nil {
log.Fatal(err)
}
@@ -47,6 +47,19 @@ func SetRoutes(r *gin.Engine) {
apiGroup.POST("/login", context.PatchCtx(api.UserLogin))
apiGroup.POST("/logout", context.PatchCtx(api.UserLogout))
}
apiTwitchGroup := apiGroup.Group("/twitch", context.PatchCtx(api.CheckSession))
{
apiTwitchGroup.GET("/channels", context.PatchCtx(api.GetChannels), context.PatchCtx(api.GetChannelList))
twitchChannelGroup := apiTwitchGroup.Group("/channel/:chid", context.PatchCtx(api.GetChannels))
{
twitchChannelGroup.GET("/", context.PatchCtx(api.GetChannelData))
twitchChannelGroup.PUT("/botjoin", context.PatchCtx(api.BotJoinChannel))
twitchChannelGroup.PUT("/opay", context.PatchCtx(api.OpayIDChange))
twitchChannelGroup.GET("/opay/setting", context.PatchCtx(api.GetDonateSetting))
twitchChannelGroup.PUT("/opay/setting", context.PatchCtx(api.UpdateDonateSetting))
}
}
lineApis := r.Group("/line")
{