mirror of
https://github.com/Athou/commafeed.git
synced 2026-10-29 08:28:52 +00:00
migrate from swagger to openapi3
This commit is contained in:
@@ -4,36 +4,36 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Entry details")
|
||||
@Schema(description = "Entry details")
|
||||
@Data
|
||||
public class Category implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "category id", required = true)
|
||||
@Schema(description = "category id", requiredMode = RequiredMode.REQUIRED)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "parent category id")
|
||||
@Schema(description = "parent category id")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "parent category name")
|
||||
@Schema(description = "parent category name")
|
||||
private String parentName;
|
||||
|
||||
@ApiModelProperty(value = "category id", required = true)
|
||||
@Schema(description = "category id", requiredMode = RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "category children categories", required = true)
|
||||
@Schema(description = "category children categories", requiredMode = RequiredMode.REQUIRED)
|
||||
private List<Category> children = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(value = "category feeds", required = true)
|
||||
@Schema(description = "category feeds", requiredMode = RequiredMode.REQUIRED)
|
||||
private List<Subscription> feeds = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(value = "whether the category is expanded or collapsed", required = true)
|
||||
@Schema(description = "whether the category is expanded or collapsed", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean expanded;
|
||||
|
||||
@ApiModelProperty(value = "position of the category in the list", required = true)
|
||||
@Schema(description = "position of the category in the list", requiredMode = RequiredMode.REQUIRED)
|
||||
private int position;
|
||||
}
|
||||
@@ -4,45 +4,45 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "List of entries with some metadata")
|
||||
@Schema(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)
|
||||
@Schema(description = "name of the feed or the category requested", requiredMode = RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "error or warning message")
|
||||
@Schema(description = "error or warning message")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty(value = "times the server tried to refresh the feed and failed", required = true)
|
||||
@Schema(description = "times the server tried to refresh the feed and failed", requiredMode = RequiredMode.REQUIRED)
|
||||
private int errorCount;
|
||||
|
||||
@ApiModelProperty(value = "URL of the website, extracted from the feed, only filled if querying for feed entries, not category entries")
|
||||
@Schema(description = "URL of the website, extracted from the feed, only filled if querying for feed entries, not category entries")
|
||||
private String feedLink;
|
||||
|
||||
@ApiModelProperty(value = "list generation timestamp", required = true)
|
||||
@Schema(description = "list generation timestamp", requiredMode = RequiredMode.REQUIRED)
|
||||
private long timestamp;
|
||||
|
||||
@ApiModelProperty(value = "if the query has more elements", required = true)
|
||||
@Schema(description = "if the query has more elements", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean hasMore;
|
||||
|
||||
@ApiModelProperty(value = "the requested offset")
|
||||
@Schema(description = "the requested offset")
|
||||
private int offset;
|
||||
|
||||
@ApiModelProperty(value = "the requested limit")
|
||||
@Schema(description = "the requested limit")
|
||||
private int limit;
|
||||
|
||||
@ApiModelProperty(value = "list of entries", required = true)
|
||||
@Schema(description = "list of entries", requiredMode = RequiredMode.REQUIRED)
|
||||
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)
|
||||
@Schema(
|
||||
description = "if true, the unread flag was ignored in the request, all entries are returned regardless of their read status",
|
||||
requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean ignoredReadStatus;
|
||||
|
||||
}
|
||||
|
||||
@@ -21,88 +21,88 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Entry details")
|
||||
@Schema(description = "Entry details")
|
||||
@Data
|
||||
public class Entry implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "entry id", required = true)
|
||||
@Schema(description = "entry id", requiredMode = RequiredMode.REQUIRED)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "entry guid", required = true)
|
||||
@Schema(description = "entry guid", requiredMode = RequiredMode.REQUIRED)
|
||||
private String guid;
|
||||
|
||||
@ApiModelProperty(value = "entry title", required = true)
|
||||
@Schema(description = "entry title", requiredMode = RequiredMode.REQUIRED)
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "entry content", required = true)
|
||||
@Schema(description = "entry content", requiredMode = RequiredMode.REQUIRED)
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "comma-separated list of categories")
|
||||
@Schema(description = "comma-separated list of categories")
|
||||
private String categories;
|
||||
|
||||
@ApiModelProperty(value = "whether entry content and title are rtl", required = true)
|
||||
@Schema(description = "whether entry content and title are rtl", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean rtl;
|
||||
|
||||
@ApiModelProperty(value = "entry author")
|
||||
@Schema(description = "entry author")
|
||||
private String author;
|
||||
|
||||
@ApiModelProperty(value = "entry enclosure url, if any")
|
||||
@Schema(description = "entry enclosure url, if any")
|
||||
private String enclosureUrl;
|
||||
|
||||
@ApiModelProperty(value = "entry enclosure mime type, if any")
|
||||
@Schema(description = "entry enclosure mime type, if any")
|
||||
private String enclosureType;
|
||||
|
||||
@ApiModelProperty(value = "entry media description, if any")
|
||||
@Schema(description = "entry media description, if any")
|
||||
private String mediaDescription;
|
||||
|
||||
@ApiModelProperty(value = "entry media thumbnail url, if any")
|
||||
@Schema(description = "entry media thumbnail url, if any")
|
||||
private String mediaThumbnailUrl;
|
||||
|
||||
@ApiModelProperty(value = "entry media thumbnail width, if any")
|
||||
@Schema(description = "entry media thumbnail width, if any")
|
||||
private Integer mediaThumbnailWidth;
|
||||
|
||||
@ApiModelProperty(value = "entry media thumbnail height, if any")
|
||||
@Schema(description = "entry media thumbnail height, if any")
|
||||
private Integer mediaThumbnailHeight;
|
||||
|
||||
@ApiModelProperty(value = "entry publication date", dataType = "number", required = true)
|
||||
@Schema(description = "entry publication date", type = "number", requiredMode = RequiredMode.REQUIRED)
|
||||
private Date date;
|
||||
|
||||
@ApiModelProperty(value = "entry insertion date in the database", dataType = "number", required = true)
|
||||
@Schema(description = "entry insertion date in the database", type = "number", requiredMode = RequiredMode.REQUIRED)
|
||||
private Date insertedDate;
|
||||
|
||||
@ApiModelProperty(value = "feed id", required = true)
|
||||
@Schema(description = "feed id", requiredMode = RequiredMode.REQUIRED)
|
||||
private String feedId;
|
||||
|
||||
@ApiModelProperty(value = "feed name", required = true)
|
||||
@Schema(description = "feed name", requiredMode = RequiredMode.REQUIRED)
|
||||
private String feedName;
|
||||
|
||||
@ApiModelProperty(value = "this entry's feed url", required = true)
|
||||
@Schema(description = "this entry's feed url", requiredMode = RequiredMode.REQUIRED)
|
||||
private String feedUrl;
|
||||
|
||||
@ApiModelProperty(value = "this entry's website url", required = true)
|
||||
@Schema(description = "this entry's website url", requiredMode = RequiredMode.REQUIRED)
|
||||
private String feedLink;
|
||||
|
||||
@ApiModelProperty(value = "The favicon url to use for this feed", required = true)
|
||||
@Schema(description = "The favicon url to use for this feed", requiredMode = RequiredMode.REQUIRED)
|
||||
private String iconUrl;
|
||||
|
||||
@ApiModelProperty(value = "entry url", required = true)
|
||||
@Schema(description = "entry url", requiredMode = RequiredMode.REQUIRED)
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "read status", required = true)
|
||||
@Schema(description = "read status", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean read;
|
||||
|
||||
@ApiModelProperty(value = "starred status", required = true)
|
||||
@Schema(description = "starred status", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean starred;
|
||||
|
||||
@ApiModelProperty(value = "whether the entry is still markable (old entry statuses are discarded)", required = true)
|
||||
@Schema(description = "whether the entry is still markable (old entry statuses are discarded)", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean markable;
|
||||
|
||||
@ApiModelProperty(value = "tags", required = true)
|
||||
@Schema(description = "tags", requiredMode = RequiredMode.REQUIRED)
|
||||
private List<String> tags;
|
||||
|
||||
public static Entry build(FeedEntryStatus status, boolean proxyImages) {
|
||||
|
||||
@@ -2,19 +2,19 @@ package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Feed details")
|
||||
@Schema(description = "Feed details")
|
||||
@Data
|
||||
public class FeedInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "url", required = true)
|
||||
@Schema(description = "url", requiredMode = RequiredMode.REQUIRED)
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "title", required = true)
|
||||
@Schema(description = "title", requiredMode = RequiredMode.REQUIRED)
|
||||
private String title;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,34 +2,34 @@ package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Server infos")
|
||||
@Schema(description = "Server infos")
|
||||
@Data
|
||||
public class ServerInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty
|
||||
@Schema
|
||||
private String announcement;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private String version;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private String gitCommit;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean allowRegistrations;
|
||||
|
||||
@ApiModelProperty
|
||||
@Schema
|
||||
private String googleAnalyticsCode;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean smtpEnabled;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean demoAccountEnabled;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,76 +2,84 @@ package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "User settings")
|
||||
@Schema(description = "User settings")
|
||||
@Data
|
||||
public class Settings implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "user's preferred language, english if none", required = true)
|
||||
@Schema(description = "user's preferred language, english if none", requiredMode = RequiredMode.REQUIRED)
|
||||
private String language;
|
||||
|
||||
@ApiModelProperty(value = "user reads all entries or unread entries only", allowableValues = "all,unread", required = true)
|
||||
@Schema(
|
||||
description = "user reads all entries or unread entries only",
|
||||
allowableValues = "all,unread",
|
||||
requiredMode = RequiredMode.REQUIRED)
|
||||
private String readingMode;
|
||||
|
||||
@ApiModelProperty(value = "user reads entries in ascending or descending order", allowableValues = "asc,desc", required = true)
|
||||
@Schema(
|
||||
description = "user reads entries in ascending or descending order",
|
||||
allowableValues = "asc,desc",
|
||||
requiredMode = RequiredMode.REQUIRED)
|
||||
private String readingOrder;
|
||||
|
||||
@ApiModelProperty(value = "user wants category and feeds with no unread entries shown", required = true)
|
||||
@Schema(description = "user wants category and feeds with no unread entries shown", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean showRead;
|
||||
|
||||
@ApiModelProperty(value = "In expanded view, scroll through entries mark them as read", required = true)
|
||||
@Schema(description = "In expanded view, scroll through entries mark them as read", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean scrollMarks;
|
||||
|
||||
@ApiModelProperty(value = "user's custom css for the website")
|
||||
@Schema(description = "user's custom css for the website")
|
||||
private String customCss;
|
||||
|
||||
@ApiModelProperty(value = "user's custom js for the website")
|
||||
@Schema(description = "user's custom js for the website")
|
||||
private String customJs;
|
||||
|
||||
@ApiModelProperty(value = "user's preferred scroll speed when navigating between entries", required = true)
|
||||
@Schema(description = "user's preferred scroll speed when navigating between entries", requiredMode = RequiredMode.REQUIRED)
|
||||
private int scrollSpeed;
|
||||
|
||||
@ApiModelProperty(value = "always scroll selected entry to the top of the page, even if it fits entirely on screen", required = true)
|
||||
@Schema(
|
||||
description = "always scroll selected entry to the top of the page, even if it fits entirely on screen",
|
||||
requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean alwaysScrollToEntry;
|
||||
|
||||
@ApiModelProperty(value = "ask for confirmation when marking all entries as read", required = true)
|
||||
@Schema(description = "ask for confirmation when marking all entries as read", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean markAllAsReadConfirmation;
|
||||
|
||||
@ApiModelProperty(value = "show commafeed's own context menu on right click", required = true)
|
||||
@Schema(description = "show commafeed's own context menu on right click", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean customContextMenu;
|
||||
|
||||
@ApiModelProperty(value = "sharing settings", required = true)
|
||||
@Schema(description = "sharing settings", requiredMode = RequiredMode.REQUIRED)
|
||||
private SharingSettings sharingSettings = new SharingSettings();
|
||||
|
||||
@ApiModel(description = "User sharing settings")
|
||||
@Schema(description = "User sharing settings")
|
||||
@Data
|
||||
public static class SharingSettings implements Serializable {
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean email;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean gmail;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean facebook;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean twitter;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean tumblr;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean pocket;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean instapaper;
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean buffer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,55 +8,55 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "User information")
|
||||
@Schema(description = "User information")
|
||||
@Data
|
||||
public class Subscription implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "subscription id", required = true)
|
||||
@Schema(description = "subscription id", requiredMode = RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "subscription name", required = true)
|
||||
@Schema(description = "subscription name", requiredMode = RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "error message while fetching the feed")
|
||||
@Schema(description = "error message while fetching the feed")
|
||||
private String message;
|
||||
|
||||
@ApiModelProperty(value = "error count", required = true)
|
||||
@Schema(description = "error count", requiredMode = RequiredMode.REQUIRED)
|
||||
private int errorCount;
|
||||
|
||||
@ApiModelProperty(value = "last time the feed was refreshed", dataType = "number")
|
||||
@Schema(description = "last time the feed was refreshed", type = "number")
|
||||
private Date lastRefresh;
|
||||
|
||||
@ApiModelProperty(value = "next time the feed refresh is planned, null if refresh is already queued", dataType = "number")
|
||||
@Schema(description = "next time the feed refresh is planned, null if refresh is already queued", type = "number")
|
||||
private Date nextRefresh;
|
||||
|
||||
@ApiModelProperty(value = "this subscription's feed url", required = true)
|
||||
@Schema(description = "this subscription's feed url", requiredMode = RequiredMode.REQUIRED)
|
||||
private String feedUrl;
|
||||
|
||||
@ApiModelProperty(value = "this subscription's website url", required = true)
|
||||
@Schema(description = "this subscription's website url", requiredMode = RequiredMode.REQUIRED)
|
||||
private String feedLink;
|
||||
|
||||
@ApiModelProperty(value = "The favicon url to use for this feed", required = true)
|
||||
@Schema(description = "The favicon url to use for this feed", requiredMode = RequiredMode.REQUIRED)
|
||||
private String iconUrl;
|
||||
|
||||
@ApiModelProperty(value = "unread count", required = true)
|
||||
@Schema(description = "unread count", requiredMode = RequiredMode.REQUIRED)
|
||||
private long unread;
|
||||
|
||||
@ApiModelProperty(value = "category id")
|
||||
@Schema(description = "category id")
|
||||
private String categoryId;
|
||||
|
||||
@ApiModelProperty("position of the subscription's in the list")
|
||||
@Schema(description = "position of the subscription's in the list")
|
||||
private int position;
|
||||
|
||||
@ApiModelProperty(value = "date of the newest item", dataType = "number")
|
||||
@Schema(description = "date of the newest item", type = "number")
|
||||
private Date newestItemTime;
|
||||
|
||||
@ApiModelProperty(value = "JEXL string evaluated on new entries to mark them as read if they do not match")
|
||||
@Schema(description = "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, UnreadCount unreadCount) {
|
||||
|
||||
@@ -3,22 +3,21 @@ package com.commafeed.frontend.model;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Unread count")
|
||||
@Schema(description = "Unread count")
|
||||
@Data
|
||||
public class UnreadCount implements Serializable {
|
||||
|
||||
@ApiModelProperty
|
||||
@Schema
|
||||
private long feedId;
|
||||
|
||||
@ApiModelProperty
|
||||
@Schema
|
||||
private long unreadCount;
|
||||
|
||||
@ApiModelProperty(dataType = "number")
|
||||
@Schema(type = "number")
|
||||
private Date newestItemTime;
|
||||
|
||||
public UnreadCount() {
|
||||
|
||||
@@ -3,40 +3,40 @@ package com.commafeed.frontend.model;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "User information")
|
||||
@Schema(description = "User information")
|
||||
@Data
|
||||
public class UserModel implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "user id", required = true)
|
||||
@Schema(description = "user id", requiredMode = RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "user name", required = true)
|
||||
@Schema(description = "user name", requiredMode = RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("user email, if any")
|
||||
@Schema(description = "user email, if any")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty("api key")
|
||||
@Schema(description = "api key")
|
||||
private String apiKey;
|
||||
|
||||
@ApiModelProperty(value = "user password, never returned by the api")
|
||||
@Schema(description = "user password, never returned by the api")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "account status", required = true)
|
||||
@Schema(description = "account status", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean enabled;
|
||||
|
||||
@ApiModelProperty(value = "account creation date", dataType = "number")
|
||||
@Schema(description = "account creation date", type = "number")
|
||||
private Date created;
|
||||
|
||||
@ApiModelProperty(value = "last login date", dataType = "number")
|
||||
@Schema(description = "last login date", type = "number")
|
||||
private Date lastLogin;
|
||||
|
||||
@ApiModelProperty(value = "user is admin", required = true)
|
||||
@Schema(description = "user is admin", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean admin;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,21 +5,21 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Add Category Request")
|
||||
@Schema(description = "Add Category Request")
|
||||
@Data
|
||||
public class AddCategoryRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "name", required = true)
|
||||
@Schema(description = "name", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "parent category id, if any")
|
||||
@Schema(description = "parent category id, if any")
|
||||
@Size(max = 128)
|
||||
private String parentId;
|
||||
|
||||
|
||||
@@ -4,27 +4,27 @@ import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Category modification request")
|
||||
@Schema(description = "Category modification request")
|
||||
@Data
|
||||
public class CategoryModificationRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "id", required = true)
|
||||
@Schema(description = "id", requiredMode = RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "new name, null if not changed")
|
||||
@Schema(description = "new name, null if not changed")
|
||||
@Size(max = 128)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "new parent category id")
|
||||
@Schema(description = "new parent category id")
|
||||
@Size(max = 128)
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "new display position, null if not changed")
|
||||
@Schema(description = "new display position, null if not changed")
|
||||
private Integer position;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,19 +2,19 @@ package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Mark Request")
|
||||
@Schema(description = "Mark Request")
|
||||
@Data
|
||||
public class CollapseRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "category id", required = true)
|
||||
@Schema(description = "category id", requiredMode = RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "collapse", required = true)
|
||||
@Schema(description = "collapse", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean collapse;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,16 +5,16 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Feed information request")
|
||||
@Schema(description = "Feed information request")
|
||||
@Data
|
||||
public class FeedInfoRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "feed url", required = true)
|
||||
@Schema(description = "feed url", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Size(max = 4096)
|
||||
private String url;
|
||||
|
||||
@@ -4,30 +4,30 @@ import java.io.Serializable;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Feed modification request")
|
||||
@Schema(description = "Feed modification request")
|
||||
@Data
|
||||
public class FeedModificationRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "id", required = true)
|
||||
@Schema(description = "id", requiredMode = RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "new name, null if not changed")
|
||||
@Schema(description = "new name, null if not changed")
|
||||
@Size(max = 128)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "new parent category id")
|
||||
@Schema(description = "new parent category id")
|
||||
@Size(max = 128)
|
||||
private String categoryId;
|
||||
|
||||
@ApiModelProperty(value = "new display position, null if not changed")
|
||||
@Schema(description = "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")
|
||||
@Schema(description = "JEXL string evaluated on new entries to mark them as read if they do not match")
|
||||
@Size(max = 4096)
|
||||
private String filter;
|
||||
|
||||
|
||||
@@ -2,16 +2,16 @@ package com.commafeed.frontend.model.request;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel
|
||||
@Schema
|
||||
@Data
|
||||
public class IDRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(required = true)
|
||||
@Schema(requiredMode = RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,20 +5,20 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
@ApiModel
|
||||
@Schema
|
||||
public class LoginRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "username", required = true)
|
||||
@Schema(description = "username", requiredMode = RequiredMode.REQUIRED)
|
||||
@Size(min = 3, max = 32)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "password", required = true)
|
||||
@Schema(description = "password", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String password;
|
||||
|
||||
@@ -6,33 +6,37 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Mark Request")
|
||||
@Schema(description = "Mark Request")
|
||||
@Data
|
||||
public class MarkRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "entry id, category id, 'all' or 'starred'", required = true)
|
||||
@Schema(description = "entry id, category id, 'all' or 'starred'", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "mark as read or unread", required = true)
|
||||
@Schema(description = "mark as read or unread", requiredMode = RequiredMode.REQUIRED)
|
||||
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)
|
||||
@Schema(
|
||||
description = "only entries older than this, pass the timestamp you got from the entry list to prevent marking an entry that was not retrieved",
|
||||
requiredMode = RequiredMode.NOT_REQUIRED)
|
||||
private Long olderThan;
|
||||
|
||||
@ApiModelProperty(value = "only mark read if a feed has these keywords in the title or rss content", required = false)
|
||||
@Schema(
|
||||
description = "only mark read if a feed has these keywords in the title or rss content",
|
||||
requiredMode = RequiredMode.NOT_REQUIRED)
|
||||
@Size(max = 128)
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "if marking a category or 'all', exclude those subscriptions from the marking", required = false)
|
||||
@Schema(
|
||||
description = "if marking a category or 'all', exclude those subscriptions from the marking",
|
||||
requiredMode = RequiredMode.NOT_REQUIRED)
|
||||
private List<Long> excludedSubscriptions;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,16 +5,16 @@ import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Multiple Mark Request")
|
||||
@Schema(description = "Multiple Mark Request")
|
||||
@Data
|
||||
public class MultipleMarkRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "list of mark requests", required = true)
|
||||
@Schema(description = "list of mark requests", requiredMode = RequiredMode.REQUIRED)
|
||||
private List<@Valid MarkRequest> requests;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,16 +6,16 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
@ApiModel
|
||||
@Schema
|
||||
public class PasswordResetRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "email address for password recovery", required = true)
|
||||
@Schema(description = "email address for password recovery", requiredMode = RequiredMode.REQUIRED)
|
||||
@Email
|
||||
@NotEmpty
|
||||
@Size(max = 255)
|
||||
|
||||
@@ -7,28 +7,28 @@ import javax.validation.constraints.Size;
|
||||
|
||||
import com.commafeed.frontend.auth.ValidPassword;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Profile modification request")
|
||||
@Schema(description = "Profile modification request")
|
||||
@Data
|
||||
public class ProfileModificationRequest implements Serializable {
|
||||
@ApiModelProperty(value = "current user password, required to change profile data", required = true)
|
||||
@Schema(description = "current user password, required to change profile data", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String currentPassword;
|
||||
|
||||
@ApiModelProperty(value = "changes email of the user, if specified")
|
||||
@Schema(description = "changes email of the user, if specified")
|
||||
@Size(max = 255)
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "changes password of the user, if specified")
|
||||
@Schema(description = "changes password of the user, if specified")
|
||||
@ValidPassword
|
||||
private String newPassword;
|
||||
|
||||
@ApiModelProperty(value = "generate a new api key")
|
||||
@Schema(description = "generate a new api key")
|
||||
private boolean newApiKey;
|
||||
|
||||
}
|
||||
|
||||
@@ -8,26 +8,26 @@ import javax.validation.constraints.Size;
|
||||
|
||||
import com.commafeed.frontend.auth.ValidPassword;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Data
|
||||
@ApiModel
|
||||
@Schema
|
||||
public class RegistrationRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "username, between 3 and 32 characters", required = true)
|
||||
@Schema(description = "username, between 3 and 32 characters", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Size(min = 3, max = 32)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "password, minimum 6 characters", required = true)
|
||||
@Schema(description = "password, minimum 6 characters", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@ValidPassword
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "email address for password recovery", required = true)
|
||||
@Schema(description = "email address for password recovery", requiredMode = RequiredMode.REQUIRED)
|
||||
@Email
|
||||
@NotEmpty
|
||||
@Size(max = 255)
|
||||
|
||||
@@ -5,24 +5,24 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Star Request")
|
||||
@Schema(description = "Star Request")
|
||||
@Data
|
||||
public class StarRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "id", required = true)
|
||||
@Schema(description = "id", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "feed id", required = true)
|
||||
@Schema(description = "feed id", requiredMode = RequiredMode.REQUIRED)
|
||||
private Long feedId;
|
||||
|
||||
@ApiModelProperty(value = "starred or not", required = true)
|
||||
@Schema(description = "starred or not", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean starred;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,26 +5,26 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Subscription request")
|
||||
@Schema(description = "Subscription request")
|
||||
@Data
|
||||
public class SubscribeRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "url of the feed", required = true)
|
||||
@Schema(description = "url of the feed", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Size(max = 4096)
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "name of the feed for the user", required = true)
|
||||
@Schema(description = "name of the feed for the user", requiredMode = RequiredMode.REQUIRED)
|
||||
@NotEmpty
|
||||
@Size(max = 128)
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "id of the user category to place the feed in")
|
||||
@Schema(description = "id of the user category to place the feed in")
|
||||
@Size(max = 128)
|
||||
private String categoryId;
|
||||
|
||||
|
||||
@@ -3,19 +3,19 @@ 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||
import lombok.Data;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@ApiModel(description = "Tag Request")
|
||||
@Schema(description = "Tag Request")
|
||||
@Data
|
||||
public class TagRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "entry id", required = true)
|
||||
@Schema(description = "entry id", requiredMode = RequiredMode.REQUIRED)
|
||||
private Long entryId;
|
||||
|
||||
@ApiModelProperty(value = "tags", required = true)
|
||||
@Schema(description = "tags", requiredMode = RequiredMode.REQUIRED)
|
||||
private List<String> tags;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user