package com.example.aason.zhusha315lianxi.presenter;
import com.example.aason.zhusha315lianxi.contract.UserContract;
import com.example.aason.zhusha315lianxi.model.UserModel;
import java.util.HashMap;
public class UserPresenter extends UserContract.IUserPresenter {
private UserModel model;
private UserContract.IUserView iUserView;
public UserPresenter(UserContract.IUserView iUserView) {
this.iUserView = iUserView;
model = new UserModel();
}
@Override
public void getCart(HashMap<String, String> map) {
model.getCart(map, new UserModel.UserModelCallBack() {
@Override
public void success(Object result) {
iUserView.success(result);
}
@Override
public void fail(Object msg) {
iUserView.fail(msg);
}
});
}
//内存泄漏
public void onDesc(){
if (model != null) {
model=null;
}else if(iUserView!=null){
iUserView=null;
}
}
}