Skip to content

Commit 9e2b030

Browse files
committed
readme: documentation
1 parent 485e315 commit 9e2b030

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
11
# covid19-visualizer-net
22

3-
Network component of the covid-19 visualizer
3+
Network component of the covid-19 visualizer.
4+
5+
This library was built to be a module of the Processing language.
6+
7+
## Usage
8+
9+
### 创建实例
10+
```java
11+
VirusService service = VirusServices.create();
12+
```
13+
14+
一切网络操作都需要通过 `service` 进行
15+
16+
### 获取全球今日情况
17+
```java
18+
Day day = service.today().execute().body();
19+
```
20+
21+
样例|返回类型|用途
22+
:---:|:---:|:---:
23+
`day.getCountry()` | String | 数据来源国家。如果为全球数据,返回值为 `null`
24+
`day.isGlobal()` | boolean | 判断该数据是否是全球数据
25+
`day.getDate()` | Date | 数据的日期
26+
`day.getConfirmed()` | int | 累计确诊人数
27+
`day.getDeaths()` | int | 累计死亡人数
28+
`day.getRecorvered()`| int | 累计治愈人数
29+
30+
### 获取自爆发以来的全球每日情况
31+
```java
32+
List<Day> days = service.allDays().execute().body();
33+
```
34+
35+
### 获取单个国家自爆发以来的每日情况
36+
```java
37+
List<Day> days = service.country("国家名").execute().body();
38+
```
39+
40+
## 获取所有国家自爆发以来的每日情况
41+
```java
42+
List<Day> days = service.allCountries().execute().body();
43+
```
444

545
## Acknowledge
646

0 commit comments

Comments
 (0)