Commit 6cf85669 by lenx065@gmail.com

赛事类型

parent c810434a
......@@ -21,7 +21,9 @@ public class MatchHomeListByDayResponse {
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class MatchInfo{
public static class MatchInfo {
// 0足球 1篮球
private Integer sportsType;
private String matchShortName;
private String matchTime;
private MatchListInfo home;
......
......@@ -26,7 +26,7 @@ public interface MatchService {
ResponseData<?> userCancelReserveMatch(CommonStringId commonStringId, HttpServletRequest request);
ResponseData<?> userGetReserveMatch(HttpServletRequest request);
ResponseData<?> userGetReserveMatch(CommonPage commonPage, HttpServletRequest request);
ResponseData<?> userGetAnchorList(HttpServletRequest request);
......
......@@ -119,6 +119,10 @@ public class MatchServiceImpl implements MatchService {
if (StringUtils.isNotBlank(commonStringId.getSportsId())) {
wrapper.eq("sports_id", commonStringId.getSportsId());
}
if(StringUtils.isNotBlank(commonStringId.getMatchTime())){
wrapper.ge("match_time", commonStringId.getMatchTime() + " 00:00:00");
wrapper.le("match_time", commonStringId.getSportsId() + " 23:59:59");
}
//-1 全部 0 展示正在进行 和 未开始 1 正在进行 2未开始 3完场
//1正在进行 2未开始 3完场 4 未知
......@@ -179,6 +183,7 @@ public class MatchServiceImpl implements MatchService {
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()
......@@ -192,6 +197,7 @@ public class MatchServiceImpl implements MatchService {
.score(match.getHomeScore())
.build());
matchInfo.setMatchTime(DateUtil.format(match.getMatchTime(), DateUtil.HM_));
matchInfo.setSportsType(sports.getSportsId());
response.getMatchInfos().add(matchInfo);
}
......@@ -349,7 +355,9 @@ public class MatchServiceImpl implements MatchService {
}
@Override
public ResponseData<?> userGetReserveMatch(HttpServletRequest request) {
public ResponseData<?> userGetReserveMatch(CommonPage commonPage, HttpServletRequest request) {
int jumpNum = (commonPage.getPageNum() - 1) * commonPage.getPageSize();
String userPhone = CommonMethod.getUserPhone(request);
User account = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getPhone, userPhone)
......@@ -358,6 +366,7 @@ public class MatchServiceImpl implements MatchService {
List<UserReserve> userReserves = userReserveMapper.selectList(Wrappers.<UserReserve>lambdaQuery()
.eq(UserReserve::getUserId, account.getId())
.eq(UserReserve::getDeleted, 0)
.last(String.format(" limit %s,%s", jumpNum, commonPage.getPageSize()))
);
List<Match> matches = new ArrayList<>();
......@@ -2225,12 +2234,6 @@ public class MatchServiceImpl implements MatchService {
* @return
*/
private MatchListResponse.MatchInfoResponse conversionMatchInfo(Match match, Integer sportsType, Team awayTeam, Team homeTeam, boolean otherAnchors) {
List<MatchListResponse.GuideResponse> guideResponseList = new ArrayList<>();
if (otherAnchors) {
guideResponseList = guidesByMatchId(match.getId());
}
return MatchListResponse.MatchInfoResponse.builder()
.id(match.getId())
.matchName(match.getCompetitionName())
......@@ -2254,7 +2257,6 @@ public class MatchServiceImpl implements MatchService {
.build())
.homeScore(match.getHomeScore())
.awayScore(match.getAwayScore())
.guides(guideResponseList)
.build();
}
......
......@@ -153,57 +153,57 @@ public class MatchController {
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "登录凭证(登录后 token 值)", dataType = "String", paramType = "header", required = true)
})
public ResponseData<?> userGetReserveMatch(HttpServletRequest request) {
return matchService.userGetReserveMatch(request);
public ResponseData<?> userGetReserveMatch(@RequestBody CommonPage commonPage,HttpServletRequest request) {
return matchService.userGetReserveMatch(commonPage, request);
}
@PostMapping(value = "/userFollowAnchor")
@ApiOperation(value = "用户关注主播 房间ID")
@ApiResponses({
@ApiResponse(code = 200, message = "成功处理请求"),
@ApiResponse(code = 401, message = "没有权限访问该服务"),
@ApiResponse(code = 403, message = "权限不足无法访问该服务"),
@ApiResponse(code = 404, message = "未发现该服务"),
@ApiResponse(code = 500, message = "服务器内部错误")
})
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "登录凭证(登录后 token 值)", dataType = "String", paramType = "header", required = true)
})
public ResponseData<?> userFollowAnchor(@RequestBody CommonStringId commonIntId, HttpServletRequest request) {
return matchService.userFollowAnchor(commonIntId, request);
}
@PostMapping(value = "/userUnFollowAnchor")
@ApiOperation(value = "用户取消关注 房间ID")
@ApiResponses({
@ApiResponse(code = 200, message = "成功处理请求"),
@ApiResponse(code = 401, message = "没有权限访问该服务"),
@ApiResponse(code = 403, message = "权限不足无法访问该服务"),
@ApiResponse(code = 404, message = "未发现该服务"),
@ApiResponse(code = 500, message = "服务器内部错误")
})
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "登录凭证(登录后 token 值)", dataType = "String", paramType = "header", required = true)
})
public ResponseData<?> userUnFollowAnchor(@RequestBody CommonStringId commonIntId, HttpServletRequest request) {
return matchService.userUnFollowAnchor(commonIntId, request);
}
@PostMapping(value = "/userGetAnchorList")
@ApiOperation(value = "获取用户关注的主播列表")
@ApiResponses({
@ApiResponse(code = 200, message = "成功处理请求"),
@ApiResponse(code = 401, message = "没有权限访问该服务"),
@ApiResponse(code = 403, message = "权限不足无法访问该服务"),
@ApiResponse(code = 404, message = "未发现该服务"),
@ApiResponse(code = 500, message = "服务器内部错误")
})
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "登录凭证(登录后 token 值)", dataType = "String", paramType = "header", required = true)
})
public ResponseData<?> userGetAnchorList(HttpServletRequest request) {
return matchService.userGetAnchorList(request);
}
// @PostMapping(value = "/userFollowAnchor")
// @ApiOperation(value = "用户关注主播 房间ID")
// @ApiResponses({
// @ApiResponse(code = 200, message = "成功处理请求"),
// @ApiResponse(code = 401, message = "没有权限访问该服务"),
// @ApiResponse(code = 403, message = "权限不足无法访问该服务"),
// @ApiResponse(code = 404, message = "未发现该服务"),
// @ApiResponse(code = 500, message = "服务器内部错误")
// })
// @ApiImplicitParams({
// @ApiImplicitParam(name = "token", value = "登录凭证(登录后 token 值)", dataType = "String", paramType = "header", required = true)
// })
// public ResponseData<?> userFollowAnchor(@RequestBody CommonStringId commonIntId, HttpServletRequest request) {
// return matchService.userFollowAnchor(commonIntId, request);
// }
//
// @PostMapping(value = "/userUnFollowAnchor")
// @ApiOperation(value = "用户取消关注 房间ID")
// @ApiResponses({
// @ApiResponse(code = 200, message = "成功处理请求"),
// @ApiResponse(code = 401, message = "没有权限访问该服务"),
// @ApiResponse(code = 403, message = "权限不足无法访问该服务"),
// @ApiResponse(code = 404, message = "未发现该服务"),
// @ApiResponse(code = 500, message = "服务器内部错误")
// })
// @ApiImplicitParams({
// @ApiImplicitParam(name = "token", value = "登录凭证(登录后 token 值)", dataType = "String", paramType = "header", required = true)
// })
// public ResponseData<?> userUnFollowAnchor(@RequestBody CommonStringId commonIntId, HttpServletRequest request) {
// return matchService.userUnFollowAnchor(commonIntId, request);
// }
//
// @PostMapping(value = "/userGetAnchorList")
// @ApiOperation(value = "获取用户关注的主播列表")
// @ApiResponses({
// @ApiResponse(code = 200, message = "成功处理请求"),
// @ApiResponse(code = 401, message = "没有权限访问该服务"),
// @ApiResponse(code = 403, message = "权限不足无法访问该服务"),
// @ApiResponse(code = 404, message = "未发现该服务"),
// @ApiResponse(code = 500, message = "服务器内部错误")
// })
// @ApiImplicitParams({
// @ApiImplicitParam(name = "token", value = "登录凭证(登录后 token 值)", dataType = "String", paramType = "header", required = true)
// })
// public ResponseData<?> userGetAnchorList(HttpServletRequest request) {
// return matchService.userGetAnchorList(request);
// }
@PostMapping(value = "/matchInfoBasketball")
@ApiOperation(value = "根据ID获取赛事详情 篮球 接口")
......
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