Task系APIをServiceに追加

This commit is contained in:
ろむねこ 2024-06-28 12:12:35 +09:00
parent 2a22077862
commit 407196e75f
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -4,13 +4,17 @@ import one.nem.kidshift.data.retrofit.interceptor.AuthorizationInterceptor;
import one.nem.kidshift.data.retrofit.model.parent.ParentInfoResponse; import one.nem.kidshift.data.retrofit.model.parent.ParentInfoResponse;
import one.nem.kidshift.data.retrofit.model.parent.auth.ParentLoginRequest; import one.nem.kidshift.data.retrofit.model.parent.auth.ParentLoginRequest;
import one.nem.kidshift.data.retrofit.model.parent.auth.ParentLoginResponse; import one.nem.kidshift.data.retrofit.model.parent.auth.ParentLoginResponse;
import one.nem.kidshift.data.retrofit.model.task.TaskAddRequest;
import one.nem.kidshift.data.retrofit.model.task.TaskListResponse; import one.nem.kidshift.data.retrofit.model.task.TaskListResponse;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.Body; import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET; import retrofit2.http.GET;
import retrofit2.http.Header; import retrofit2.http.Header;
import retrofit2.http.Headers; import retrofit2.http.Headers;
import retrofit2.http.POST; import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
public interface KidShiftApiService { public interface KidShiftApiService {
@ -24,4 +28,22 @@ public interface KidShiftApiService {
@GET("/parent/task") @GET("/parent/task")
@Headers(AuthorizationInterceptor.HEADER_PLACEHOLDER) @Headers(AuthorizationInterceptor.HEADER_PLACEHOLDER)
Call<TaskListResponse> getTasks(); Call<TaskListResponse> getTasks();
@POST("/parent/task")
@Headers(AuthorizationInterceptor.HEADER_PLACEHOLDER)
Call<TaskListResponse> addTask(@Body TaskAddRequest request);
@PUT("/parent/task/{id}")
@Headers(AuthorizationInterceptor.HEADER_PLACEHOLDER)
Call<TaskListResponse> updateTask(@Body TaskAddRequest request, @Path("id") String id);
@DELETE("/parent/task/{id}")
@Headers(AuthorizationInterceptor.HEADER_PLACEHOLDER)
Call<TaskListResponse> removeTask(@Path("id") String id);
@GET("/parent/task/{id}")
@Headers(AuthorizationInterceptor.HEADER_PLACEHOLDER)
Call<TaskListResponse> getTask(@Path("id") String id);
} }