use pathparam for id

This commit is contained in:
Athou
2013-06-11 14:42:17 +02:00
parent 1d8876a030
commit 7bb660986e
2 changed files with 6 additions and 5 deletions

View File

@@ -264,7 +264,7 @@ public class FeedUtils {
public static String getFaviconUrl(FeedSubscription subscription, public static String getFaviconUrl(FeedSubscription subscription,
String publicUrl) { String publicUrl) {
return removeTrailingSlash(publicUrl) + "/rest/feed/favicon?id=" return removeTrailingSlash(publicUrl) + "/rest/feed/favicon/"
+ subscription.getId(); + subscription.getId();
} }
} }

View File

@@ -250,9 +250,10 @@ public class FeedREST extends AbstractResourceREST {
} }
@GET @GET
@Path("/favicon") @Path("/favicon/{id}")
@ApiOperation(value = "Fetch a feed's icon", notes = "Fetch icon of a feed") @ApiOperation(value = "Fetch a feed's icon", notes = "Fetch a feed's icon")
public Response getFavicon(@QueryParam("id") Long id) { public Response getFavicon(
@ApiParam(value = "subscription id") @PathParam("id") Long id) {
Preconditions.checkNotNull(id); Preconditions.checkNotNull(id);
FeedSubscription subscription = feedSubscriptionDAO.findById(getUser(), FeedSubscription subscription = feedSubscriptionDAO.findById(getUser(),
@@ -277,7 +278,7 @@ public class FeedREST extends AbstractResourceREST {
CacheControl cacheControl = new CacheControl(); CacheControl cacheControl = new CacheControl();
cacheControl.setMaxAge(2592000); cacheControl.setMaxAge(2592000);
cacheControl.setPrivate(false); cacheControl.setPrivate(true);
// trying to replicate "public, max-age=2592000" // trying to replicate "public, max-age=2592000"
builder.cacheControl(cacheControl); builder.cacheControl(cacheControl);