首页 文章 精选 留言 我的

精选列表

搜索[工具调用],共10000篇文章
优秀的个人博客,低调大师

电竞CSGO数据API接口 - 【联赛列表】API调用示例代码

电竞CSGO的【联赛列表】接口,在线文档查阅,需注册下 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 CsgoLeague { 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返回内容 * <p> * Note: 这里为了方便测试我使用了一份本地文件,使用时应替换为真实接口返回内容 */ private static String getContent() { try { StringBuilder builder = new StringBuilder(); List<String> lines = Files.readAllLines(Paths.get("./src/main/resources/CsgoLeague.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<League> 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<League> getLeagueList() { return leagueList; } public void setLeagueList(List<League> leagueList) { this.leagueList = leagueList; } } public static class League { @JSONField(name = "league_id") private int leagueId; @JSONField(name = "logo") private String logo; @JSONField(name = "name") private String name; @JSONField(name = "country") private String country; @JSONField(name = "location") private String location; @JSONField(name = "start_time") private long startTime; @JSONField(name = "end_time") private long endTime; @JSONField(name = "team_ids") private List<Integer> teamIds; @JSONField(name = "status") private int status; @Override public String toString() { return "League{" + "leagueId=" + leagueId + ", logo='" + logo + '\'' + ", name='" + name + '\'' + ", country='" + country + '\'' + ", location='" + location + '\'' + ", startTime=" + startTime + ", endTime=" + endTime + ", teamIds=" + teamIds + ", status=" + status + '}'; } public int getLeagueId() { return leagueId; } public void setLeagueId(int leagueId) { this.leagueId = leagueId; } public String getLogo() { return logo; } public void setLogo(String logo) { this.logo = logo; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public long getStartTime() { return startTime; } public void setStartTime(long startTime) { this.startTime = startTime; } public long getEndTime() { return endTime; } public void setEndTime(long endTime) { this.endTime = endTime; } public List<Integer> getTeamIds() { return teamIds; } public void setTeamIds(List<Integer> teamIds) { this.teamIds = teamIds; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } } } API 返回数据如下(部分): 成功 League{leagueId=9866, logo='http://qn.feijing88.com/feijing-home/egame/image/20190514/49cd2c63e3834fa2a92df8f1d02ec390.png', name='DreamHack Open Sevilla 2019', country='Spain', location='Sevilla, Spain', startTime=1576234800000, endTime=1576407600000, teamIds=[], status=2} League{leagueId=9342, logo='http://qn.feijing88.com/feijing-home/egame/image/20190801/a50756930fbe44b68b35c1e63febfe70.jpg', name='Gamers Club Masters IV', country='Brazil', location='Sorocaba, São Paulo', startTime=1576148400000, endTime=1577012400000, teamIds=[], status=0} League{leagueId=9253, logo='http://qn.feijing88.com/feijing-home/egame/image/20190624/06280d3da7e640708ff86179eee76ffb.jpg', name='ESL Pro League Season 10 Finals', country='Denmark', location='Odense, Denmark', startTime=1575630000000, endTime=1575802800000, teamIds=[], status=2} League{leagueId=9868, logo='http://qn.feijing88.com/feijing-home/egame/image/20190514/7190e798f3d84ce2b52902f09dbc2349.png', name='DreamHack Open Winter 2019', country='Sweden', location='Jönköping, Sweden', startTime=1575025200000, endTime=1575198000000, teamIds=[], status=0} League{leagueId=9240, logo='http://qn.feijing88.com/feijing-home/egame/image/20190711/b340bbdf32554914961b4a1e328a3c9b.png', name='CS:GO Asia Championships 2019', country='China', location='Shanghai, China', startTime=1574334000000, endTime=1574593200000, teamIds=[9425, 5761, 9428], status=2} League{leagueId=9867, logo='http://qn.feijing88.com/feijing-home/egame/image/20190514/04e44a98f9564a4983568ae8b95bc506.png', name='DreamHack Open Atlanta 2019', country='United States', location='Atlanta, Georgia, USA', startTime=1573815600000, endTime=1573988400000, teamIds=[], status=0} League{leagueId=9246, logo='http://qn.feijing88.com/feijing-home/egame/image/20190713/7a21b891f3fd493c94c19e17d82d543c.jpg', name='eXTREMESLAND 2019 Asia Finals', country='China', location='Shanghai, China', startTime=1573729200000, endTime=1573988400000, teamIds=[], status=2} League{leagueId=9307, logo='http://qn.feijing88.com/feijing-home/egame/image/20190627/2f20036ba3a84bbb90815f1acb8c2dbf.jpg', name='BLAST Pro Series Copenhagen 2019', country='Denmark', location='Copenhagen, Denmark', startTime=1572606000000, endTime=1572692400000, teamIds=[1538, 2221, 9204, 9966], status=2} League{leagueId=9348, logo='http://qn.feijing88.com/feijing-home/egame/image/20190801/aad3efd47ed64a1a922ae1b56dbc3996.png', name='ESL LA League Season 5 Finals', country='Brazil', location='São Paulo', startTime=1572084000000, endTime=1572170400000, teamIds=[], status=2} League{leagueId=9275, logo='http://qn.feijing88.com/feijing-home/egame/image/20190521/5860289be57d46dc88eaa30bac90bb45.png', name='Logitech G Challenge 2019', country='Mexico', location='Mexico City, Mexico', startTime=1571997600000, endTime=1571997600000, teamIds=[], status=2}

资源下载

更多资源
Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册