1
+ package com.fictadvisor.android.data.remote.api
2
+
3
+ import com.fictadvisor.android.data.dto.schedule.DetailedEventResponse
4
+ import com.fictadvisor.android.data.dto.schedule.GetEventResponse
5
+ import com.fictadvisor.android.data.dto.schedule.PatchEventDTO
6
+ import com.fictadvisor.android.data.dto.schedule.PostEventDTO
7
+ import retrofit2.Response
8
+ import retrofit2.http.Body
9
+ import retrofit2.http.DELETE
10
+ import retrofit2.http.GET
11
+ import retrofit2.http.PATCH
12
+ import retrofit2.http.POST
13
+ import retrofit2.http.Path
14
+ import retrofit2.http.Query
15
+
16
+ interface ScheduleApi {
17
+ @GET(" /v2/schedule/groups/{groupId}/general" )
18
+ suspend fun getEvents (
19
+ @Path(" groupId" ) groupId : String ,
20
+ @Query(" week" ) week : Int ,
21
+ @Query(" addLecture" ) addLecture : Boolean = true,
22
+ @Query(" addLaboratory" ) addLaboratory : Boolean = true,
23
+ @Query(" addPractice" ) addPractice : Boolean = true
24
+ ): Response <GetEventResponse >
25
+
26
+ @GET(" /v2/schedule/groups/{groupId}/events" )
27
+ suspend fun getEventsAuthorized (
28
+ @Path(" groupId" ) groupId : String ,
29
+ @Query(" week" ) week : Int ,
30
+ @Query(" showOwnSelective" ) showOwnSelective : Boolean ,
31
+ @Query(" addLecture" ) addLecture : Boolean = true,
32
+ @Query(" addLaboratory" ) addLaboratory : Boolean = true,
33
+ @Query(" addPractice" ) addPractice : Boolean = true,
34
+ @Query(" otherEvents" ) otherEvents : Boolean = true
35
+ ): Response <GetEventResponse >
36
+
37
+ @GET(" /v2/schedule/events/{eventId}" )
38
+ suspend fun getEventInfo (
39
+ @Path(" eventId" ) eventId : String ,
40
+ @Query(" week" ) week : Any // You can define the type accordingly
41
+ ): Response <DetailedEventResponse >
42
+
43
+ @DELETE(" /v2/schedule/groups/{groupId}/events/{eventId}" )
44
+ suspend fun deleteEventById (
45
+ @Path(" groupId" ) groupId : String ,
46
+ @Path(" eventId" ) eventId : String
47
+ ): Response <DetailedEventResponse >
48
+
49
+ @POST(" /v2/schedule/events" )
50
+ suspend fun addEvent (
51
+ @Body body : PostEventDTO ,
52
+ @Query(" groupId" ) groupId : String
53
+ ): Response <DetailedEventResponse >
54
+
55
+ @PATCH(" /v2/schedule/groups/{groupId}/events/{eventId}" )
56
+ suspend fun editEvent (
57
+ @Body body : PatchEventDTO ,
58
+ @Path(" groupId" ) groupId : String ,
59
+ @Path(" eventId" ) eventId : String
60
+ ): Response <DetailedEventResponse >
61
+ }
0 commit comments