Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(reminder): create CalendarApi, interface with microservice
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaBrighi committed Jun 14, 2023
1 parent 3837760 commit 0302066
Showing 1 changed file with 37 additions and 0 deletions.
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)
}

0 comments on commit 0302066

Please sign in to comment.