|
|
@@ -1,5 +1,6 @@
|
|
|
package cn.seecoder.seecoderbokserver.web.rest;
|
|
|
|
|
|
+import apple.laf.JRSUIConstants;
|
|
|
import cn.seecoder.bok.common.QuestionState;
|
|
|
import cn.seecoder.bok.common.QuestionType;
|
|
|
import cn.seecoder.bok.common.UserRole;
|
|
|
@@ -14,10 +15,12 @@ import cn.seecoder.seecoderbokserver.service.QuestionService;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.constraints.NotBlank;
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -69,7 +72,9 @@ public class QuestionController implements SeecoderBokQuestionApi, SeecoderBokQu
|
|
|
public Response getTargetQuestionList(
|
|
|
@RequestParam(name = "offset", required = false) int offset,
|
|
|
@RequestParam(name = "pageSize", required = false) int pageSize) {
|
|
|
- Pageable pageable = PageRequest.of(offset, pageSize);
|
|
|
+ Sort sort = Sort.by("_id"); //添加sort排序,按照es中的id排序
|
|
|
+ Pageable pageable = PageRequest.of(offset, pageSize, sort);
|
|
|
+
|
|
|
return Response.buildSuccess(questionService.find(null, null, null, null, null, pageable)
|
|
|
.map(questionMapper::questionToQuestionVO));
|
|
|
}
|