|
|
@@ -4,7 +4,9 @@ package com.webrain.happywork.ui.mvp.model;
|
|
|
import android.content.Context;
|
|
|
import android.text.TextUtils;
|
|
|
|
|
|
+import com.webrain.baselibrary.EventConstant;
|
|
|
import com.webrain.baselibrary.IntentConstant;
|
|
|
+import com.webrain.baselibrary.event.TagValueEvent;
|
|
|
import com.webrain.happywork.AppCacheManager;
|
|
|
import com.webrain.happywork.bean.RequirementBean;
|
|
|
import com.webrain.happywork.bean.api.ApiRequirementDetailBean;
|
|
|
@@ -20,6 +22,8 @@ import com.webrain.happywork.ui.activity.DemandDetailActivity;
|
|
|
import com.webrain.happywork.ui.base.BaseModel;
|
|
|
import com.webrain.happywork.ui.mvp.contacts.DemandDetailContacts;
|
|
|
|
|
|
+import org.greenrobot.eventbus.EventBus;
|
|
|
+
|
|
|
public class DemandDetailModel extends BaseModel implements DemandDetailContacts.IDemandDetailModel {
|
|
|
private String requirementId;
|
|
|
private String enrollId;
|
|
|
@@ -71,15 +75,17 @@ public class DemandDetailModel extends BaseModel implements DemandDetailContacts
|
|
|
|
|
|
/**
|
|
|
* 取消报名
|
|
|
+ *
|
|
|
* @param callBack
|
|
|
*/
|
|
|
@Override
|
|
|
public void requestCancelApply(final MvpDataCallBack<Boolean> callBack) {
|
|
|
RetrofitHttpParams params = new RetrofitHttpParams(mContext);
|
|
|
params.put("enroll_id", enrollId);
|
|
|
- new RequirementSubscribe(mContext).requestCancelEnrollment(params.getRequestParams(), new ApiObserver<ApiNormalBean>(mContext,true) {
|
|
|
+ new RequirementSubscribe(mContext).requestCancelEnrollment(params.getRequestParams(), new ApiObserver<ApiNormalBean>(mContext, true) {
|
|
|
@Override
|
|
|
public void onSuccess(ApiNormalBean data) {
|
|
|
+ EventBus.getDefault().post(new TagValueEvent(EventConstant.EVENT_DEMAND_CANCEL, requirementId));
|
|
|
callBack.onData(true);
|
|
|
}
|
|
|
|
|
|
@@ -148,6 +154,7 @@ public class DemandDetailModel extends BaseModel implements DemandDetailContacts
|
|
|
|
|
|
/**
|
|
|
* 返回是否可以取消
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -157,6 +164,7 @@ public class DemandDetailModel extends BaseModel implements DemandDetailContacts
|
|
|
|
|
|
/**
|
|
|
* 返回enrollId
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -194,9 +202,10 @@ public class DemandDetailModel extends BaseModel implements DemandDetailContacts
|
|
|
if (!TextUtils.isEmpty(lightStr))
|
|
|
params.put("bright_points", lightStr);
|
|
|
RequirementSubscribe requirementSubscribe = new RequirementSubscribe(mContext);
|
|
|
- requirementSubscribe.requestRequirementsApply(params.getRequestParams(), new ApiObserver<ApiNormalBean>(mContext,true) {
|
|
|
+ requirementSubscribe.requestRequirementsApply(params.getRequestParams(), new ApiObserver<ApiNormalBean>(mContext, true) {
|
|
|
@Override
|
|
|
public void onSuccess(ApiNormalBean data) {
|
|
|
+ EventBus.getDefault().post(new TagValueEvent(EventConstant.EVENT_DEMAND_APPLY, requirementId));
|
|
|
callBack.onData(data);
|
|
|
}
|
|
|
|