| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.communityWorldCup.entity.WorldCup; |
| | | import com.dsh.communityWorldCup.entity.WorldCupCompetitor; |
| | | import com.dsh.communityWorldCup.entity.WorldCupPaymentParticipant; |
| | | import com.dsh.communityWorldCup.entity.WorldCupStore; |
| | | import com.dsh.communityWorldCup.feignclient.account.AppUserClient; |
| | |
| | | @ApiOperation(value = "获取世界杯详情【2.0】", tags = {"APP-社区世界杯"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "世界杯id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "lon", value = "经度", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "lat", value = "纬度", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<WorldCupInfo> getWorldCupInfo(@RequestBody Integer id){ |
| | | WorldCupInfo worldCupInfo = worldCupService.getWorldCupInfo(id); |
| | | public ResultUtil<WorldCupInfo> getWorldCupInfo(@RequestBody Integer id, @RequestBody String lon, @RequestBody String lat){ |
| | | WorldCupInfo worldCupInfo = worldCupService.getWorldCupInfo(id, lon, lat); |
| | | return ResultUtil.success(worldCupInfo); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @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(); |
| | | } |
| | | } |
| | | |
| | | // public ResultUtil<MyWorldCupInfo> getMyWorldCupInfo(@RequestBody String id){ |
| | | // |
| | | // } |
| | | |
| | | |
| | | |
| | | @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(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); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取学员参与数量 |
| | | * @param studentId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/worldCup/count") |
| | | public Integer count(@RequestBody Integer studentId){ |
| | | return worldCupCompetitorService.count(new QueryWrapper<WorldCupCompetitor>() |
| | | .eq("participantId", studentId).eq("participantType", 1)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取学员世界杯胜利次数 |
| | | * @param studentId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/worldCup/winCount") |
| | | public Integer winCount(@RequestBody Integer studentId){ |
| | | return worldCupCompetitorService.count(new QueryWrapper<WorldCupCompetitor>() |
| | | .eq("participantId", studentId).eq("participantType", 1).eq("matchResult", 1)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取比赛管理列表数据 |
| | | * @param worldCupListAll |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/worldCup/getWorldCupListAll") |
| | | public Map<String, Object> getWorldCupListAll(@RequestBody WorldCupListAll worldCupListAll){ |
| | | return worldCupService.getWorldCupListAll(worldCupListAll); |
| | | } |
| | | } |