From d4c615789901fc5e1b828011d19983d2800184b7 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 29 二月 2024 16:20:49 +0800 Subject: [PATCH] 添加世界杯列表距离排序 --- cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 99 insertions(+), 0 deletions(-) diff --git a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java index 076f753..da81fe4 100644 --- a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java +++ b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java @@ -17,6 +17,7 @@ import com.dsh.communityWorldCup.feignclient.other.model.Site; import com.dsh.communityWorldCup.feignclient.other.model.Store; import com.dsh.communityWorldCup.model.*; +import com.dsh.communityWorldCup.service.IWorldCupCompetitorService; import com.dsh.communityWorldCup.service.IWorldCupPaymentParticipantService; import com.dsh.communityWorldCup.service.IWorldCupService; import com.dsh.communityWorldCup.service.IWorldCupStoreService; @@ -83,6 +84,9 @@ @Autowired private IWorldCupStoreService worldCupStoreService; + + @Autowired + private IWorldCupCompetitorService worldCupCompetitorService; @@ -384,4 +388,99 @@ List<Integer> collect = worldCupList.stream().map(WorldCup::getId).collect(Collectors.toList()); return worldCupStoreService.list(new QueryWrapper<WorldCupStore>().eq("storeId", storeId).in("worldCupId", collect)); } + + + + + @ResponseBody + @PostMapping("/api/worldCup/getEntrantRank") + @ApiOperation(value = "获取世界杯排名【2.0】", tags = {"APP-个人中心"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResultUtil<EntrantRankVo> getEntrantRank(EntrantRank entrantRank){ + EntrantRankVo entrantRank1 = worldCupCompetitorService.getEntrantRank(entrantRank); + return ResultUtil.success(entrantRank1); + } + + + + + @ResponseBody + @PostMapping("/api/worldCup/getMyWorldCupList") + @ApiOperation(value = "获取报名的世界杯列表【2.0】", tags = {"APP-个人中心"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResultUtil<List<WorldCupListVo>> getMyWorldCupList(MyWorldCupList myWorldCupList){ + List<WorldCupListVo> myWorldCupList1 = worldCupPaymentParticipantService.getMyWorldCupList(myWorldCupList); + return ResultUtil.success(myWorldCupList1); + } + + + @ResponseBody + @PostMapping("/api/worldCup/getParticipant") + @ApiOperation(value = "获取已报名的参赛人员【2.0】", tags = {"APP-个人中心"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResultUtil<List<ParticipantVo>> getParticipant(){ + try { + Integer uid = tokenUtil.getUserIdFormRedis(); + if(null == uid){ + return ResultUtil.tokenErr(); + } + List<ParticipantVo> participant = worldCupPaymentParticipantService.getParticipant(uid); + return ResultUtil.success(participant); + }catch (Exception e){ + e.printStackTrace(); + return ResultUtil.runErr(); + } + } + + + + + @ResponseBody + @PostMapping("/api/worldCup/getMyWorldCupInfo") + @ApiOperation(value = "获取已报名世界杯详情【2.0】", tags = {"APP-个人中心"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "列表中的id", required = true, dataType = "String"), + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResultUtil<MyWorldCupInfo> getMyWorldCupInfo(@RequestBody String id){ + MyWorldCupInfo myWorldCupInfo = worldCupPaymentParticipantService.getMyWorldCupInfo(id); + return ResultUtil.success(myWorldCupInfo); + } + + + + + @ResponseBody + @PostMapping("/api/worldCup/getWorldCupMatchRecord") + @ApiOperation(value = "获取比赛记录【2.0】", tags = {"APP-个人中心"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResultUtil<MatchRecordVo> getWorldCupMatchRecord(MatchRecord matchRecord){ + MatchRecordVo matchRecord1 = worldCupCompetitorService.getMatchRecord(matchRecord); + return ResultUtil.success(matchRecord1); + } + + + + @ResponseBody + @PostMapping("/api/worldCup/getWorldCupRank") + @ApiOperation(value = "获取比赛排名【2.0】", tags = {"APP-个人中心"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResultUtil<List<WorldCupRankVo>> getWorldCupRank(WorldCupRank worldCupRank){ + List<WorldCupRankVo> worldCupRank1 = worldCupCompetitorService.getWorldCupRank(worldCupRank); + return ResultUtil.success(worldCupRank1); + } + + + + } -- Gitblit v1.7.1