榜单详情.md 2.8 KB

游戏榜单

请求URL

  • GET rank/game

参数

参数名 必选 类型 说明
game_id int 游戏 ID
scope string world(总榜) 或 friend(好友榜)

运动榜单

请求URL

  • GET rank/sport

参数

参数名 必选 类型 说明
rank_id int 榜单 ID
scope string world(总榜) 或 friend(好友榜)

返回示例

{
    "result":1,
    "code":0,
    "msg":"成功",
    "data":{
        "rank":{
            "id":3,
            "name":"游戏 1 的评分榜",
            "is_game":1,
            "is_sport":0,
            "game_id":1,
            "introduce":"这是一小段榜单介绍说明",
            "user_count_max":5, // 榜单最大人数
            "rate_begin":"2020-07-19",
            "rate_end":"2020-07-26"
        },
        "user":{ // 为 null 则未上榜
            "id":5,
            "user_id":1,
            "game_id":1,
            "score":73.3,
            "finish_at":"2020-07-20 11:24:15",
            "duration":28, // 如果是游戏榜单则是本次记录时长,如果是运动榜单则是累计时长
            "consume":70, // 如果是游戏榜单则是本次记录小号,如果是运动榜单则是累计消耗
			"sport_day": 7, // 运动天数,只有运动榜单才有此字段
            "rate_begin":"2020-07-19",
            "rate_end":"2020-07-26",
            "user_name":"测试用户1",
			"user_avatar": "",
            "user_level":1,
			"user_gender":1,
			"user_age": 100,
			"position":5, // 排名
            "achievements":[
                {
                    "id":1,
                    "name":"成就1",
                    "logo":"",
                    "sort":999,
                    "series_id":1,
                },
                {
                    "id":2,
                    "name":"成就2",
                    "logo":"",
                    "sort":998,
                    "series_id":1,
                }
            ]
        },
        "records":[
            {
                "id":20,
                "user_id":3,
                "game_id":1,
                "score":99.1,
                "finish_at":"2020-07-20 04:24:44",
                "duration":52,
                "consume":130,
                "up":1,
                "rate_begin":"2020-07-19",
                "rate_end":"2020-07-26",
                "user_name":"测试用户3",
				"user_avatar": "",
                "user_level":1,
				"user_gender":1,
				"position": 1,
                "achievements":[
                    {
                        "id":1,
                        "name":"成就1",
                        "logo":"",
                        "sort":999,
                        "series_id":1,
                    }
                ]
            },
		]
	}
}