Commit 6cf85669 by lenx065@gmail.com

赛事类型

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