Skip to content

Commit

Permalink
readme: documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
imkiva committed Mar 24, 2020
1 parent 485e315 commit 9e2b030
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@
# covid19-visualizer-net

Network component of the covid-19 visualizer
Network component of the covid-19 visualizer.

This library was built to be a module of the Processing language.

## Usage

### 创建实例
```java
VirusService service = VirusServices.create();
```

一切网络操作都需要通过 `service` 进行

### 获取全球今日情况
```java
Day day = service.today().execute().body();
```

样例|返回类型|用途
:---:|:---:|:---:
`day.getCountry()` | String | 数据来源国家。如果为全球数据,返回值为 `null`
`day.isGlobal()` | boolean | 判断该数据是否是全球数据
`day.getDate()` | Date | 数据的日期
`day.getConfirmed()` | int | 累计确诊人数
`day.getDeaths()` | int | 累计死亡人数
`day.getRecorvered()`| int | 累计治愈人数

### 获取自爆发以来的全球每日情况
```java
List<Day> days = service.allDays().execute().body();
```

### 获取单个国家自爆发以来的每日情况
```java
List<Day> days = service.country("国家名").execute().body();
```

## 获取所有国家自爆发以来的每日情况
```java
List<Day> days = service.allCountries().execute().body();
```

## Acknowledge

Expand Down

0 comments on commit 9e2b030

Please sign in to comment.