Skip to content

Commit 9551467

Browse files
committed
Add methods to retrieve sport score
1 parent e7ab6f2 commit 9551467

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

src/main/java/api/myitmo/MyItmoApi.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ Call<ResultResponse<List<SportSchedule>>> getSportSchedule(@Query("date_start")
5050
@Query("building_id") Long buildingId, @Query("sport_type_id") @Nullable List<Long> sportTypeIds,
5151
@Query("teacher_isu") @Nullable List<Long> teacherIsu);
5252

53+
@GET("/api/sport/personal/score")
54+
Call<ResultResponse<SportScore>> getSportScore(@Query("semester_id") Long semesterId);
55+
5356
@GET("https://qr.itmo.su/v1/user/pass")
5457
Call<SimpleResponse<QrData>> getQrCode();
5558

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package api.myitmo.model;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Data;
5+
6+
import java.time.OffsetDateTime;
7+
8+
@Data
9+
public class SportAttendance {
10+
11+
private String type;
12+
13+
private String name;
14+
15+
@SerializedName("evaluation_id")
16+
private long evaluationId;
17+
18+
@SerializedName("evaluation_name")
19+
private String evaluationName;
20+
21+
@SerializedName("section_level")
22+
private int sectionLevel;
23+
24+
private int score;
25+
26+
private OffsetDateTime date;
27+
28+
private boolean isCompetition;
29+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package api.myitmo.model;
2+
3+
import lombok.Data;
4+
5+
import java.util.List;
6+
7+
@Data
8+
public class SportScore {
9+
10+
private Sum sum;
11+
12+
private List<SportAttendance> attendances;
13+
14+
@Data
15+
public static class Sum {
16+
private long attendances;
17+
18+
private long other;
19+
}
20+
}

0 commit comments

Comments
 (0)