-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAttendanceExample.java
More file actions
28 lines (20 loc) · 932 Bytes
/
AttendanceExample.java
File metadata and controls
28 lines (20 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import io.github.tomhula.jecnaapi.data.attendance.AttendancesPage;
import io.github.tomhula.jecnaapi.java.JecnaClientJavaWrapper;
import kotlinx.datetime.LocalDate;
import java.util.Set;
public class AttendanceExample
{
public static void main(String[] args)
{
/* Metody join() používáme aby jsme z asynchroního běhu "udělali" synchroní; pouze v příkladech */
JecnaClientJavaWrapper client = new JecnaClientJavaWrapper();
client.login("user", "password").join();
/* Lze specifikovat období v argumentu */
AttendancesPage attendancesPage = client.getAttendancePage().join();
/* Všechny dny, pro které existují data */
Set<LocalDate> attendances = attendancesPage.getDays();
/* Všechny příchody a odchody (v daném půlroce) */
for (LocalDate date : attendances)
System.out.println(attendancesPage.get(date));
}
}