| | |
| | | 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; |
| | |
| | | @ApiImplicitParam(name = "code", value = "扫码结果", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<Map<String, String>> getDeviceInformation(@RequestBody String code){ |
| | | public ResultUtil<Map<String, String>> getDeviceInformation(String code){ |
| | | /** |
| | | * { |
| | | * "scan_type": 0, // 扫码类型:1000:游戏,1001:课程,1002:场地 |
| | |
| | | @ApiImplicitParam(name = "id", value = "世界杯id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<WorldCupInfo> getWorldCupInfo(@RequestBody Integer id){ |
| | | public ResultUtil<WorldCupInfo> getWorldCupInfo(Integer id){ |
| | | WorldCupInfo worldCupInfo = worldCupService.getWorldCupInfo(id); |
| | | return ResultUtil.success(worldCupInfo); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/worldCup/getWorldCupStoreList") |
| | | public List<WorldCupStore> getWorldCupStoreList(@RequestBody Integer storeId){ |
| | | public List<WorldCupStore> getWorldCupStoreList(Integer storeId){ |
| | | List<WorldCup> worldCupList = worldCupService.list(new QueryWrapper<WorldCup>().in("status", Arrays.asList(1, 2))); |
| | | 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/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(Integer studentId){ |
| | | return worldCupCompetitorService.count(new QueryWrapper<WorldCupCompetitor>() |
| | | .eq("participantId", studentId).eq("participantType", 1).eq("matchResult", 1)); |
| | | } |
| | | } |