摘要:英雄联盟的联赛列表接口代码示例,可注册查看在线文档英雄联盟详情页联赛列表获取返回内容这里为了方便测试我使用了一份本地文件,使用时应替换为真实接口返回内容返回数据如下部分成功亚洲洲际赛亚洲洲际赛韩国首尔欧美洲际赛欧美洲际赛洛杉矶夏季赛夏季
英雄联盟的【联赛列表】接口代码示例,可注册查看在线文档:英雄联盟详情页
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.annotation.JSONField; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; /** * @API: 联赛列表 * @Website: https://www.feijing88.com */ public class LolLeague { public static void main(String[] args) { try { String content = getContent(); Respond rsp = JSON.parseObject(content, Respond.class); System.out.println(rsp.code); System.out.println(rsp.message); rsp.getLeagueList().forEach(System.out::println); } catch (Throwable t) { t.printStackTrace(); } } /** * 获取API返回内容 ** Note: 这里为了方便测试我使用了一份本地文件,使用时应替换为真实接口返回内容 */ private static String getContent() { try { StringBuilder builder = new StringBuilder(); List
lines = Files.readAllLines(Paths.get("./src/main/resources/LolLeague.json"), StandardCharsets.UTF_8); lines.forEach(builder::append); return builder.toString(); } catch (Throwable t) { t.printStackTrace(); return ""; } } public static class Respond { @JSONField(name = "code") private int code; @JSONField(name = "message") private String message; @JSONField(name = "data") private List leagueList; public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public List getLeagueList() { return leagueList; } public void setLeagueList(List leagueList) { this.leagueList = leagueList; } } public static class League { @JSONField(name = "league_id") private int leagueId; @JSONField(name = "name") private String name; @JSONField(name = "name_en") private String nameEn; @JSONField(name = "short_name") private String nameShort; @JSONField(name = "start_time") private long startTime; @JSONField(name = "end_time") private long endTime; @JSONField(name = "organizer") private String organizer; @JSONField(name = "logo") private String logo; @JSONField(name = "address") private String address; @JSONField(name = "team_ids") private List teamIds; @JSONField(name = "status") private int status; @Override public String toString() { return "League{" + "leagueId=" + leagueId + ", name="" + name + """ + ", nameEn="" + nameEn + """ + ", nameShort="" + nameShort + """ + ", startTime=" + startTime + ", endTime=" + endTime + ", organizer="" + organizer + """ + ", logo="" + logo + """ + ", address="" + address + """ + ", teamIds=" + teamIds + ", status=" + status + "}"; } public void setLeagueId(int leagueId) { this.leagueId = leagueId; } public void setName(String name) { this.name = name; } public void setNameEn(String nameEn) { this.nameEn = nameEn; } public void setNameShort(String nameShort) { this.nameShort = nameShort; } public void setStartTime(long startTime) { this.startTime = startTime; } public void setEndTime(long endTime) { this.endTime = endTime; } public void setOrganizer(String organizer) { this.organizer = organizer; } public void setLogo(String logo) { this.logo = logo; } public void setAddress(String address) { this.address = address; } public void setTeamIds(List teamIds) { this.teamIds = teamIds; } public void setStatus(int status) { this.status = status; } } }
API 返回数据如下(部分):
200 成功 League{leagueId=674, name="2019 亚洲洲际赛", nameEn="Rift Rivals 2019/Asia", nameShort="2019 亚洲洲际赛", startTime=1562169600000, endTime=1562428800000, organizer="Riot", logo="http://qn.feijing88.com/feijing-home/egame/image/20190620/048a632507ff47918394d5d2c4bcb04c.png", address="韩国首尔", teamIds=[3, 708, 40, 703, 64, 787, 74, 670, 60, 813, 782, 737], status=2} League{leagueId=675, name="2019 欧美洲际赛", nameEn="2019 RIFT RIVALS", nameShort="2019 欧美洲际赛", startTime=1561564800000, endTime=1561824000000, organizer="Riot", logo="http://qn.feijing88.com/feijing-home/egame/image/20190620/9ed7e6ab761e436daadf36f9a523b0f7.png", address="洛杉矶", teamIds=[58, 7, 69, 67, 601, 607], status=2} League{leagueId=671, name="2019 LMS 夏季赛", nameEn="LMS 2019 Summer Split", nameShort="2019 LMS 夏季赛", startTime=1560355200000, endTime=1567094400000, organizer="Riot", logo="http://qn.feijing88.com/feijing-home/egame/image/20190607/03a5ecfb3ea844a8a111e0df855c6821.png", address="台北", teamIds=[5, 181, 60, 781, 632, 90, 782], status=1} League{leagueId=672, name="2019 LEC夏季赛", nameEn="LEC 2019 Summer Split", nameShort="2019 LEC夏季赛", startTime=1559836800000, endTime=1565366400000, organizer="Riot", logo="http://qn.feijing88.com/feijing-home/egame/image/20190531/bf5d954f918644cab9cda6941a89a6c8.png", address="欧洲", teamIds=[965, 669, 607, 67, 686, 601, 825, 824, 62, 660], status=1} League{leagueId=678, name="2019 LCK夏季赛", nameEn="LCK 2019 Summer Split", nameShort="2019 LCK夏季赛", startTime=1559664000000, endTime=1567094400000, organizer="Riot", logo="http://qn.feijing88.com/feijing-home/egame/image/20190528/c69270e207ef47d7a8691658ba85ecce.png", address="韩国", teamIds=[46, 703, 4, 708, 2, 49, 40, 44, 704, 3], status=1} League{leagueId=670, name="2019 LPL夏季赛", nameEn="LPL 2019 Summer Split", nameShort="2019 LPL夏季赛", startTime=1559318400000, endTime=1567180800000, organizer="Riot", logo="http://qn.feijing88.com/feijing-home/egame/image/20190526/f6f05d4f41e14927bf46cfc97239a1be.png", address="", teamIds=[1, 6, 64, 73, 66, 787, 63, 74, 71, 789, 677, 79, 70, 976, 722, 670], status=1} League{leagueId=677, name="2019 LCS夏季赛", nameEn="LCS 2019 Summer Split", nameShort="2019 LCS夏季赛", startTime=1559318400000, endTime=1566662400000, organizer="Riot", logo="http://qn.feijing88.com/feijing-home/egame/image/20190526/d153eca078d44c45baf15676dc8ab270.png", address="北美", teamIds=[779, 7, 771, 68, 602, 680, 773, 778, 58, 69], status=1} League{leagueId=662, name="2019 MSI季中冠军赛", nameEn="2019 Mid-Season Invitational", nameShort="2019 MSI季中冠军赛", startTime=1556640000000, endTime=1558195200000, organizer="Riot", logo="http://qn.feijing88.com/feijing-home/egame/image/20190425/cbfad96597dc4391b5e88d117c18720a.png", address="越南 台北", teamIds=[67, 3, 653, 58, 813, 51, 119, 863, 61, 60, 614, 64, 111], status=2} League{leagueId=669, name="2019NEST电竞大赛", nameEn="2019NEST", nameShort="2019NEST", startTime=1555862400000, endTime=1558800000000, organizer="华奥CGA", logo="http://qn.feijing88.com/feijing-home/egame/image/20190419/40befc4dd6284bf78d9561db2281e226.png", address="贵阳", teamIds=[670, 71, 722, 787, 79, 64, 63, 74, 6, 73, 789, 677, 1, 66, 70], status=2} League{leagueId=661, name="2019LCK春季升降级赛", nameEn="LCK 2019 Spring Promotion", nameShort="2019LCK春季升降级赛", startTime=1555344000000, endTime=1555776000000, organizer="Riot", logo="http://qn.feijing88.com/feijing-home/egame/image/20190411/1214da36283b411297030116180ac6cf.png", address="韩国", teamIds=[44, 49, 949, 118], status=2}
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/106432.html
摘要:英雄联盟联赛统计在线接口文档英雄联盟接口,需注册下英雄联赛统计获取返回内容这里为了方便测试我使用了一份本地文件,使用时应替换为真实接口返回内容返回数据如下部分成功中单中单中单上单上单辅助中单中单辅助辅助 英雄联盟lol联赛统计在线接口文档:英雄联盟接口,需注册下 import com.alibaba.fastjson.JSON; import com.alibaba.fastjson....
摘要:电竞的联赛列表接口,在线接口文档联赛列表获取返回内容这里为了方便测试我使用了一份本地文件,使用时应替换为真实接口返回内容返回数据如下部分成功 电竞CSGO的【联赛列表】接口,在线接口文档 import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.annotation.JSONField; import java.ni...
摘要:电竞的联赛列表接口,在线接口文档联赛列表获取返回内容这里为了方便测试我使用了一份本地文件,使用时应替换为真实接口返回内容返回数据如下部分成功 电竞CSGO的【联赛列表】接口,在线接口文档 import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.annotation.JSONField; import java.ni...
摘要:之前调用过的联赛数据在线接口文档定义请求数据接口参数替换成自己的替换成自己的替换成请求对应数据的接口地址例如请求时间戳初始化请求接口参数调用电竞数据接口获取格式为字符串打印请求结果请求接口字符编码返回字符串设置请求头获取当 之前调用过的DOTA联赛数据 [https://www.feijing88.com/esport] import java.io.BufferedReader; i...
阅读 2241·2021-11-10 11:35
阅读 847·2021-09-26 09:55
阅读 2369·2021-09-22 15:22
阅读 2296·2021-09-22 15:17
阅读 3656·2021-09-09 09:33
阅读 1778·2019-08-30 11:22
阅读 924·2019-08-30 10:57
阅读 578·2019-08-29 16:10