This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(reminder): create CalendarApi, interface with microservice
- Loading branch information
1 parent
3837760
commit 0302066
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
reminderData/src/main/kotlin/com/intelligentbackpack/reminderdata/api/CalendarApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.intelligentbackpack.reminderdata.api | ||
|
||
import calendar.communication.BasicMessage | ||
import calendar.communication.BooksForLesson | ||
import calendar.communication.ChangeLessonBookPeriodDate | ||
import calendar.communication.Lesson | ||
import calendar.communication.Lessons | ||
import calendar.communication.Subjects | ||
import retrofit2.Call | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.HTTP | ||
import retrofit2.http.POST | ||
import retrofit2.http.Query | ||
|
||
interface CalendarApi { | ||
@GET("/utility/getAllYears/") | ||
fun getYears(): Call<BasicMessage> | ||
|
||
@GET("/utility/getAllSubjects/") | ||
fun getSubjects(): Call<Subjects> | ||
|
||
@GET("/utility/lessons/Student/") | ||
fun getLessonsForStudent(@Query("email") email: String, @Query("year") year: String): Call<Lessons> | ||
|
||
@GET("/utility/lessons/Professor/") | ||
suspend fun getLessonsForProfessor(@Query("email") email: String, @Query("year") year: String): Call<Lessons> | ||
|
||
@POST("/utility/booksforLesson/") | ||
fun getBooksForLesson(@Body lessons: Lesson): Call<BooksForLesson> | ||
|
||
@HTTP(method = "DELETE", path = "/remove/bookForLesson", hasBody = true) | ||
fun deleteReminderForLesson(@Body remainderForLesson: BooksForLesson) | ||
|
||
@POST("/modify/bookForTimePeriod/") | ||
fun modifyReminderForLesson(@Body remainderForLesson: ChangeLessonBookPeriodDate) | ||
} |