mirror of
https://github.com/Athou/commafeed.git
synced 2026-10-29 00:18:49 +00:00
split client and server into maven modules
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Entry details")
|
||||
@Data
|
||||
public class Category implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "category id", required = true)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "parent category id")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "category id", required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "category children categories", required = true)
|
||||
private List<Category> children = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(value = "category feeds", required = true)
|
||||
private List<Subscription> feeds = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(value = "wether the category is expanded or collapsed", required = true)
|
||||
private boolean expanded;
|
||||
|
||||
@ApiModelProperty(value = "position of the category in the list", required = true)
|
||||
private Integer position;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "List of entries with some metadata")
|
||||
@Data
|
||||
public class Entries implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "name of the feed or the category requested", required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "error or warning message")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty(value = "times the server tried to refresh the feed and failed", required = true)
|
||||
private int errorCount;
|
||||
|
||||
@ApiModelProperty(value = "URL of the website, extracted from the feed", required = true)
|
||||
private String feedLink;
|
||||
|
||||
@ApiModelProperty(value = "list generation timestamp", required = true)
|
||||
private long timestamp;
|
||||
|
||||
@ApiModelProperty(value = "if the query has more elements", required = true)
|
||||
private boolean hasMore;
|
||||
|
||||
@ApiModelProperty(value = "the requested offset")
|
||||
private int offset;
|
||||
|
||||
@ApiModelProperty(value = "the requested limit")
|
||||
private int limit;
|
||||
|
||||
@ApiModelProperty(value = "list of entries", required = true)
|
||||
private List<Entry> entries = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "if true, the unread flag was ignored in the request, all entries are returned regardless of their read status",
|
||||
required = true)
|
||||
private boolean ignoredReadStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.commafeed.backend.feed.FeedUtils;
|
||||
import com.commafeed.backend.model.FeedEntry;
|
||||
import com.commafeed.backend.model.FeedEntryContent;
|
||||
import com.commafeed.backend.model.FeedEntryStatus;
|
||||
import com.commafeed.backend.model.FeedEntryTag;
|
||||
import com.commafeed.backend.model.FeedSubscription;
|
||||
import com.rometools.rome.feed.synd.SyndContent;
|
||||
import com.rometools.rome.feed.synd.SyndContentImpl;
|
||||
import com.rometools.rome.feed.synd.SyndEnclosure;
|
||||
import com.rometools.rome.feed.synd.SyndEnclosureImpl;
|
||||
import com.rometools.rome.feed.synd.SyndEntry;
|
||||
import com.rometools.rome.feed.synd.SyndEntryImpl;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Entry details")
|
||||
@Data
|
||||
public class Entry implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "entry id", required = true)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "entry guid", required = true)
|
||||
private String guid;
|
||||
|
||||
@ApiModelProperty(value = "entry title", required = true)
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "entry content", required = true)
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "comma-separated list of categories")
|
||||
private String categories;
|
||||
|
||||
@ApiModelProperty(value = "wether entry content and title are rtl", required = true)
|
||||
private boolean rtl;
|
||||
|
||||
@ApiModelProperty(value = "entry author")
|
||||
private String author;
|
||||
|
||||
@ApiModelProperty(value = "entry enclosure url, if any")
|
||||
private String enclosureUrl;
|
||||
|
||||
@ApiModelProperty(value = "entry enclosure mime type, if any")
|
||||
private String enclosureType;
|
||||
|
||||
@ApiModelProperty(value = "entry media description, if any")
|
||||
private String mediaDescription;
|
||||
|
||||
@ApiModelProperty(value = "entry media thumbnail url, if any")
|
||||
private String mediaThumbnailUrl;
|
||||
|
||||
@ApiModelProperty(value = "entry media thumbnail width, if any")
|
||||
private Integer mediaThumbnailWidth;
|
||||
|
||||
@ApiModelProperty(value = "entry media thumbnail height, if any")
|
||||
private Integer mediaThumbnailHeight;
|
||||
|
||||
@ApiModelProperty(value = "entry publication date", dataType = "number", required = true)
|
||||
private Date date;
|
||||
|
||||
@ApiModelProperty(value = "entry insertion date in the database", dataType = "number", required = true)
|
||||
private Date insertedDate;
|
||||
|
||||
@ApiModelProperty(value = "feed id", required = true)
|
||||
private String feedId;
|
||||
|
||||
@ApiModelProperty(value = "feed name", required = true)
|
||||
private String feedName;
|
||||
|
||||
@ApiModelProperty(value = "this entry's feed url", required = true)
|
||||
private String feedUrl;
|
||||
|
||||
@ApiModelProperty(value = "this entry's website url", required = true)
|
||||
private String feedLink;
|
||||
|
||||
@ApiModelProperty(value = "The favicon url to use for this feed", required = true)
|
||||
private String iconUrl;
|
||||
|
||||
@ApiModelProperty(value = "entry url", required = true)
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "read status", required = true)
|
||||
private boolean read;
|
||||
|
||||
@ApiModelProperty(value = "starred status", required = true)
|
||||
private boolean starred;
|
||||
|
||||
@ApiModelProperty(value = "wether the entry is still markable (old entry statuses are discarded)", required = true)
|
||||
private boolean markable;
|
||||
|
||||
@ApiModelProperty(value = "tags", required = true)
|
||||
private List<String> tags;
|
||||
|
||||
public static Entry build(FeedEntryStatus status, String publicUrl, boolean proxyImages) {
|
||||
Entry entry = new Entry();
|
||||
|
||||
FeedEntry feedEntry = status.getEntry();
|
||||
FeedSubscription sub = status.getSubscription();
|
||||
FeedEntryContent content = feedEntry.getContent();
|
||||
|
||||
entry.setId(String.valueOf(feedEntry.getId()));
|
||||
entry.setGuid(feedEntry.getGuid());
|
||||
entry.setRead(status.isRead());
|
||||
entry.setStarred(status.isStarred());
|
||||
entry.setMarkable(status.isMarkable());
|
||||
entry.setDate(feedEntry.getUpdated());
|
||||
entry.setInsertedDate(feedEntry.getInserted());
|
||||
entry.setUrl(feedEntry.getUrl());
|
||||
entry.setFeedName(sub.getTitle());
|
||||
entry.setFeedId(String.valueOf(sub.getId()));
|
||||
entry.setFeedUrl(sub.getFeed().getUrl());
|
||||
entry.setFeedLink(sub.getFeed().getLink());
|
||||
entry.setIconUrl(FeedUtils.getFaviconUrl(sub, publicUrl));
|
||||
entry.setTags(status.getTags().stream().map(FeedEntryTag::getName).collect(Collectors.toList()));
|
||||
|
||||
if (content != null) {
|
||||
entry.setRtl(FeedUtils.isRTL(feedEntry));
|
||||
entry.setTitle(content.getTitle());
|
||||
entry.setContent(proxyImages ? FeedUtils.proxyImages(content.getContent(), publicUrl) : content.getContent());
|
||||
entry.setAuthor(content.getAuthor());
|
||||
|
||||
entry.setEnclosureType(content.getEnclosureType());
|
||||
entry.setEnclosureUrl(proxyImages && StringUtils.contains(content.getEnclosureType(), "image")
|
||||
? FeedUtils.proxyImage(content.getEnclosureUrl(), publicUrl)
|
||||
: content.getEnclosureUrl());
|
||||
|
||||
entry.setMediaDescription(content.getMediaDescription());
|
||||
entry.setMediaThumbnailUrl(
|
||||
proxyImages ? FeedUtils.proxyImage(content.getMediaThumbnailUrl(), publicUrl) : content.getMediaThumbnailUrl());
|
||||
entry.setMediaThumbnailWidth(content.getMediaThumbnailWidth());
|
||||
entry.setMediaThumbnailHeight(content.getMediaThumbnailHeight());
|
||||
|
||||
entry.setCategories(content.getCategories());
|
||||
}
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
public SyndEntry asRss() {
|
||||
SyndEntry entry = new SyndEntryImpl();
|
||||
|
||||
entry.setUri(getGuid());
|
||||
entry.setTitle(getTitle());
|
||||
entry.setAuthor(getAuthor());
|
||||
|
||||
SyndContentImpl content = new SyndContentImpl();
|
||||
content.setValue(getContent());
|
||||
entry.setContents(Arrays.<SyndContent> asList(content));
|
||||
|
||||
if (getEnclosureUrl() != null) {
|
||||
SyndEnclosureImpl enclosure = new SyndEnclosureImpl();
|
||||
enclosure.setType(getEnclosureType());
|
||||
enclosure.setUrl(getEnclosureUrl());
|
||||
entry.setEnclosures(Arrays.<SyndEnclosure> asList(enclosure));
|
||||
}
|
||||
|
||||
entry.setLink(getUrl());
|
||||
entry.setPublishedDate(getDate());
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Feed details")
|
||||
@Data
|
||||
public class FeedInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "url", required = true)
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "title", required = true)
|
||||
private String title;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Server infos")
|
||||
@Data
|
||||
public class ServerInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty
|
||||
private String announcement;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private String version;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private String gitCommit;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean allowRegistrations;
|
||||
|
||||
@ApiModelProperty
|
||||
private String googleAnalyticsCode;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean smtpEnabled;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "User settings")
|
||||
@Data
|
||||
public class Settings implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "user's preferred language, english if none", required = true)
|
||||
private String language;
|
||||
|
||||
@ApiModelProperty(value = "user reads all entries or unread entries only", allowableValues = "all,unread", required = true)
|
||||
private String readingMode;
|
||||
|
||||
@ApiModelProperty(value = "user reads entries in ascending or descending order", allowableValues = "asc,desc", required = true)
|
||||
private String readingOrder;
|
||||
|
||||
@ApiModelProperty(value = "user viewing mode, either title-only or expande view", allowableValues = "title,expanded", required = true)
|
||||
private String viewMode;
|
||||
|
||||
@ApiModelProperty(value = "user wants category and feeds with no unread entries shown", required = true)
|
||||
private boolean showRead;
|
||||
|
||||
@ApiModelProperty(value = "In expanded view, scroll through entries mark them as read", required = true)
|
||||
private boolean scrollMarks;
|
||||
|
||||
@ApiModelProperty(value = "user's selected theme")
|
||||
private String theme;
|
||||
|
||||
@ApiModelProperty(value = "user's custom css for the website")
|
||||
private String customCss;
|
||||
|
||||
@ApiModelProperty(value = "user's preferred scroll speed when navigating between entries", required = true)
|
||||
private int scrollSpeed;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean email;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean gmail;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean facebook;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean twitter;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean tumblr;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean pocket;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean instapaper;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private boolean buffer;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.commafeed.backend.feed.FeedUtils;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.backend.model.FeedCategory;
|
||||
import com.commafeed.backend.model.FeedSubscription;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "User information")
|
||||
@Data
|
||||
public class Subscription implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "subscription id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "subscription name", required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "error message while fetching the feed", required = true)
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty(value = "error count", required = true)
|
||||
private int errorCount;
|
||||
|
||||
@ApiModelProperty(value = "last time the feed was refreshed", dataType = "number", required = true)
|
||||
private Date lastRefresh;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "next time the feed refresh is planned, null if refresh is already queued",
|
||||
dataType = "number",
|
||||
required = true)
|
||||
private Date nextRefresh;
|
||||
|
||||
@ApiModelProperty(value = "this subscription's feed url", required = true)
|
||||
private String feedUrl;
|
||||
|
||||
@ApiModelProperty(value = "this subscription's website url", required = true)
|
||||
private String feedLink;
|
||||
|
||||
@ApiModelProperty(value = "The favicon url to use for this feed", required = true)
|
||||
private String iconUrl;
|
||||
|
||||
@ApiModelProperty(value = "unread count", required = true)
|
||||
private long unread;
|
||||
|
||||
@ApiModelProperty(value = "category id")
|
||||
private String categoryId;
|
||||
|
||||
@ApiModelProperty("position of the subscription's in the list")
|
||||
private Integer position;
|
||||
|
||||
@ApiModelProperty(value = "date of the newest item", dataType = "number")
|
||||
private Date newestItemTime;
|
||||
|
||||
@ApiModelProperty(value = "JEXL string evaluated on new entries to mark them as read if they do not match")
|
||||
private String filter;
|
||||
|
||||
public static Subscription build(FeedSubscription subscription, String publicUrl, UnreadCount unreadCount) {
|
||||
Date now = new Date();
|
||||
FeedCategory category = subscription.getCategory();
|
||||
Feed feed = subscription.getFeed();
|
||||
Subscription sub = new Subscription();
|
||||
sub.setId(subscription.getId());
|
||||
sub.setName(subscription.getTitle());
|
||||
sub.setPosition(subscription.getPosition());
|
||||
sub.setMessage(feed.getMessage());
|
||||
sub.setErrorCount(feed.getErrorCount());
|
||||
sub.setFeedUrl(feed.getUrl());
|
||||
sub.setFeedLink(feed.getLink());
|
||||
sub.setIconUrl(FeedUtils.getFaviconUrl(subscription, publicUrl));
|
||||
sub.setLastRefresh(feed.getLastUpdated());
|
||||
sub.setNextRefresh((feed.getDisabledUntil() != null && feed.getDisabledUntil().before(now)) ? null : feed.getDisabledUntil());
|
||||
sub.setUnread(unreadCount.getUnreadCount());
|
||||
sub.setNewestItemTime(unreadCount.getNewestItemTime());
|
||||
sub.setCategoryId(category == null ? null : String.valueOf(category.getId()));
|
||||
sub.setFilter(subscription.getFilter());
|
||||
return sub;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Unread count")
|
||||
@Data
|
||||
public class UnreadCount implements Serializable {
|
||||
|
||||
@ApiModelProperty
|
||||
private long feedId;
|
||||
|
||||
@ApiModelProperty
|
||||
private long unreadCount;
|
||||
|
||||
@ApiModelProperty(dataType = "number")
|
||||
private Date newestItemTime;
|
||||
|
||||
public UnreadCount() {
|
||||
}
|
||||
|
||||
public UnreadCount(long feedId, long unreadCount, Date newestItemTime) {
|
||||
this.feedId = feedId;
|
||||
this.unreadCount = unreadCount;
|
||||
this.newestItemTime = newestItemTime;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "User information")
|
||||
@Data
|
||||
public class UserModel implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "user id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "user name", required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("user email, if any")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty("api key")
|
||||
private String apiKey;
|
||||
|
||||
@ApiModelProperty(value = "user password, never returned by the api")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "account status", required = true)
|
||||
private boolean enabled;
|
||||
|
||||
@ApiModelProperty(value = "account creation date", dataType = "number", required = true)
|
||||
private Date created;
|
||||
|
||||
@ApiModelProperty(value = "last login date", dataType = "number")
|
||||
private Date lastLogin;
|
||||
|
||||
@ApiModelProperty(value = "user is admin", required = true)
|
||||
private boolean admin;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Add Category Request")
|
||||
@Data
|
||||
public class AddCategoryRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "name", required = true)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "parent category id, if any")
|
||||
@Size(max = 128)
|
||||
private String parentId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Category modification request")
|
||||
@Data
|
||||
public class CategoryModificationRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "new name, null if not changed")
|
||||
@Size(max = 128)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "new parent category id")
|
||||
@Size(max = 128)
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "new display position, null if not changed")
|
||||
private Integer position;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Mark Request")
|
||||
@Data
|
||||
public class CollapseRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "category id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "collapse", required = true)
|
||||
private boolean collapse;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Feed information request")
|
||||
@Data
|
||||
public class FeedInfoRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "feed url", required = true)
|
||||
@NotEmpty
|
||||
@Size(max = 4096)
|
||||
private String url;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Feed modification request")
|
||||
@Data
|
||||
public class FeedModificationRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "new name, null if not changed")
|
||||
@Size(max = 128)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "new parent category id")
|
||||
@Size(max = 128)
|
||||
private String categoryId;
|
||||
|
||||
@ApiModelProperty(value = "new display position, null if not changed")
|
||||
private Integer position;
|
||||
|
||||
@ApiModelProperty(value = "JEXL string evaluated on new entries to mark them as read if they do not match")
|
||||
@Size(max = 4096)
|
||||
private String filter;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel
|
||||
@Data
|
||||
public class IDRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
@ApiModel
|
||||
public class LoginRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "username", required = true)
|
||||
@Size(min = 3, max = 32)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "password", required = true)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String password;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Mark Request")
|
||||
@Data
|
||||
public class MarkRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "entry id, category id, 'all' or 'starred'", required = true)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "mark as read or unread", required = true)
|
||||
private boolean read;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "only entries older than this, pass the timestamp you got from the entry list to prevent marking an entry that was not retrieved",
|
||||
required = false)
|
||||
private Long olderThan;
|
||||
|
||||
@ApiModelProperty(value = "only mark read if a feed has these keywords in the title or rss content", required = false)
|
||||
@Size(max = 128)
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "if marking a category or 'all', exclude those subscriptions from the marking", required = false)
|
||||
private List<Long> excludedSubscriptions;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Multiple Mark Request")
|
||||
@Data
|
||||
public class MultipleMarkRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "list of mark requests", required = true)
|
||||
private List<@Valid MarkRequest> requests;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
@ApiModel
|
||||
public class PasswordResetRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "email address for password recovery", required = true)
|
||||
@Email
|
||||
@NotEmpty
|
||||
@Size(max = 255)
|
||||
private String email;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import com.commafeed.frontend.auth.ValidPassword;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Profile modification request")
|
||||
@Data
|
||||
public class ProfileModificationRequest implements Serializable {
|
||||
@ApiModelProperty(value = "current user password, required to change profile data", required = true)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String currentPassword;
|
||||
|
||||
@ApiModelProperty(value = "changes email of the user, if specified")
|
||||
@Size(max = 255)
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "changes password of the user, if specified")
|
||||
@ValidPassword
|
||||
private String newPassword;
|
||||
|
||||
@ApiModelProperty(value = "generate a new api key")
|
||||
private boolean newApiKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import com.commafeed.frontend.auth.ValidPassword;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
@ApiModel
|
||||
public class RegistrationRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "username, between 3 and 32 characters", required = true)
|
||||
@NotEmpty
|
||||
@Size(min = 3, max = 32)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "password, minimum 6 characters", required = true)
|
||||
@NotEmpty
|
||||
@ValidPassword
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "email address for password recovery", required = true)
|
||||
@Email
|
||||
@NotEmpty
|
||||
@Size(max = 255)
|
||||
private String email;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Star Request")
|
||||
@Data
|
||||
public class StarRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "id", required = true)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "feed id", required = true)
|
||||
private Long feedId;
|
||||
|
||||
@ApiModelProperty(value = "starred or not", required = true)
|
||||
private boolean starred;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Subscription request")
|
||||
@Data
|
||||
public class SubscribeRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "url of the feed", required = true)
|
||||
@NotEmpty
|
||||
@Size(max = 4096)
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "name of the feed for the user", required = true)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "id of the user category to place the feed in")
|
||||
@Size(max = 128)
|
||||
private String categoryId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Tag Request")
|
||||
@Data
|
||||
public class TagRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "entry id", required = true)
|
||||
private Long entryId;
|
||||
|
||||
@ApiModelProperty(value = "tags", required = true)
|
||||
private List<String> tags;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user