diff options
author | Vitaly Takmazov | 2018-09-04 13:52:10 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-09-04 13:52:10 +0300 |
commit | a63800dd6c5f8551b7126be6d3557e90888f0703 (patch) | |
tree | d037c0498f3e2f38f6147f20717c27f68353bea5 /juick-server/src/main/java/com/juick/server/api/activity/model | |
parent | 2f1b853bc35f14ac61038b556d21e1d0190fee8a (diff) |
outbox as OrderedCollection
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api/activity/model')
7 files changed, 119 insertions, 12 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java b/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java index bc682d2b..dcc94bf7 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java @@ -4,9 +4,19 @@ import com.fasterxml.jackson.annotation.JsonProperty; public abstract class ActivityObject { - public abstract String getId(); + private String id; - public abstract String getType(); + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getType() { + return getClass().getName(); + } @JsonProperty("@context") public String getContext() { diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Article.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Article.java new file mode 100644 index 00000000..e117475d --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Article.java @@ -0,0 +1,22 @@ +package com.juick.server.api.activity.model; + +public class Article extends ActivityObject { + private String content; + private String attributedTo; + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getAttributedTo() { + return attributedTo; + } + + public void setAttributedTo(String attributedTo) { + this.attributedTo = attributedTo; + } +} diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java new file mode 100644 index 00000000..7b4e7b16 --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java @@ -0,0 +1,23 @@ +package com.juick.server.api.activity.model; + +public class Create extends ActivityObject { + + private Person actor; + private Article object; + + public Person getActor() { + return actor; + } + + public void setActor(Person actor) { + this.actor = actor; + } + + public Article getObject() { + return object; + } + + public void setObject(Article object) { + this.object = object; + } +} diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Link.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Link.java new file mode 100644 index 00000000..b57dabbe --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Link.java @@ -0,0 +1,13 @@ +package com.juick.server.api.activity.model; + +public class Link extends ActivityObject { + private String href; + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } +} 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 new file mode 100644 index 00000000..84654b19 --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollection.java @@ -0,0 +1,23 @@ +package com.juick.server.api.activity.model; + +public class OrderedCollection extends ActivityObject { + + private int totalItems; + + public int getTotalItems() { + return totalItems; + } + + public void setTotalItems(int totalItems) { + this.totalItems = totalItems; + } + private OrderedCollectionPage first; + + public OrderedCollectionPage getFirst() { + return first; + } + + public void setFirst(OrderedCollectionPage first) { + this.first = first; + } +} diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java b/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java new file mode 100644 index 00000000..9e03cb79 --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/OrderedCollectionPage.java @@ -0,0 +1,26 @@ +package com.juick.server.api.activity.model; + +import java.util.List; + +public class OrderedCollectionPage extends ActivityObject { + + private Link next; + + private List<? extends ActivityObject> orderedItems; + + public Link getNext() { + return next; + } + + public void setNext(Link next) { + this.next = next; + } + + public List<? extends ActivityObject> getOrderedItems() { + return orderedItems; + } + + public void setOrderedItems(List<? extends ActivityObject> orderedItems) { + this.orderedItems = orderedItems; + } +} diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java index 031cd73b..7ec94c28 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java @@ -2,17 +2,11 @@ package com.juick.server.api.activity.model; public class Person extends ActivityObject { - private String id; private String name; private String icon; private String outbox; @Override - public String getId() { - return id; - } - - @Override public String getType() { return "Person"; } @@ -40,8 +34,4 @@ public class Person extends ActivityObject { public void setOutbox(String outbox) { this.outbox = outbox; } - - public void setId(String id) { - this.id = id; - } } |