package com.littlesparkle.growler.library.user.driver;


import com.littlesparkle.growler.library.http.DefaultResponse;
import com.littlesparkle.growler.library.http.Request;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import rx.Observable;

public class DriverRequest extends Request<DriverRequest.DriverApi> {

    @Override
    protected Class<DriverApi> getServiceClass() {
        return DriverApi.class;
    }

    public interface DriverApi {
        @GET("driver/info")
        Observable<DriverInfoResponse> getInfo(
                @Field("user_id") int userId,
                @Field("token") String token
        );

        @POST("driver/online")
        @FormUrlEncoded
        Observable<DefaultResponse> online(
                @Field("user_id") int userId,
                @Field("token") String token
        );

        @POST("driver/offline")
        @FormUrlEncoded
        Observable<DefaultResponse> offline(
                @Field("user_id") int userId,
                @Field("token") String token
        );

        @POST("driver/rate")
        @FormUrlEncoded
        Observable<DefaultResponse> rate(
                @Field("user_id") int userId,
                @Field("token") String token,
                @Field("order_id") int orderId,
                @Field("rate") int rate
        );
    }
}

@@ -303,20 +303,176 @@
 rt r
-x.Observable
+etrofit2.http.Query;%0Aimport rx.Observable;%0Aimport rx.Subscriber;%0Aimport rx.Subscription;%0Aimport rx.android.schedulers.AndroidSchedulers;%0Aimport rx.schedulers.Schedulers
 ;%0A%0Ap
@@ -645,16 +645,410 @@
 %0A    %7D%0A%0A
+    public Subscription getDriverInfo(Subscriber%3CDriverInfoResponse%3E subscriber,%0A                                      int userId, String token) %7B%0A        return mService.getInfo(userId, token)%0A                .subscribeOn(Schedulers.io())%0A                .observeOn(AndroidSchedulers.mainThread())%0A                .unsubscribeOn(Schedulers.io())%0A                .subscribe(subscriber);%0A    %7D%0A%0A
     publ
@@ -1157,37 +1157,37 @@
                @
-Field
+Query
 (%22user_id%22) int 
@@ -1203,37 +1203,37 @@
                @
-Field
+Query
 (%22token%22) String

add an api