-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
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
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/owori/android/data/api/schedule/ScheduleApi.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,35 @@ | ||
package com.owori.android.data.api.schedule | ||
|
||
import com.owori.android.data.model.schedule.ScheduleItem | ||
import com.owori.android.data.model.schedule.SchedulePostRequest | ||
import com.owori.android.data.model.schedule.ScheduleResponse | ||
import com.owori.android.module.DataResult | ||
import retrofit2.http.Body | ||
import retrofit2.http.DELETE | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.Path | ||
import retrofit2.http.Query | ||
|
||
interface ScheduleApi { | ||
|
||
// 일정 등록 | ||
@POST("/schedule") | ||
fun registerSchedule(@Body data: SchedulePostRequest): DataResult<ScheduleResponse> | ||
|
||
// 일정 수정 | ||
@POST("/schedule/update") | ||
fun editSchedule(@Body data: ScheduleItem): DataResult<ScheduleResponse> | ||
|
||
// 일정 삭제 | ||
@DELETE("/schedule/{scheduleId}") | ||
fun deleteSchedule(@Path(value = "scheduleId") id: String): DataResult<Any> | ||
|
||
// 일정 월별 조회 | ||
@GET("/schedule/month") | ||
fun getMonthlySchedule(@Query("year_month")yearMonth: String): DataResult<List<ScheduleItem>> | ||
|
||
// 가족별 디데이 조회 | ||
@GET("/schedule/dday") | ||
fun getMonthlyDDay(): DataResult<List<ScheduleItem>> | ||
} |
47 changes: 47 additions & 0 deletions
47
app/src/main/java/com/owori/android/data/model/schedule/ScheduleRequest.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,47 @@ | ||
package com.owori.android.data.model.schedule | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class SchedulePostRequest( | ||
val title: String, | ||
val content: String, | ||
@SerializedName("start_date") | ||
val startDate: String?, | ||
@SerializedName("end_date") | ||
val endDate: String?, | ||
@SerializedName("schedule_type") | ||
val scheduleType: ScheduleType, | ||
val nickname: String, | ||
val color: String, | ||
@SerializedName("dday_option") | ||
val dDayOption: Boolean, | ||
@SerializedName("alarm_options") | ||
val alarmOptions: List<String>, | ||
@SerializedName("is_mine") | ||
val isMine: Boolean, | ||
) | ||
|
||
data class ScheduleItem( | ||
@SerializedName("schedule_id") | ||
val scheduleId: String, | ||
val title: String, | ||
val content: String, | ||
@SerializedName("start_date") | ||
val startDate: String?, | ||
@SerializedName("end_date") | ||
val endDate: String?, | ||
@SerializedName("schedule_type") | ||
val scheduleType: ScheduleType, | ||
val nickname: String, | ||
val color: String, | ||
@SerializedName("dday_option") | ||
val dDayOption: Boolean, | ||
@SerializedName("alarm_options") | ||
val alarmOptions: List<String>, | ||
@SerializedName("is_mine") | ||
val isMine: Boolean, | ||
) | ||
|
||
enum class ScheduleType { | ||
FAMILY, INDIVIDUAL | ||
} |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/owori/android/data/model/schedule/ScheduleResponse.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,8 @@ | ||
package com.owori.android.data.model.schedule | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class ScheduleResponse( | ||
@SerializedName("schedule_id") | ||
val scheduleId: String, | ||
) |