package com.wd.workoffice.model;

import com.wd.workoffice.retrofit.ApiService;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.contract.LoginContract;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.util.WorkUtils;

import java.util.Map;

import flexible.xd.android_base.network.rtfhttp.RtfHelper;
import io.reactivex.Observable;
import retrofit2.Call;

/**
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public class LoginModel implements LoginContract.Model {
    @Override
    public Observable<BaseBean> getCode(String phone, String type) {
        return RtfUtils.getRtf().code(phone, type);
    }

    @Override
    public Call<BaseBean> login(String type, Map<String, Object> param) {
        return RtfUtils.getRtf().login(type, WorkUtils.convertMapToBody(param));
    }

    public static LoginModel newInstance() {
        return new LoginModel();
    }
}
