|
|
@@ -48,7 +48,7 @@ public class LuckyDrawFrontController {
|
|
|
* 奖品列表
|
|
|
*/
|
|
|
@GetMapping("/get")
|
|
|
- public Result<List<LuckyDrawView>> getLuckyDraw() throws Exception {
|
|
|
+ public Result<List<LuckyDrawView>> getLuckyDraw(@RequestParam(defaultValue = "true") Boolean isRepeat) throws Exception {
|
|
|
List<LuckyDrawView> drawViews = beanSearcher.searchAll(LuckyDrawView.class, MapUtils.builder()
|
|
|
.field(LuckyDrawView::getStatus, true).op(Operator.Equal).build());
|
|
|
if (drawViews.isEmpty()) {
|
|
|
@@ -62,6 +62,9 @@ public class LuckyDrawFrontController {
|
|
|
BeanUtils.copyProperties(drawView, view);
|
|
|
view.setPosition(i.toString());
|
|
|
re.add(view);
|
|
|
+ if (!isRepeat) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
re = re.stream().sorted(Comparator.comparing(LuckyDrawView::getPosition)).collect(Collectors.toList());
|