|
|
@ -32,10 +32,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Response> addArticle(
|
|
|
|
public @ResponseBody EntityModel<Response> addArticle(
|
|
|
|
@RequestBody Article article
|
|
|
|
@RequestBody Article article
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.addArticle(article);
|
|
|
|
Response results = articleService.addArticle(article);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).addArticle(article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).addArticle(article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
@ -54,10 +54,10 @@ public class ArticleControler {
|
|
|
|
@PathVariable("title") String title,
|
|
|
|
@PathVariable("title") String title,
|
|
|
|
@RequestBody Article article
|
|
|
|
@RequestBody Article article
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Article res = articleService.updateTitle(article, title);
|
|
|
|
Article results = articleService.updateTitle(article, title);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateTitle(title, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateTitle(title, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
@ -75,10 +75,10 @@ public class ArticleControler {
|
|
|
|
@PathVariable("url") String url,
|
|
|
|
@PathVariable("url") String url,
|
|
|
|
@RequestBody Article article
|
|
|
|
@RequestBody Article article
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Article res = articleService.updateUrl(article, url);
|
|
|
|
Article results = articleService.updateUrl(article, url);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateUrl(url, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateUrl(url, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
@ -96,10 +96,10 @@ public class ArticleControler {
|
|
|
|
@PathVariable("datePublished") String datePublished,
|
|
|
|
@PathVariable("datePublished") String datePublished,
|
|
|
|
@RequestBody Article article
|
|
|
|
@RequestBody Article article
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Article res = articleService.updateDatePublished(article, datePublished);
|
|
|
|
Article results = articleService.updateDatePublished(article, datePublished);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateDatePublished(datePublished, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateDatePublished(datePublished, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
@ -118,10 +118,10 @@ public class ArticleControler {
|
|
|
|
@PathVariable("dateAdded") String dateAdded,
|
|
|
|
@PathVariable("dateAdded") String dateAdded,
|
|
|
|
@RequestBody Article article
|
|
|
|
@RequestBody Article article
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Article res = articleService.updateDateAdded(article, dateAdded);
|
|
|
|
Article results = articleService.updateDateAdded(article, dateAdded);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateDateAdded(dateAdded, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateDateAdded(dateAdded, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
@ -139,10 +139,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Article> changeVisibility(
|
|
|
|
public @ResponseBody EntityModel<Article> changeVisibility(
|
|
|
|
@RequestBody Article article
|
|
|
|
@RequestBody Article article
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Article res = articleService.changeVisibility(article);
|
|
|
|
Article results = articleService.changeVisibility(article);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).changeVisibility(article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).changeVisibility(article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
@ -161,10 +161,10 @@ public class ArticleControler {
|
|
|
|
@PathVariable("type") Integer type,
|
|
|
|
@PathVariable("type") Integer type,
|
|
|
|
@RequestBody Article article
|
|
|
|
@RequestBody Article article
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Article res = articleService.updateType(article, type);
|
|
|
|
Article results = articleService.updateType(article, type);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateType(type, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).updateType(type, article)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("allArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(article.getId())).withRel("getArticleById"),
|
|
|
@ -175,7 +175,10 @@ public class ArticleControler {
|
|
|
|
// endregion
|
|
|
|
// endregion
|
|
|
|
|
|
|
|
|
|
|
|
// region GET
|
|
|
|
// region GET
|
|
|
|
@GetMapping(value = "/getAllArticle", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getAllArticle",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getAllArticles() {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getAllArticles() {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getAllArticles();
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getAllArticles();
|
|
|
|
|
|
|
|
|
|
|
@ -189,7 +192,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticleById/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticleById/{id}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<Article> getArticleById(@PathVariable(value = "id") Integer id) {
|
|
|
|
public @ResponseBody EntityModel<Article> getArticleById(@PathVariable(value = "id") Integer id) {
|
|
|
|
Article results = articleService.getArticlesById(id);
|
|
|
|
Article results = articleService.getArticlesById(id);
|
|
|
|
|
|
|
|
|
|
|
@ -204,7 +210,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticlesByTitle/{title}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticlesByTitle/{title}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesByTitle(@PathVariable(value = "title") String title) {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesByTitle(@PathVariable(value = "title") String title) {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesByTitle(title);
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesByTitle(title);
|
|
|
|
|
|
|
|
|
|
|
@ -219,7 +228,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticlesByUrl/{url}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticlesByUrl/{url}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesByUrl(@PathVariable(value = "url") String url) {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesByUrl(@PathVariable(value = "url") String url) {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesByUrl(url);
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesByUrl(url);
|
|
|
|
|
|
|
|
|
|
|
@ -234,7 +246,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticlesByType/{type}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticlesByType/{type}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesByType(@PathVariable(value = "type") Integer type) {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesByType(@PathVariable(value = "type") Integer type) {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesByType(type);
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesByType(type);
|
|
|
|
|
|
|
|
|
|
|
@ -249,7 +264,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getVisibleArticles", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getVisibleArticles",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getVisibleArticles() {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getVisibleArticles() {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getVisibleArticles();
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getVisibleArticles();
|
|
|
|
|
|
|
|
|
|
|
@ -263,7 +281,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getInvisibleArticles", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getInvisibleArticles",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getInvisibleArticles() {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getInvisibleArticles() {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getInvisibleArticles();
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getInvisibleArticles();
|
|
|
|
|
|
|
|
|
|
|
@ -277,7 +298,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticlesAddedBefore/{dateAdded}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticlesAddedBefore/{dateAdded}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesAddedBefore(@PathVariable(value = "dateAdded") String dateAdded) {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesAddedBefore(@PathVariable(value = "dateAdded") String dateAdded) {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesAddedBefore(dateAdded);
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesAddedBefore(dateAdded);
|
|
|
|
|
|
|
|
|
|
|
@ -292,7 +316,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticlesAddedAfter/{dateAdded}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticlesAddedAfter/{dateAdded}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesAddedAfter(@PathVariable(value = "dateAdded") String dateAdded) {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesAddedAfter(@PathVariable(value = "dateAdded") String dateAdded) {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesAddedAfter(dateAdded);
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesAddedAfter(dateAdded);
|
|
|
|
|
|
|
|
|
|
|
@ -307,7 +334,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticlesAddedBetween/{beginning}/{end}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticlesAddedBetween/{beginning}/{end}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesAddedBetween(@PathVariable(value = "beginning") String beginning, @PathVariable(value = "end") String end) {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesAddedBetween(@PathVariable(value = "beginning") String beginning, @PathVariable(value = "end") String end) {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesAddedBetween(beginning, end);
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesAddedBetween(beginning, end);
|
|
|
|
|
|
|
|
|
|
|
@ -322,7 +352,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticlesPublishedBefore/{datePublished}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticlesPublishedBefore/{datePublished}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesPublishedBefore(@PathVariable(value = "datePublished") String datePublished) {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesPublishedBefore(@PathVariable(value = "datePublished") String datePublished) {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesPublishedBefore(datePublished);
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesPublishedBefore(datePublished);
|
|
|
|
|
|
|
|
|
|
|
@ -337,7 +370,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticlesPublishedAfter/{datePublished}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticlesPublishedAfter/{datePublished}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesPublishedAfter(@PathVariable(value = "datePublished") String datePublished) {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesPublishedAfter(@PathVariable(value = "datePublished") String datePublished) {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesPublishedAfter(datePublished);
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesPublishedAfter(datePublished);
|
|
|
|
|
|
|
|
|
|
|
@ -352,7 +388,10 @@ public class ArticleControler {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/getArticlesPublishedBetween/{beginning}/{end}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
@GetMapping(
|
|
|
|
|
|
|
|
value = "/getArticlesPublishedBetween/{beginning}/{end}",
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON_VALUE
|
|
|
|
|
|
|
|
)
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesPublishedBetween(@PathVariable(value = "beginning") String beginning, @PathVariable(value = "end") String end) {
|
|
|
|
public @ResponseBody EntityModel<List<Article>> getArticlesPublishedBetween(@PathVariable(value = "beginning") String beginning, @PathVariable(value = "end") String end) {
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesPublishedBetween(beginning, end);
|
|
|
|
ArrayList<Article> results = (ArrayList<Article>) articleService.getArticlesPublishedBetween(beginning, end);
|
|
|
|
|
|
|
|
|
|
|
@ -377,10 +416,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleFromId(
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleFromId(
|
|
|
|
@PathVariable("id") Integer id
|
|
|
|
@PathVariable("id") Integer id
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticleFromId(id);
|
|
|
|
Response results = articleService.deleteArticleFromId(id);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleFromId(id)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleFromId(id)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(id)).withRel("getArticleById")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticleById(id)).withRel("getArticleById")
|
|
|
@ -394,10 +433,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleFromTitle(
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleFromTitle(
|
|
|
|
@PathVariable("title") String title
|
|
|
|
@PathVariable("title") String title
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticleFromTitle(title);
|
|
|
|
Response results = articleService.deleteArticleFromTitle(title);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleFromTitle(title)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleFromTitle(title)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesByTitle(title)).withRel("getArticleByTitle")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesByTitle(title)).withRel("getArticleByTitle")
|
|
|
@ -411,10 +450,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleFromUrl(
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleFromUrl(
|
|
|
|
@PathVariable("url") String url
|
|
|
|
@PathVariable("url") String url
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticleFromTitle(url);
|
|
|
|
Response results = articleService.deleteArticleFromTitle(url);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleFromUrl(url)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleFromUrl(url)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesByUrl(url)).withRel("getArticlesByUrl")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesByUrl(url)).withRel("getArticlesByUrl")
|
|
|
@ -428,10 +467,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleFromType(
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleFromType(
|
|
|
|
@PathVariable("type") Integer type
|
|
|
|
@PathVariable("type") Integer type
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticleFromType(type);
|
|
|
|
Response results = articleService.deleteArticleFromType(type);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleFromType(type)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleFromType(type)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesByType(type)).withRel("getArticlesByType")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesByType(type)).withRel("getArticlesByType")
|
|
|
@ -445,10 +484,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleAddedBefore(
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleAddedBefore(
|
|
|
|
@PathVariable("date") String date
|
|
|
|
@PathVariable("date") String date
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticleAddedBefore(date);
|
|
|
|
Response results = articleService.deleteArticleAddedBefore(date);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleAddedBefore(date)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleAddedBefore(date)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesAddedBefore(date)).withRel("getArticlesAddedBefore")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesAddedBefore(date)).withRel("getArticlesAddedBefore")
|
|
|
@ -462,10 +501,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleAddedAfter(
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticleAddedAfter(
|
|
|
|
@PathVariable("date") String date
|
|
|
|
@PathVariable("date") String date
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticleAddedAfter(date);
|
|
|
|
Response results = articleService.deleteArticleAddedAfter(date);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleAddedAfter(date)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleAddedAfter(date)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesAddedAfter(date)).withRel("getArticlesAddedAfter")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesAddedAfter(date)).withRel("getArticlesAddedAfter")
|
|
|
@ -480,10 +519,10 @@ public class ArticleControler {
|
|
|
|
@PathVariable("beginning") String beginning,
|
|
|
|
@PathVariable("beginning") String beginning,
|
|
|
|
@PathVariable("end") String end
|
|
|
|
@PathVariable("end") String end
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticleAddedBetween(beginning, end);
|
|
|
|
Response results = articleService.deleteArticleAddedBetween(beginning, end);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleAddedBetween(beginning, end)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticleAddedBetween(beginning, end)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesAddedBetween(beginning, end)).withRel("getArticlesAddedBetween")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesAddedBetween(beginning, end)).withRel("getArticlesAddedBetween")
|
|
|
@ -497,10 +536,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticlePublishedBefore(
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticlePublishedBefore(
|
|
|
|
@PathVariable("date") String date
|
|
|
|
@PathVariable("date") String date
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticlePublishedBefore(date);
|
|
|
|
Response results = articleService.deleteArticlePublishedBefore(date);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticlePublishedBefore(date)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticlePublishedBefore(date)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesPublishedBefore(date)).withRel("getArticlesPublishedBefore")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesPublishedBefore(date)).withRel("getArticlesPublishedBefore")
|
|
|
@ -514,10 +553,10 @@ public class ArticleControler {
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticlePublishedAfter(
|
|
|
|
public @ResponseBody EntityModel<Response> deleteArticlePublishedAfter(
|
|
|
|
@PathVariable("date") String date
|
|
|
|
@PathVariable("date") String date
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticlePublishedBefore(date);
|
|
|
|
Response results = articleService.deleteArticlePublishedBefore(date);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticlePublishedAfter(date)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticlePublishedAfter(date)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesPublishedAfter(date)).withRel("getArticlesPublishedAfter")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesPublishedAfter(date)).withRel("getArticlesPublishedAfter")
|
|
|
@ -532,10 +571,10 @@ public class ArticleControler {
|
|
|
|
@PathVariable("beginning") String beginning,
|
|
|
|
@PathVariable("beginning") String beginning,
|
|
|
|
@PathVariable("end") String end
|
|
|
|
@PathVariable("end") String end
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Response res = articleService.deleteArticlePublishedBetween(beginning, end);
|
|
|
|
Response results = articleService.deleteArticlePublishedBetween(beginning, end);
|
|
|
|
|
|
|
|
|
|
|
|
return EntityModel.of(
|
|
|
|
return EntityModel.of(
|
|
|
|
res,
|
|
|
|
results,
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticlePublishedBetween(beginning, end)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).deleteArticlePublishedBetween(beginning, end)).withSelfRel(),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getAllArticles()).withRel("getAllArticles"),
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesPublishedBetween(beginning, end)).withRel("getArticlesPublishedBetween")
|
|
|
|
linkTo(methodOn(ArticleControler.class).getArticlesPublishedBetween(beginning, end)).withRel("getArticlesPublishedBetween")
|
|
|
|