A Personalized Twitch Resources Recommendation Engine
- Intelij 启动 Tomcat 后,有乱码,出现 “淇℃伅 [main] org.apach”
解决办法 :
修改 tomcat 安装目录下的 config/logging.properties 文件
java.util.logging.ConsoleHandler.encoding = GBK
- delpoy website: http://localhost:8080/jupiter-war-exploded/game
解决办法:
Run -> Configurations -> Deployment
now opens up at http://localhost:8080/jupiter/game:
- postman
POST http://localhost:8080/jupiter/game
- IDEA tomcat 404
- HTTP 500 –..JSONObject["name"] not found.
解决办法:
replay a new client id. 😅 😅 😅
- Postman?? IDEA offers better options: Tools -> HttpClient
GET https://api.twitch.tv/helix/streams?game_id=12924 Authorization: Bearer jo3r1bpdgk5gx41zx2wuajygdb1d8b Client-Id: t5bc5a4tab71mqgs1f880ent6cx8j4
Authorization, Client-Id is refer to your own data under the postman headers tab
- lombok and Builder pattern
Without the lombok, the code would be like below:
you need use delombok to find the problem:
- Jackson tutorial Jackson
@JsonProperty("thumbnail_url")
private String thumbnailUrl;
// Convert JSON format data returned from Twitch to an Arraylist of Game objects
ObjectMapper mapper = new ObjectMapper();
try {
return Arrays.asList(mapper.readValue(data, Game[].class));
-
@JsonIgnoreProperties(ignoreUnknown = true) indicates that other fields in the response can be safely ignored. Without this, you’ll get an exception at runtime.
-
@JsonInclude(JsonInclude.Include.NON_NULL) indicates that null fields can be skipped and not included.
-
@JsonDeserialize indicates that Jackson needs to use Game.Builder when constructing a Game object from JSON strings.
- Failed to connect to api.twitch.com port 443: Connection
中国特色错误,换 EXpressVPN