mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
added a way to display an announcement
This commit is contained in:
27
src/main/java/com/commafeed/frontend/model/ServerInfo.java
Normal file
27
src/main/java/com/commafeed/frontend/model/ServerInfo.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.wordnik.swagger.annotations.ApiClass;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@ApiClass("Server infos")
|
||||
public class ServerInfo implements Serializable {
|
||||
|
||||
private String announcement;
|
||||
|
||||
public String getAnnouncement() {
|
||||
return announcement;
|
||||
}
|
||||
|
||||
public void setAnnouncement(String announcement) {
|
||||
this.announcement = announcement;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.commafeed.frontend.rest.resources.ApiDocumentationREST;
|
||||
import com.commafeed.frontend.rest.resources.CategoryREST;
|
||||
import com.commafeed.frontend.rest.resources.EntryREST;
|
||||
import com.commafeed.frontend.rest.resources.FeedREST;
|
||||
import com.commafeed.frontend.rest.resources.ServerREST;
|
||||
import com.commafeed.frontend.rest.resources.UserREST;
|
||||
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -31,6 +32,7 @@ public class RESTApplication extends Application {
|
||||
set.add(FeedREST.class);
|
||||
set.add(CategoryREST.class);
|
||||
set.add(UserREST.class);
|
||||
set.add(ServerREST.class);
|
||||
set.add(AdminREST.class);
|
||||
|
||||
set.add(ApiDocumentationREST.class);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.commafeed.frontend.rest.resources;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
import com.commafeed.frontend.model.ServerInfo;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
|
||||
@Path("/server")
|
||||
@Api(value = "/server", description = "Operations about server infos")
|
||||
public class ServerREST extends AbstractResourceREST {
|
||||
|
||||
@Path("/get")
|
||||
@GET
|
||||
@ApiOperation(value = "Get server infos", notes = "Get server infos")
|
||||
public ServerInfo get() {
|
||||
ServerInfo infos = new ServerInfo();
|
||||
infos.setAnnouncement(applicationSettingsService.get()
|
||||
.getAnnouncement());
|
||||
return infos;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user