|
@@ -5,7 +5,6 @@ import com.mooctest.crowd.site.data.dto.TechnicalArticlesDTO;
|
|
import com.mooctest.crowd.site.data.response.ResponseVO;
|
|
import com.mooctest.crowd.site.data.response.ResponseVO;
|
|
import com.mooctest.crowd.site.data.response.ServerCode;
|
|
import com.mooctest.crowd.site.data.response.ServerCode;
|
|
import com.mooctest.crowd.site.data.vo.SearchConditionVO;
|
|
import com.mooctest.crowd.site.data.vo.SearchConditionVO;
|
|
-import com.mooctest.crowd.site.data.vo.TechnicalArticlesVO;
|
|
|
|
import com.mooctest.crowd.site.service.TechnicalArticlesService;
|
|
import com.mooctest.crowd.site.service.TechnicalArticlesService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
@@ -15,7 +14,6 @@ import org.springframework.data.domain.Sort;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
-import java.util.List;
|
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@@ -49,18 +47,15 @@ public class TechnicalArticlesController extends BaseSearchController{
|
|
return new PageRequest(activePage-1, CommonConstant.DEFAULT_ROWS_ON_PAGE, sort);
|
|
return new PageRequest(activePage-1, CommonConstant.DEFAULT_ROWS_ON_PAGE, sort);
|
|
}
|
|
}
|
|
|
|
|
|
- Pageable getRanking(SearchConditionVO searchConditionVO){
|
|
|
|
- int activePage = searchConditionVO.getActivePage() == 0?1:searchConditionVO.getActivePage();
|
|
|
|
|
|
+ Pageable getRanking(){
|
|
Sort sort = new Sort(Sort.Direction.DESC,"reading");
|
|
Sort sort = new Sort(Sort.Direction.DESC,"reading");
|
|
- return new PageRequest(activePage-1, CommonConstant.DEFAULT_ROWS_ON_PAGE, sort);
|
|
|
|
|
|
+ return new PageRequest(0,10,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 = "/ranking", method = RequestMethod.GET)
|
|
|
|
+ public ResponseVO<TechnicalArticlesDTO> ranking(){
|
|
|
|
+ Pageable pageable = this.getRanking();
|
|
|
|
+ return new ResponseVO<>(ServerCode.SUCCESS, technical.articlesRanking(pageable));
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/updateranking/{id:\\d+}", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/updateranking/{id:\\d+}", method = RequestMethod.GET)
|