继续分享使用接口调用的示例代码,这次是 【即时指数接口1】
package com.huaying.demo.football;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
/**
* @API: 14.即时指数接口
*/
public class FootballOdds100 {
public static void main(String[] args) {
try {
String content = getContent();
JAXBContext jaxbContext = JAXBContext.newInstance(MatchList.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
MatchList matchList = (MatchList) unmarshaller.unmarshal(new ByteArrayInputStream(content.getBytes()));
matchList.getMatchList().forEach(item -> System.out.println(item));
} catch (Throwable t) {