@JeromeLiee
2019-04-28T17:08:10.000000Z
字数 6009
阅读 501
用于展示直播中心对抗赛的比赛信息,分为赛前、赛中、赛后三种状态
/matchInfo
字段 | 名称 | 类型 | 是否可为空 | 备注 |
---|---|---|---|---|
status | 比赛状态 | Integer | 否 | 0,1,2 分别表示赛前、赛中、赛后 |
matchId | 比赛Id | Long | 否 | |
eventNum | 返回的事件数量 | Integer | 可 | 默认为6,即最新的6条事件(配合status=1时使用) |
eventType | 返回的事件类型 | String | 可 | 默认为"1,2,3,12,4,5,6,7,9" (配合status=1时使用) 详见附1比赛事件值列表 |
flag | 比赛数据类型 | String | 可 | 默认为"7,11,4,1,10,14" (配合status=2时使用) 详见附2比赛数据类型对应表 |
{
"code": 0,
"msg": "Success",
"data": {
"info": {
"homeTeamName": "霍芬海姆",
"homeTeamLogo": "http://image.suning.cn/uimg/SDSP/team/285.png?v=1498717894170",
"homeTeamId": 285,
"homeTeamScore": 1,
"guestTeamName": "勒沃库森",
"guestTeamLogo": "http://image.suning.cn/uimg/SDSP/team/288.png?v=1498717892874",
"guestTeamId": 288,
"guestTeamScore": 2,
"matchAreaName": "本特戈蒂球场",
"playDuration": 39
},
"beforeData": {
"homeLastFiveMatch": {
"win": 1,
"draw": 1,
"lose": 3
},
"guestLastFiveMatch": {
"win": 1,
"draw": 1,
"lose": 3
},
"pkData": {
"draw": 0,
"guestTeamId": "137",
"homeTeamId": "133",
"lose": 4,
"win": 1
},
"homeRank": "13",
"guestRank": "10",
"homeGoalsName":"乔纳森",
"guestGoalsName":"扎哈维"
},
"liveEvent": [
{
"eventTimeMinSec": "2:46",
"eventPlayerName": "鲁文·佩雷斯",
"relatePlayerName": "",
"relatePlayerId": "",
"teamFlg": "1",
"eventTimeStamp": "1551729831",
"eventPlayerNum": "21",
"eventTimeExtra": "0",
"teamId": "231",
"externalId": "1382575",
"eventPlayerId": "5162",
"relatePlayerNum": "",
"halfCode": "1",
"event": "22",
"sec": "46",
"updateDttm": "2019-03-05 06:58:56",
"eventName": "犯规",
"eventTime": "3"
},
{
"eventTimeMinSec": "3:36",
"eventPlayerName": "维佐",
"relatePlayerName": "",
"relatePlayerId": "",
"teamFlg": "2",
"eventTimeStamp": "1551729880",
"eventPlayerNum": "14",
"eventTimeExtra": "0",
"teamId": "1216",
"externalId": "1382593",
"eventPlayerId": "4739",
"relatePlayerNum": "",
"halfCode": "1",
"event": "26",
"sec": "36",
"updateDttm": "2019-03-05 06:58:57",
"eventName": "抢断成功",
"eventTime": "4"
}
],
"scoreAnalysis": [
{
"homeData": 43,
"guestData": 57,
"homeAverageData": 42,
"guestAverageData": 52,
"title": "控球率",
"flag": 1
},
{
"homeData": 1,
"guestData": 2,
"homeAverageData": 2,
"guestAverageData": 2,
"title": "进球",
"flag": 2
},
{
"homeData": 110,
"guestData": 120,
"homeAverageData": 142,
"guestAverageData": 152,
"title": "传球",
"flag": 9
}
]
}
}
比赛基础信息,该接口涉及到的中台接口mock地址为比赛基础信息
"info": {
"homeTeamName": "霍芬海姆",
"homeTeamLogo": "http://image.suning.cn/uimg/SDSP/team/285.png?v=1498717894170",
"homeTeamId": 285,
"homeTeamScore": 1,
"guestTeamName": "勒沃库森",
"guestTeamLogo": "http://image.suning.cn/uimg/SDSP/team/288.png?v=1498717892874",
"guestTeamId": 288,
"guestTeamScore": 2,
"matchAreaName": "本特戈蒂球场",
"playDuration": 39
}
字段 | 名称 | 类型 | 对应中台接口的字段名称 |
---|---|---|---|
homeTeamName | 主队名称 | String | homeTeamName |
homeTeamLogo | 主队logo | String | homeTeamLogo |
homeTeamId | 主队id | Long | homeTeamId |
homeTeamScore | 主队比分 | Long | homeTeamScore |
guestTeamName | 客队名称 | String | guestTeamName |
guestTeamLogo | 客队logo | String | guestTeamLogo |
guestTeamId | 客队id | Long | guestTeamId |
guestTeamScore | 客队比分 | Long | guestTeamScore |
matchAreaName | 球场 | String | matchVenue对象中的areaNameCn字段(文档中未添加) |
playDuration | 比赛进度 | Long | 通过matchExtraInfo对象获取(文档中未添加) 详见附3数据JOSN及获取进度 |
近5场数据及pk数据,涉及到的中台接口mock地址为历史5场数据和球员统计
"beforeData": {
"homeLastFiveMatch": {
"win": 1,
"draw": 1,
"lose": 3
},
"guestLastFiveMatch": {
"win": 1,
"draw": 1,
"lose": 3
},
"pkData": {
"draw": 0,
"guestTeamId": 137,
"homeTeamId": 133,
"lose": 4,
"win": 1
},
"homeRank": 13,
"guestRank": 10,
"homeGoalsName":"乔纳森",
"guestGoalsName:":"扎哈维"
}
比赛事件数据,中台mock地址为比赛事件,eventList集合。
{
"eventTimeMinSec": "2:46",
"eventPlayerName": "鲁文·佩雷斯",
"relatePlayerName": "",
"relatePlayerId": "",
"teamFlg": "1",
"eventTimeStamp": "1551729831",
"eventPlayerNum": "21",
"eventTimeExtra": "0",
"teamId": "231",
"externalId": "1382575",
"eventPlayerId": "5162",
"relatePlayerNum": "",
"halfCode": "1",
"event": "22",
"sec": "46",
"updateDttm": "2019-03-05 06:58:56",
"eventName": "犯规",
"eventTime": "3"
}
赛后数据统计,该接口涉及到的中台接口mock地址为本场数据和场均数据,具体见
{
"homeData": "43",
"guestData": "57",
"homeAverageData": "42",
"guestAverageData": "52",
"title": "控球率",
"flag": "1"
}
字段 | 名称 | 类型 | 对应本场数据中台字段 | 对应场均数据中台字段 |
---|---|---|---|---|
homeData | 主队数值 | String | 需要根据flag来判断 | 无 |
guestData | 客队数值 | String | 需要根据flag来判断 | 无 |
homeAverageData | 主队平均数值 | String | 无 | 需要根据flag来判断 |
guestAverageData | 客队平均数值 | String | 无 | 需要根据flag来判断 |
title | 数据名称 | String | guestTeamName | 详见附2比赛数据类型对应表 |
flag | 数据标记 | String | guestTeamLogo | 详见附2比赛数据类型对应表 |
附1.比赛事件值列表
1.进球 2.点球进球 3.乌龙球 4.换上 5.黄牌 6.红牌 7.两黄变一红 8.点球未进 9.换下 10.助攻 12.点球大战进球 13.点球大战未进 14.射门 15.角球 16.头球 17.任意球 18.扑救 19.手球 20.争议 21.越位 22.犯规 23.判罚点球 24.盘带突破 25.花式技巧 26.抢断成功 27.VAR介入 28.伤退
附2.比赛数据类型对应表
比赛数据类型flag | 对应本场数据接口字段 | 对应场均数据flag |
---|---|---|
1 射门 | shotsNum | 111 射门均值 |
2 黄牌 | yellowCardsNum | 117 黄牌均值 |
3 封堵 | blockedNum | 110 封堵均值 |
4 传球 | passNum | 114 传球均值 |
5 红牌 | redCardsNum | 118 红牌均值 |
6 抢断 | wonTackle | 115 抢断均值 |
7 控球率 | possessionRate | 1 控球率 |
8 点球 | penaltiesNum | 122 场均点球 |
9 任意球 | freeKicksNum | 123 场均任意球 |
10 射正 | shotsTargetNum | 112 射正均值 |
11 进球 | goalNum | 113 进球场均 |
12 犯规 | foulsNum | 119 犯规均值 |
13 越位 | offsidesNum | 120 场均越位 |
14 角球 | cornersNum | 121 场均角球 |
15 传球成功率 | passPossession | 27 传球成功率 |
场均数据接口flag列表:
1.控球率 2.进球次数 3.助攻次数 4.封堵次数 5.黄牌次数 6.红牌次数 7.射门次数 8.射正次数 9.传球次数 10.关键传球次数 11.传球成功数 12.越位次数 13.拦截次数 14.抢断次数 15.解围次数 16.犯规次数 17.被犯规次数 18.扑救次数 19.获得点球数 20.获得任意球数 21.角球数 22.被判点球数 23.被判任意球数 24.传中成功率(25/24计算) 25.击中门框次数 26.进球次数 27.传球成功率 45.失球数 110.封堵均值 111.射门均值 112.射正均值 113.进球均值 114.传球均值 115.抢断均值 116.解围均值 117.黄牌均值 118.红牌均值 119.犯规均值 120.场均越位 121.场均角球 122.场均点球 123.场均任意球 107.球队平均年龄
附3.数据JOSN及获取进度表
matchExtraInfo对象json
// fh 上半场
// sh 下半场
// efh 补时上半场
// esh 补时下半场
"matchExtraInfo": {
"updater": "JOB_RUNNER",
"efhMinLength": 0,
"shSecLength": 2,
"shEndTime": 1553633934000,
"createDttm": 1553627052000,
"fhStartTime": 1553627027000,
"eshMinLength": 0,
"fhSecLength": 2,
"shMinLength": 49,
"efhSecLength": 0,
"creator": "JOB_RUNNER",
"eshSecLength": 0,
"fhEndTime": 1553629909000,
"shStartTime": 1553630992000,
"updateDttm": 1553637536000,
"matchId": 263696,
"fhMinLength": 48
}
// 获取比赛进度,上半场不超过45分钟,全场不超过90分钟
public long getPlayDuration(){
long playDuration = 0;
// 为0则表示下半场未开始
if (matchExtraInfo.getShStartTime() == 0) {
// 上半场开始时间也为0,则返回0
if (matchExtraInfo.getFhStartTime() == 0) {
return playDuration;
}
playDuration = (System.currentTimeMillis() - matchExtraInfo.getFhStartTime()) / 1000 / 60;
// 上半场的时间进度为1~45分钟
playDuration = playDuration == 0 ? 1 : playDuration;
playDuration = playDuration > 45 ? 45 : playDuration;
} else {
playDuration = 45 + (System.currentTimeMillis() - matchExtraInfo.getShStartTime()) / 1000 / 60;
// 下半场的时间进度为46~90分钟
playDuration = playDuration == 45 ? 46 : playDuration;
playDuration = playDuration > 90 ? 90 : playDuration;
}
return playDuration;
}