Add Article service and DAO with criteria-based search functionality
This commit is contained in:
@@ -4,6 +4,7 @@ import com.humanbooster.dao.ArticleDao;
|
||||
import com.humanbooster.model.Article;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class ArticleService {
|
||||
|
||||
@@ -40,4 +41,8 @@ public class ArticleService {
|
||||
public Article findArticleByTitle(String title) {
|
||||
return articleDao.findByTitle(title);
|
||||
}
|
||||
|
||||
public List<Article> findArticlesByCriteria(String keyword, Long authorId) {
|
||||
return articleDao.findByCriteria(keyword, authorId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user