|
@@ -31,7 +31,7 @@ public class TechnicalArticlesController extends BaseSearchController{
|
|
|
private TechnicalArticlesService technical;
|
|
|
|
|
|
@RequestMapping(value = "/articles", method = RequestMethod.POST)
|
|
|
- public ResponseVO<TechnicalArticlesDTO> technicalarticles(@RequestBody SearchConditionVO searchConditionVO){
|
|
|
+ public ResponseVO<TechnicalArticlesDTO> technicalArticles(@RequestBody SearchConditionVO searchConditionVO){
|
|
|
Map<String, String> extraCondition = searchConditionVO.getColumnFilters()==null? new HashMap<>() :super.getExtraCondition(searchConditionVO);
|
|
|
Pageable pageable = this.getPageable(searchConditionVO);
|
|
|
String keyword = searchConditionVO.getKeyword();
|
|
@@ -45,13 +45,22 @@ public class TechnicalArticlesController extends BaseSearchController{
|
|
|
|
|
|
Pageable getPageable(SearchConditionVO searchConditionVO){
|
|
|
int activePage = searchConditionVO.getActivePage() == 0?1:searchConditionVO.getActivePage();
|
|
|
- Sort sort = new Sort(Sort.Direction.ASC,"id");
|
|
|
+ Sort sort = new Sort(Sort.Direction.DESC,"publicTime");
|
|
|
return new PageRequest(activePage-1, CommonConstant.DEFAULT_ROWS_ON_PAGE, sort);
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/ranking", method = RequestMethod.GET)
|
|
|
- public List<TechnicalArticlesVO> ranking(){
|
|
|
- return technical.articlesRanking();
|
|
|
+ Pageable getRanking(SearchConditionVO searchConditionVO){
|
|
|
+ int activePage = searchConditionVO.getActivePage() == 0?1:searchConditionVO.getActivePage();
|
|
|
+ Sort sort = new Sort(Sort.Direction.DESC,"reading");
|
|
|
+ return new PageRequest(activePage-1, CommonConstant.DEFAULT_ROWS_ON_PAGE, sort);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @RequestMapping(value = "/ranking", method = RequestMethod.POST)
|
|
|
+ public ResponseVO<TechnicalArticlesDTO> ranking(@RequestBody SearchConditionVO searchConditionVO){
|
|
|
+ Pageable pageable = this.getRanking(searchConditionVO);
|
|
|
+ String keyword = searchConditionVO.getKeyword();
|
|
|
+ return new ResponseVO<>(ServerCode.SUCCESS, technical.articlesRanking(pageable,keyword));
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/updateranking/{id:\\d+}", method = RequestMethod.GET)
|