|
|
@@ -22,6 +22,7 @@ import com.webrain.happywork.ui.mvp.contacts.DemandDetailContacts;
|
|
|
|
|
|
public class DemandDetailModel extends BaseModel implements DemandDetailContacts.IDemandDetailModel {
|
|
|
private String requirementId;
|
|
|
+ private String enrollId;
|
|
|
private boolean needEnrollment;
|
|
|
private boolean displayCancel;
|
|
|
private RequirementBean mBean;
|
|
|
@@ -69,6 +70,26 @@ 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) {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(ApiNormalBean data) {
|
|
|
+ callBack.onData(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFinish() {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取岗位详情
|
|
|
*
|
|
|
* @param callBack
|
|
|
@@ -86,6 +107,7 @@ public class DemandDetailModel extends BaseModel implements DemandDetailContacts
|
|
|
mBean = data.getHwRequirementAPI();
|
|
|
needEnrollment = data.isNeedEnrollment();
|
|
|
displayCancel = data.isDisplayCancel();
|
|
|
+ enrollId = data.getEnrollId();
|
|
|
}
|
|
|
if (mBean != null)
|
|
|
callBack.onData(true);
|
|
|
@@ -134,6 +156,15 @@ public class DemandDetailModel extends BaseModel implements DemandDetailContacts
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 返回enrollId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String getEnrollId() {
|
|
|
+ return enrollId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 设置是否可以报名
|
|
|
*
|
|
|
* @param isNeedEnrollment
|
|
|
@@ -163,7 +194,7 @@ 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) {
|
|
|
+ requirementSubscribe.requestRequirementsApply(params.getRequestParams(), new ApiObserver<ApiNormalBean>(mContext,true) {
|
|
|
@Override
|
|
|
public void onSuccess(ApiNormalBean data) {
|
|
|
callBack.onData(data);
|