修改密码
This commit is contained in:
@@ -25,7 +25,7 @@ public class DeviceContract {
|
||||
void editDeviceInfo(JSONObject json, IndexContract.CallBack callBack);
|
||||
|
||||
//删除设备信息
|
||||
void deleteDevice(String id,JSONObject json, IndexContract.CallBack callBack);
|
||||
void deleteDevice(String id, IndexContract.CallBack callBack);
|
||||
|
||||
//手动开启关闭设备
|
||||
void turnOnOffDevice(JSONObject json, IndexContract.CallBack callBack);
|
||||
|
||||
@@ -130,11 +130,10 @@ public class DeviceImpl implements DeviceContract.DataModel{
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
* @param json
|
||||
* @param callBack
|
||||
*/
|
||||
@Override
|
||||
public void deleteDevice(String devID,JSONObject json, IndexContract.CallBack callBack) {
|
||||
public void deleteDevice(String devID, IndexContract.CallBack callBack) {
|
||||
try {
|
||||
NetWorkManager.getRequest().unBindDevice(NetWorkManager.getToken(), devID)
|
||||
.subscribeOn(Schedulers.io())
|
||||
|
||||
@@ -114,29 +114,20 @@ public class DevicePresenter extends BasePresenter<DeviceContract.DeviceView> {
|
||||
* @param deviceEntity
|
||||
*/
|
||||
public void unBindDevice(IndexDeviceEntity deviceEntity) {
|
||||
try {
|
||||
// 构造JSON数组格式的请求体 ["2052921001527869441"]
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.put(deviceEntity.getId());
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("ids", jsonArray);
|
||||
impl.deleteDevice(deviceEntity.getId(),json, new IndexContract.CallBack<BaseBean>() {
|
||||
@Override
|
||||
public void success(BaseBean bean, int total) {
|
||||
if (DevicePresenter.this.getView() != null) {
|
||||
DevicePresenter.this.getView().deleteDeviceSuccess(bean);
|
||||
}
|
||||
impl.deleteDevice(deviceEntity.getId(), new IndexContract.CallBack<BaseBean>() {
|
||||
@Override
|
||||
public void success(BaseBean bean, int total) {
|
||||
if (DevicePresenter.this.getView() != null) {
|
||||
DevicePresenter.this.getView().deleteDeviceSuccess(bean);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fail(String msg) {
|
||||
if (DevicePresenter.this.getView() != null) {
|
||||
DevicePresenter.this.getView().showError(msg);
|
||||
}
|
||||
@Override
|
||||
public void fail(String msg) {
|
||||
if (DevicePresenter.this.getView() != null) {
|
||||
DevicePresenter.this.getView().showError(msg);
|
||||
}
|
||||
});
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user