aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-09-05 20:10:55 +0300
committerGravatar Vitaly Takmazov2018-09-05 20:10:55 +0300
commit302200828e48932dba38dc36fd41dd23fb6dfc76 (patch)
tree6b7c69357613a6215f66bbef2220b649c220ef1f /juick-server/src/main/java/com/juick/server
parenta3824917b908ea3e624b863efe9c9ca4a09fdbf1 (diff)
ActivityStreams: Collection first page is uri
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/Profile.java15
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java6
2 files changed, 6 insertions, 15 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java
index d5b67433..c0dcc3f6 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java
@@ -67,10 +67,7 @@ public class Profile {
OrderedCollection blog = new OrderedCollection();
blog.setId(ServletUriComponentsBuilder.fromCurrentRequestUri().toUriString());
blog.setTotalItems(userService.getStatsMessages(user.getUid()));
- Link first = new Link();
- uriComponentsBuilder.path(String.format("/u/%s/blog", userName));
- first.setHref(uriComponentsBuilder.toUriString());
- blog.setFirst(first);
+ blog.setFirst(uriComponentsBuilder.path(String.format("/u/%s/blog", userName)).toUriString());
return blog;
}
throw new HttpNotFoundException();
@@ -131,10 +128,7 @@ public class Profile {
OrderedCollection followers = new OrderedCollection();
followers.setId(ServletUriComponentsBuilder.fromCurrentRequestUri().toUriString());
followers.setTotalItems(userService.getStatsMyReaders(user.getUid()));
- Link first = new Link();
- uriComponentsBuilder.path(String.format("/u/%s/followers", userName));
- first.setHref(uriComponentsBuilder.toUriString());
- followers.setFirst(first);
+ followers.setFirst(uriComponentsBuilder.path(String.format("/u/%s/followers", userName)).toUriString());
return followers;
}
throw new HttpNotFoundException();
@@ -177,10 +171,7 @@ public class Profile {
OrderedCollection following = new OrderedCollection();
following.setId(ServletUriComponentsBuilder.fromCurrentRequestUri().toUriString());
following.setTotalItems(userService.getUserFriends(user.getUid()).size());
- Link first = new Link();
- uriComponentsBuilder.path(String.format("/u/%s/followers", userName));
- first.setHref(uriComponentsBuilder.toUriString());
- following.setFirst(first);
+ following.setFirst(uriComponentsBuilder.path(String.format("/u/%s/followers", userName)).toUriString());
return following;
}
throw new HttpNotFoundException();
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java b/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java
index d4f6b7c5..90f04de3 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java
@@ -11,13 +11,13 @@ public class OrderedCollection extends ActivityObject {
public void setTotalItems(int totalItems) {
this.totalItems = totalItems;
}
- private Link first;
+ private String first;
- public Link getFirst() {
+ public String getFirst() {
return first;
}
- public void setFirst(Link first) {
+ public void setFirst(String first) {
this.first = first;
}
}