fix utils

This commit is contained in:
Jay
2018-04-24 17:49:58 +08:00
parent 1429c7fd85
commit 0a471443ce
8 changed files with 174 additions and 26 deletions
+7
View File
@@ -3,7 +3,9 @@ package routes
import (
"git.trj.tw/golang/go-gallery/models"
"git.trj.tw/golang/go-gallery/modules/context"
"git.trj.tw/golang/go-gallery/modules/middleware"
"git.trj.tw/golang/go-gallery/routers/account"
"git.trj.tw/golang/go-gallery/routers/album"
"github.com/gin-gonic/gin"
)
@@ -43,4 +45,9 @@ func SetDefaultRoutes(r *gin.Engine) {
accountAPI.POST("/logout", context.PatchContext(account.UserLogout))
accountAPI.POST("/signup", context.PatchContext(account.UserSignup))
}
api.GET("/albums", context.PatchContext(middleware.VerifyToken), context.PatchContext(album.GetAllAlbums))
albumAPI := api.Group("/album", context.PatchContext(middleware.VerifyToken))
{
albumAPI.GET("/:id", context.PatchContext(album.GetAlbum))
}
}