Java Code Examples for com.example.gs.mvpdemo.bean.LoginBean

The following are top voted examples for showing how to use com.example.gs.mvpdemo.bean.LoginBean. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: RxJavaRetrofitOkhttpMvp   File: LoginModel.java   Source Code and License 6 votes vote down vote up
public boolean login(@NonNull String username, @NonNull String pwd, @NonNull final InfoHint
        infoHint) {

    if (infoHint == null)
        throw new RuntimeException("InfoHint不能为空");

    httpService.login(username, pwd)
            .compose(new CommonTransformer<LoginBean>())
            .subscribe(new CommonSubscriber<LoginBean>(ProApplication.getmContext()) {
                @Override
                public void onNext(LoginBean loginBean) {
                    isLogin = true;
                    infoHint.successInfo(loginBean.getToken());
                }

                @Override
                protected void onError(ApiException e) {
                    super.onError(e);
                    isLogin = false;
                    infoHint.failInfo(e.message);
                }
            });
    return isLogin;
}
 
Example 2
Project: RxJavaRetrofitOkhttpMvp-master   File: LoginModel.java   Source Code and License 5 votes vote down vote up
public boolean login(@NonNull String username, @NonNull String pwd, @NonNull final InfoHint
        infoHint) {
    boolean isLogin = false;

    if (infoHint == null)
        throw new RuntimeException("InfoHint不能为空");

    httpService.login(username, pwd)
            .compose(new CommonTransformer<LoginBean>())
            .subscribe(new CommonSubscriber<LoginBean>(ProApplication.getmContext()) {
                @Override
                public void onNext(LoginBean loginBean) {
                    infoHint.successInfo(loginBean.getToken());
                }

                @Override
                protected void onError(ApiException e) {
                    super.onError(e);
                    infoHint.failInfo(e.message);
                }
            });


    if ("gs".equals(username) && "123".equals(pwd)) {
        isLogin = true;
    } else {
        isLogin = false;
    }
    return isLogin;
}
 
Example 3
Project: BaseMvpOkhttpdemo   File: LoginModel.java   Source Code and License 5 votes vote down vote up
public boolean login(@NonNull String username, @NonNull String pwd, @NonNull final InfoHint
        infoHint) {
    boolean isLogin = false;

    if (infoHint == null)
        throw new RuntimeException("InfoHint不能为空");

    httpService.login(username, pwd)
            .compose(new CommonTransformer<LoginBean>())
            .subscribe(new CommonSubscriber<LoginBean>(ProApplication.getmContext()) {
                @Override
                public void onNext(LoginBean loginBean) {
                    infoHint.successInfo(loginBean.getToken());
                }

                @Override
                protected void onError(ApiException e) {
                    super.onError(e);
                    infoHint.failInfo(e.message);
                }
            });


    if ("gs".equals(username) && "123".equals(pwd)) {
        isLogin = true;
    } else {
        isLogin = false;
    }
    return isLogin;
}
 
Example 4
Project: RxJavaRetrofitOkhttpMvp-master   File: HttpService.java   Source Code and License 4 votes vote down vote up
@FormUrlEncoded
@POST("demo/login")
Observable<BaseHttpResult<LoginBean>> login(@Field("userName") String username, @Field
        ("passWord") String pwd);
 
Example 5
Project: BaseMvpOkhttpdemo   File: HttpService.java   Source Code and License 4 votes vote down vote up
@FormUrlEncoded
@POST("demo/login")
Observable<BaseHttpResult<LoginBean>> login(@Field("userName") String username, @Field
        ("passWord") String pwd);
 
Example 6
Project: RxJavaRetrofitOkhttpMvp   File: HttpService.java   Source Code and License 4 votes vote down vote up
@FormUrlEncoded
@POST("demo/login")
Observable<BaseHttpResult<LoginBean>> login(@Field("userName") String username, @Field
        ("passWord") String pwd);