This commit is contained in:
Jay
2018-05-25 17:26:29 +08:00
parent 59df5ce6a1
commit 70d8971e64
4 changed files with 32 additions and 5 deletions
+2 -1
View File
@@ -54,9 +54,10 @@ func SetDefaultRoutes(r *gin.Engine) {
albumAPI.GET("/:album", context.PatchContext(album.GetAlbum))
albumAPI.PUT("/:album", context.PatchContext(album.UpdateAlbum))
albumAPI.DELETE("/:album", context.PatchContext(album.DeleteAlbum))
albumAPI.GET("/:album/photos", context.PatchContext(middleware.VerifyToken), context.PatchContext(middleware.GetAlbumToNext), context.PatchContext(album.GetAlbumPhotos))
}
photoAPI := albumAPI.Group("/:album/photo", context.PatchContext(middleware.VerifyToken), context.PatchContext(middleware.GetAlbumToNext))
{
photoAPI.GET("/", context.PatchContext(album.GetAlbumPhotos))
photoAPI.GET("/:photo", context.PatchContext(album.GetPhoto))
}
}