|
@@ -8,12 +8,15 @@ import com.mooctest.crowd.site.data.vo.SearchConditionVO;
|
|
import com.mooctest.crowd.site.data.vo.TechnicalArticlesVO;
|
|
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.PageRequest;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Sort;
|
|
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.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -22,16 +25,22 @@ import java.util.List;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/api/technical")
|
|
@RequestMapping("/api/technical")
|
|
-public class TechnicalArticlesController {
|
|
|
|
|
|
+public class TechnicalArticlesController extends BaseSearchController{
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private TechnicalArticlesService technical;
|
|
private TechnicalArticlesService technical;
|
|
|
|
|
|
@RequestMapping(value = "/articles", method = RequestMethod.POST)
|
|
@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);
|
|
Pageable pageable = this.getPageable(searchConditionVO);
|
|
String keyword = searchConditionVO.getKeyword();
|
|
String keyword = searchConditionVO.getKeyword();
|
|
- return new ResponseVO<>(ServerCode.SUCCESS, technical.getArticles(pageable, keyword));
|
|
|
|
|
|
+ return new ResponseVO<>(ServerCode.SUCCESS, technical.getArticles(pageable, keyword,extraCondition));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Page<?> search(String searchCondition) {
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
Pageable getPageable(SearchConditionVO searchConditionVO){
|
|
Pageable getPageable(SearchConditionVO searchConditionVO){
|