修改有关于设备相关的接口,入参参数更改
This commit is contained in:
@@ -59,7 +59,7 @@ public class DeviceControlActivity extends BaseActivity<DeviceControlLayoutBindi
|
||||
mDeviceEntity = (WaterDeviceEntity) bundle.getSerializable("device_info");
|
||||
if(mDeviceEntity != null){
|
||||
showLoadingDialog();
|
||||
mPresenter.getDeviceDetailInfo(mDeviceEntity.getId());
|
||||
mPresenter.getDeviceDetailInfo(mDeviceEntity.getDeviceNo());
|
||||
viewBinding.includedTitle.tvTitle.setText(mDeviceEntity.getDeviceName());
|
||||
if(mDeviceEntity.getWorkStatus().equals("1")){
|
||||
viewBinding.tvDeviceStatus.setText(getString(R.string.device_status_working));
|
||||
|
||||
@@ -19,7 +19,7 @@ public class DeviceImpl implements DeviceContract.DataModel{
|
||||
|
||||
@Override
|
||||
public void getDeviceInfomation(Map<String, String> map, IndexContract.CallBack callBack) {
|
||||
String deviceID = map.get("id");
|
||||
String deviceID = map.get("deviceNo");
|
||||
NetWorkManager.getRequest().getDeviceDetailInfo(NetWorkManager.getToken(), deviceID)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.unsubscribeOn(Schedulers.io())
|
||||
@@ -132,9 +132,9 @@ public class DeviceImpl implements DeviceContract.DataModel{
|
||||
* @param callBack
|
||||
*/
|
||||
@Override
|
||||
public void deleteDevice(String devID, IndexContract.CallBack callBack) {
|
||||
public void deleteDevice(String deviceNo, IndexContract.CallBack callBack) {
|
||||
try {
|
||||
NetWorkManager.getRequest().unBindDevice(NetWorkManager.getToken(), devID)
|
||||
NetWorkManager.getRequest().unBindDevice(NetWorkManager.getToken(), deviceNo)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.unsubscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
@@ -55,11 +55,11 @@ public class DevicePresenter extends BasePresenter<DeviceContract.DeviceView> {
|
||||
|
||||
/**
|
||||
* 获取设备详情信息
|
||||
* @param deviceID
|
||||
* @param deviceNo
|
||||
*/
|
||||
public void getDeviceDetailInfo(String deviceID) {
|
||||
public void getDeviceDetailInfo(String deviceNo) {
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("id",deviceID);
|
||||
map.put("deviceNo",deviceNo);
|
||||
impl.getDeviceInfomation(map, new IndexContract.CallBack<WaterDeviceEntity>() {
|
||||
@Override
|
||||
public void success(WaterDeviceEntity bean, int total) {
|
||||
@@ -84,7 +84,7 @@ public class DevicePresenter extends BasePresenter<DeviceContract.DeviceView> {
|
||||
public void updateDeviceInfo(WaterDeviceEntity mDeviceEntity) {
|
||||
try {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id",mDeviceEntity.getId());
|
||||
json.put("deviceNo",mDeviceEntity.getDeviceNo());
|
||||
json.put("deviceName",mDeviceEntity.getDeviceName());
|
||||
json.put("wifiName",mDeviceEntity.getWifiName());
|
||||
json.put("wifiPassword",mDeviceEntity.getWifiPassword());
|
||||
@@ -113,7 +113,7 @@ public class DevicePresenter extends BasePresenter<DeviceContract.DeviceView> {
|
||||
* @param deviceEntity
|
||||
*/
|
||||
public void unBindDevice(WaterDeviceEntity deviceEntity) {
|
||||
impl.deleteDevice(deviceEntity.getId(), new IndexContract.CallBack<BaseBean>() {
|
||||
impl.deleteDevice(deviceEntity.getDeviceNo(), new IndexContract.CallBack<BaseBean>() {
|
||||
@Override
|
||||
public void success(BaseBean bean, int total) {
|
||||
if (DevicePresenter.this.getView() != null) {
|
||||
|
||||
Reference in New Issue
Block a user