package com.example.remarks.net;

import com.example.remarks.BuildConfig;
import com.example.remarks.models.Comment;
import com.ryanharter.auto.value.moshi.AutoValueMoshiAdapterFactory;
import com.squareup.moshi.Moshi;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.moshi.MoshiConverterFactory;
import retrofit2.http.Body;
import retrofit2.http.POST;

public class Rest {
    private RestService service;

    public Rest() {
        final Moshi moshi = new Moshi.Builder()
                .add(new AutoValueMoshiAdapterFactory())
                .build();

        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(BuildConfig.BASE_URL)
                .addConverterFactory(MoshiConverterFactory.create(moshi))
                .build();

        service = retrofit.create(RestService.class);
    }

    public Call<ResponseBody> sendComment(Comment comment) {
        return service.sendComment(comment);
    }

    private interface RestService {
        @POST("comment/")
        Call<ResponseBody> sendComment(@Body Comment comment);
    }
}

@@ -67,16 +67,62 @@
 Config;%0A
+import com.example.remarks.models.Annotation;%0A
 import c
@@ -1026,24 +1026,152 @@
 nt);%0A    %7D%0A%0A
+    public Call%3CResponseBody%3E sendAnnotation(Annotation annotation) %7B%0A        return service.sendAnnotation(annotation);%0A    %7D%0A%0A
     private 
@@ -1278,21 +1278,123 @@
 nt comment);
+%0A%0A        @POST(%22annotation/%22)%0A        Call%3CResponseBody%3E sendAnnotation(@Body Annotation annotation);
 %0A    %7D%0A%7D%0A

Add method to Rest class to send Annotation to remote store