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

import com.google.gson.JsonObject;
import com.shunzhi.parent.AppConfig;
import com.shunzhi.parent.bean.UserInfo;

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= AppConfig.BASE_URL;


    @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/ReSetpass")
    Observable<JsonObject> reSetpassResult(
           @Field("mobile") String username, @Field("captcha") String idCode,@Field("pass") String password);



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

    @FormUrlEncoded
    @POST("/api/ParentHelper/GetParentInfo")
    Observable<UserInfo> getUserInfo(@Field("mobile") String mobile, @Field("school_id") int school_id, @Field("captcha") String captcha);

    @GET("api/ParentHelper/ParentJudge")
    Observable<JsonObject> getParentJudge(@Query("mobile") String mobile);
}