Commit 0cf8c609 by lenx065@gmail.com

关注

parent 6cf85669
......@@ -119,7 +119,7 @@ public class MatchServiceImpl implements MatchService {
if (StringUtils.isNotBlank(commonStringId.getSportsId())) {
wrapper.eq("sports_id", commonStringId.getSportsId());
}
if(StringUtils.isNotBlank(commonStringId.getMatchTime())){
if (StringUtils.isNotBlank(commonStringId.getMatchTime())) {
wrapper.ge("match_time", commonStringId.getMatchTime() + " 00:00:00");
wrapper.le("match_time", commonStringId.getSportsId() + " 23:59:59");
}
......@@ -363,6 +363,11 @@ public class MatchServiceImpl implements MatchService {
.eq(User::getPhone, userPhone)
);
long count = userReserveMapper.selectCount(Wrappers.<UserReserve>lambdaQuery()
.eq(UserReserve::getUserId, account.getId())
.eq(UserReserve::getDeleted, 0)
);
List<UserReserve> userReserves = userReserveMapper.selectList(Wrappers.<UserReserve>lambdaQuery()
.eq(UserReserve::getUserId, account.getId())
.eq(UserReserve::getDeleted, 0)
......@@ -371,12 +376,40 @@ public class MatchServiceImpl implements MatchService {
List<Match> matches = new ArrayList<>();
if (userReserves.size() > 0) {
matches = matchMapper.selectBatchIds(userReserves.stream().map(UserReserve::getMatchId).collect(Collectors.toSet()));
matches = matchMapper.selectList(Wrappers.<Match>lambdaQuery()
.in(Match::getId, userReserves.stream().map(UserReserve::getMatchId).collect(Collectors.toSet()))
.eq(Match::getDeleted, 0)
.orderByDesc(Match::getMatchTime)
);
}
MatchListResponse result = conversionByList(matches, true);
result.getMatchLists().forEach(b -> b.getMatchInfos().forEach(c -> c.setSubscribe(true)));
return ResponseData.successResponse(result);
MatchHomeListByDayResponse response = new MatchHomeListByDayResponse();
for (Match match : matches) {
MatchHomeListByDayResponse.MatchInfo matchInfo = new MatchHomeListByDayResponse.MatchInfo();
matchInfo.setSubscribed(true);
Team home = teamMapper.selectById(match.getHomeId());
Team away = teamMapper.selectById(match.getAwayId());
Sports sports = sportsMapper.selectById(match.getSportsId());
matchInfo.setMatchShortName(match.getCompetitionShortName());
matchInfo.setAway(MatchListInfo.builder()
.teamName(away.getTeamName())
.teamLogo(away.getTeamIcon())
.score(match.getAwayScore())
.build());
matchInfo.setHome(MatchListInfo.builder()
.teamName(home.getTeamName())
.teamLogo(home.getTeamIcon())
.score(match.getHomeScore())
.build());
matchInfo.setMatchTime(DateUtil.format(match.getMatchTime(), DateUtil.HM_));
matchInfo.setSportsType(sports.getSportsId());
response.getMatchInfos().add(matchInfo);
}
return ResponseData.successResponse(new ResultPage<>(commonPage.getPageNum(), commonPage.getPageSize(), (int) count, response));
}
@Override
......
......@@ -47,18 +47,18 @@ public class UserController {
return userService.register(registerRequest, request);
}
@PostMapping(value = "/userInfoByIds")
@ApiOperation(value = "根据用户id获取用户信息", notes = "根据用户id获取用户信息")
@ApiResponses({
@ApiResponse(code = 200, message = "成功处理请求"),
@ApiResponse(code = 401, message = "没有权限访问该服务"),
@ApiResponse(code = 403, message = "权限不足无法访问该服务"),
@ApiResponse(code = 404, message = "未发现该服务"),
@ApiResponse(code = 500, message = "服务器内部错误")
})
public ResponseData<?> userInfoById(@RequestBody UserInfoByIdRequest ids,HttpServletRequest request) {
return userService.userInfoById(ids, request);
}
// @PostMapping(value = "/userInfoByIds")
// @ApiOperation(value = "根据用户id获取用户信息", notes = "根据用户id获取用户信息")
// @ApiResponses({
// @ApiResponse(code = 200, message = "成功处理请求"),
// @ApiResponse(code = 401, message = "没有权限访问该服务"),
// @ApiResponse(code = 403, message = "权限不足无法访问该服务"),
// @ApiResponse(code = 404, message = "未发现该服务"),
// @ApiResponse(code = 500, message = "服务器内部错误")
// })
// public ResponseData<?> userInfoById(@RequestBody UserInfoByIdRequest ids,HttpServletRequest request) {
// return userService.userInfoById(ids, request);
// }
// @PostMapping(value = "/registerByPc")
// @ApiOperation(value = "PC 版 用户手机号注册")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment