forked from eugenp/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArticleServiceImpl.java
More file actions
executable file
·34 lines (25 loc) · 892 Bytes
/
Copy pathArticleServiceImpl.java
File metadata and controls
executable file
·34 lines (25 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package app.services;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import app.models.Article;
public class ArticleServiceImpl implements ArticleService {
public List<Article> getArticles() {
return fetchArticles();
}
public Article search(String keyword) {
Article ar = new Article("Article with " + keyword, "baeldung", "1250", Instant.now()
.toString());
return ar;
}
private List<Article> fetchArticles() {
Article ar1 = new Article("Introduction to ActiveWeb", "baeldung", "1650", Instant.now()
.toString());
Article ar = new Article("Introduction to Mule", "baeldung", "1650", Instant.now()
.toString());
List<Article> articles = new ArrayList<Article>();
articles.add(ar);
articles.add(ar1);
return articles;
}
}