mirror of
https://github.com/a-mayb3/KanbanCloneAndroid.git
synced 2026-03-21 18:15:38 +01:00
Added more necessary endpoints to ApiService.kt
This commit is contained in:
parent
a8f9a69d58
commit
e4280f0490
3 changed files with 36 additions and 4 deletions
|
|
@ -4,9 +4,7 @@ plugins {
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.campusaula.edbole.kanban_clone_android"
|
namespace = "com.campusaula.edbole.kanban_clone_android"
|
||||||
compileSdk {
|
compileSdk = 36
|
||||||
version = release(36)
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.campusaula.edbole.KanbanCloneAndroid"
|
applicationId = "com.campusaula.edbole.KanbanCloneAndroid"
|
||||||
|
|
@ -44,7 +42,6 @@ dependencies {
|
||||||
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
|
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
|
||||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
|
||||||
|
|
||||||
// Networking: OkHttp + Retrofit
|
|
||||||
implementation("com.squareup.okhttp3:okhttp:4.11.0")
|
implementation("com.squareup.okhttp3:okhttp:4.11.0")
|
||||||
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")
|
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")
|
||||||
implementation("com.squareup.retrofit2:retrofit:2.9.0")
|
implementation("com.squareup.retrofit2:retrofit:2.9.0")
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,18 @@ interface ApiService {
|
||||||
@GET("projects/{project_id}/users/")
|
@GET("projects/{project_id}/users/")
|
||||||
suspend fun getProjectUsers(@Path("project_id") projectId: Int): Response<List<UserBase>>
|
suspend fun getProjectUsers(@Path("project_id") projectId: Int): Response<List<UserBase>>
|
||||||
|
|
||||||
|
@POST("projects/{project_id}/users/")
|
||||||
|
suspend fun addProjectCollaborator(
|
||||||
|
@Path("project_id") projectId: Int,
|
||||||
|
@Body email: Map<String, String>
|
||||||
|
): Response<Unit>
|
||||||
|
|
||||||
|
@DELETE("projects/{project_id}/users/{user_id}/")
|
||||||
|
suspend fun removeProjectCollaborator(
|
||||||
|
@Path("project_id") projectId: Int,
|
||||||
|
@Path("user_id") userId: Int
|
||||||
|
): Response<Unit>
|
||||||
|
|
||||||
@POST("projects/")
|
@POST("projects/")
|
||||||
suspend fun createProject(@Body projectCreate: ProjectCreate): Response<ProjectBase>
|
suspend fun createProject(@Body projectCreate: ProjectCreate): Response<ProjectBase>
|
||||||
|
|
||||||
|
|
@ -57,4 +69,17 @@ interface ApiService {
|
||||||
@POST("projects/{project_id}/tasks/")
|
@POST("projects/{project_id}/tasks/")
|
||||||
suspend fun createTask(@Path("project_id") projectId: Int, @Body taskBase: TaskBase): Response<TaskBase>
|
suspend fun createTask(@Path("project_id") projectId: Int, @Body taskBase: TaskBase): Response<TaskBase>
|
||||||
|
|
||||||
|
@PUT("projects/{project_id}/tasks/{task_id}/")
|
||||||
|
suspend fun updateProjectTask(
|
||||||
|
@Path("project_id") projectId: Int,
|
||||||
|
@Path("task_id") taskId: Int,
|
||||||
|
@Body taskUpdate: TaskUpdate
|
||||||
|
): Response<Unit>
|
||||||
|
|
||||||
|
@DELETE("projects/{project_id}/tasks/{task_id}/")
|
||||||
|
suspend fun deleteProjectTask(
|
||||||
|
@Path("project_id") projectId: Int,
|
||||||
|
@Path("task_id") taskId: Int
|
||||||
|
): Response<Unit>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
app/src/main/res/values/arrays.xml
Normal file
10
app/src/main/res/values/arrays.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string-array name="task_status_options">
|
||||||
|
<item>Pending</item>
|
||||||
|
<item>In progress</item>
|
||||||
|
<item>Completed</item>
|
||||||
|
<item>Stashed</item>
|
||||||
|
<item>Failed</item>
|
||||||
|
</string-array>
|
||||||
|
</resources>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue