Skip to content
Snippets Groups Projects
Commit 0372c49f authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

add apps

parent a7a586b6
No related branches found
No related tags found
No related merge requests found
/**
* Created by mirco on 20.05.16.
*/
package org.hbp.mip.controllers;
import io.swagger.annotations.*;
import org.hbp.mip.model.App;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.LinkedList;
import java.util.List;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
@RestController
@RequestMapping(value = "/apps", produces = {APPLICATION_JSON_VALUE})
@Api(value = "/apps", description = "the apps API")
public class AppsApi {
@ApiOperation(value = "Get apps", response = App.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success") })
@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<List> getApps(
@ApiParam(value = "Only ask own articles") @RequestParam(value = "own", required = false) Boolean own,
@ApiParam(value = "Only ask results matching status", allowableValues = "{values=[draft, published, closed]}") @RequestParam(value = "status", required = false) String status,
@ApiParam(value = "Only ask articles from own team") @RequestParam(value = "team", required = false) Boolean team
) {
List<App> apps = new LinkedList<>();
return ResponseEntity.ok(apps);
}
}
/**
* Created by mirco on 20.05.16.
*/
package org.hbp.mip.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import javax.persistence.*;
@Entity
@Table(name = "`app`")
@ApiModel
@JsonInclude(JsonInclude.Include.NON_NULL)
public class App {
@Id
@GeneratedValue
private Integer id;
private String name;
private String description;
private String author;
private String email;
private String category;
private String link;
private String image;
private Integer ratings;
private Integer ratings_count;
public App() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public Integer getRatings() {
return ratings;
}
public void setRatings(Integer ratings) {
this.ratings = ratings;
}
public Integer getRatings_count() {
return ratings_count;
}
public void setRatings_count(Integer ratings_count) {
this.ratings_count = ratings_count;
}
}
......@@ -20,7 +20,7 @@ import java.util.Map;
public class Config {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue
private Long id = null;
private String type = null;
......
......@@ -20,7 +20,7 @@ import java.util.List;
public class Filter {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue
private Long id = null;
@ManyToOne
......
......@@ -21,7 +21,7 @@ import java.util.List;
public class Query {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue
private Long id = null;
private String request = null;
......
......@@ -29,6 +29,7 @@
<mapping class="org.hbp.mip.model.Filter"/>
<mapping class="org.hbp.mip.model.Group"/>
<mapping class="org.hbp.mip.model.Config"/>
<mapping class="org.hbp.mip.model.App"/>
</session-factory>
</hibernate-configuration>
db @ 924d54cc
Subproject commit c356487b96c0e7ab555130688c84b647e294c63a
Subproject commit 924d54ccf64c0282aea7ab13ea8c774b020092e3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment