From edb2fff00f6990217f7c39ebc2adb611a1c60478 Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期六, 28 十月 2023 11:21:57 +0800 Subject: [PATCH] 10.28 --- cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java b/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java index 28e64f0..5d483c2 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java @@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; import java.util.List; @@ -59,15 +60,27 @@ @PostMapping("/api/participant/queryParticipantList") @ApiOperation(value = "获取参赛人员列表", tags = {"APP-赛事活动列表", ""}) @ApiImplicitParams({ - @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), + @ApiImplicitParam(value = "isPre(1过滤)", name = "是否过滤未实名", required = true, dataType = "int") }) - public ResultUtil<List<ParticipantVo>> queryParticipantList(){ + public ResultUtil<List<ParticipantVo>> queryParticipantList(Integer isPre){ try { Integer uid = tokenUtil.getUserIdFormRedis(); if(null == uid){ return ResultUtil.tokenErr(); } List<ParticipantVo> participantVos = participantService.queryParticipantList(uid); + if (isPre!=null){ + List<ParticipantVo> filteredParticipants = new ArrayList<>(); + + for (ParticipantVo participant : participantVos) { + if (participant.getIdcard() != null && !participant.getIdcard().isEmpty()) { + filteredParticipants.add(participant); + } + } + return ResultUtil.success(filteredParticipants); + } + return ResultUtil.success(participantVos); }catch (Exception e){ e.printStackTrace(); -- Gitblit v1.7.1