package com.hdl.photovoltaic.other;
|
|
|
/**
|
* 登陆界面的逻辑
|
*/
|
public class HdlAccountLogic {
|
|
private static volatile HdlAccountLogic sHdlAccountLogic;
|
|
public static synchronized HdlAccountLogic getInstance() {
|
if (sHdlAccountLogic == null) {
|
synchronized (HdlAccountLogic.class) {
|
if (sHdlAccountLogic == null) {
|
sHdlAccountLogic = new HdlAccountLogic();
|
}
|
}
|
|
}
|
return sHdlAccountLogic;
|
}
|
|
|
/**
|
* 初始化账号的Url区域地址(可能状态码:Sucess NotAccount NotNetWork)
|
*
|
* @param i_account
|
* @return
|
*/
|
private void InitAccoutRegionInfo(String i_account) {
|
// String regionUrl = this.GetAccoutRegionInfo(i_account);
|
//
|
//
|
// if (regionUrl == null) {
|
// return AccountStatu.NotNetWork;
|
// }
|
// if (regionUrl == string.Empty) {
|
// return AccountStatu.NotAccount;
|
// }
|
//
|
// return AccountStatu.Sucess;
|
}
|
|
/**
|
* 获取账号所在区域
|
*
|
* @param account
|
* @param callBack
|
* @return https://nearest.hdlcontrol.com/smart-footstone/region/regionByUserAccount
|
*/
|
// public Disposable regionByAccount(String account, IRegionByAccountCallBack callBack) {
|
// String requestUrl = HDLLinkPMSdk.getInitUrl() + HttpApi.POST_RegionByUserAccount;
|
// return HxHttp.builder()
|
// .url(requestUrl)
|
// .params("account", account)
|
// .build()
|
// .post()
|
// .subscribeWith(new HDLResponse<HDLUserRegionBean>() {
|
// @Override
|
// public void onResponse(HDLUserRegionBean response) {
|
// if (callBack != null) {
|
// callBack.onSuccess(response);
|
// }
|
// }
|
//
|
// @Override
|
// public void onFailure(HDLException e) {
|
// HDLExceptionSubmitUtils.submit(requestUrl, account, e);
|
// if (callBack != null) {
|
// callBack.onFailure(e);
|
// }
|
// }
|
// });
|
|
// }
|
}
|