Commit 88a2d4dc authored by liming's avatar liming

服务端拉取系列赛比赛信息接口

parent 61e9dfbf
......@@ -100,5 +100,11 @@ public class SeriesController {
return success(seriesService.seriesKnockoutMatchRecordInit(dto));
}
@ApiOperation("19.游戏服务端加载未完成比赛使用")
@PostMapping("match/for/server")
public ResponseEntity<Result<List<SeriesMatchForGameServerVO>>> getSeriesMatchForGameServer() {
return success(seriesService.getSeriesMatchForGameServer());
}
}
......@@ -56,4 +56,8 @@ public interface SeriesBusinessMapper {
IPage<SeriesKnockoutMatchRankVO> getSeriesKnockoutMatchRankList(IPage<SeriesKnockoutMatchRankVO> page,
@Param("matchId") Long matchId);
List<SeriesForGameServerVO> getSeriesForGameServer();
List<SeriesMatchForGameServerVO> getSeriesMatchForGameServer(@Param("now") LocalDateTime now);
}
......@@ -353,4 +353,8 @@ public class SeriesService {
return result;
}
public List<SeriesMatchForGameServerVO> getSeriesMatchForGameServer(){
return seriesBusinessMapper.getSeriesMatchForGameServer(LocalDateTime.now());
}
}
package com.antai.sport.http.server.server.api.business.series.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("系列赛")
public class SeriesForGameServerVO {
@ApiModelProperty("系列id")
private Long id;
@ApiModelProperty("系列名称")
private String name;
@ApiModelProperty("系列比赛列表")
private List<SeriesMatchForGameServerVO> matchList;
}
package com.antai.sport.http.server.server.api.business.series.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
@ApiModel("系列赛比赛VO")
public class SeriesMatchForGameServerVO {
@ApiModelProperty("比赛id")
public Long id;
@ApiModelProperty("比赛名称")
public String name;
@ApiModelProperty("地图")
private String map;
@ApiModelProperty("赛道")
private String path;
@ApiModelProperty("允许进入时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime entryTime;
@ApiModelProperty("开始比赛时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime startTime;
@ApiModelProperty("比赛结束时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime endTime;
@ApiModelProperty("长度")
private BigDecimal distance;
@ApiModelProperty("爬坡高度")
private BigDecimal climbDistance;
@ApiModelProperty("赛事描述")
private String description;
}
......@@ -160,6 +160,21 @@
left join sport_user_training_log t3 on t3.game_mode = 20 and t1.id = t3.record_id
where t1.match_id = #{matchId}
</select>
<select id="getSeriesForGameServer"
resultType="com.antai.sport.http.server.server.api.business.series.vo.SeriesForGameServerVO">
select id,name from series where deleted = 0 and status = 20 and finished = 0
</select>
<select id="getSeriesMatchForGameServer"
resultType="com.antai.sport.http.server.server.api.business.series.vo.SeriesMatchForGameServerVO">
select *
from series_match t1
where t1.end_time &gt; #{now}
and t1.deleted = 0
and t1.status = 20
order by t1.show_order,t1.start_time
</select>
</mapper>
\ No newline at end of file
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