修改密码

This commit is contained in:
fengjignqi
2026-05-21 18:00:42 +08:00
parent c90d26afc1
commit 1b7c8f0c2d
19 changed files with 401 additions and 74 deletions

View File

@@ -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);

View File

@@ -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())

View File

@@ -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);
}
}
});
}
}