LoginRegisterApi.java 1.14 KB
package com.shunzhi.parent.api;

import com.google.gson.JsonObject;
import com.shunzhi.parent.bean.CurrentBean;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by Administrator on 2018/3/7 0007.
 */

public interface LoginRegisterApi {
//    String url="http://campus.myjxt.com/";
    String url="http://60.190.202.57:1000/";


    @FormUrlEncoded
    @POST("Token")
    Observable<JsonObject> loginResult(
            @Field("grant_type") String grant_type, @Field("username") String username
            , @Field("password") String password);

    @FormUrlEncoded
    @POST("/api/ParentHelper/ParentRegister")
    Observable<JsonObject> registerResult(
           @Field("mobile") String username, @Field("captcha") String idCode,@Field("password") String password);



    @GET("api/Account/ChangePhoneCaptcha")
    Observable<JsonObject> getidCodeResult(
           @Query("mobile") String username);

    @FormUrlEncoded
    @POST("/api/ParentHelper/GetParentInfo")
    Observable<CurrentBean> getUserInfo();

}