|
|
@@ -19,6 +19,7 @@ import com.webrain.happywork.ui.mvp.contacts.DemandDetailContacts;
|
|
|
|
|
|
public class DemandDetailModel extends BaseModel implements DemandDetailContacts.IDemandDetailModel {
|
|
|
private String requirementId;
|
|
|
+ private boolean needEnrollment;
|
|
|
private RequirementBean mBean;
|
|
|
|
|
|
public DemandDetailModel(Context mContext) {
|
|
|
@@ -46,7 +47,7 @@ public class DemandDetailModel extends BaseModel implements DemandDetailContacts
|
|
|
* @param callBack
|
|
|
*/
|
|
|
@Override
|
|
|
- public void getRequirementDetail(final MvpDataCallBack<RequirementBean> callBack) {
|
|
|
+ public void getRequirementDetail(final MvpDataCallBack<Boolean> callBack) {
|
|
|
RetrofitHttpParams params = new RetrofitHttpParams(mContext);
|
|
|
params.put("hwRequirementId", requirementId);
|
|
|
RequirementSubscribe requirementSubscribe = new RequirementSubscribe(mContext);
|
|
|
@@ -54,10 +55,12 @@ public class DemandDetailModel extends BaseModel implements DemandDetailContacts
|
|
|
@Override
|
|
|
public void onSuccess(ApiRequirementDetailBean data) {
|
|
|
if (data != null) {
|
|
|
- if (data.getHwRequirementAPI() != null)
|
|
|
+ if (data.getHwRequirementAPI() != null) {
|
|
|
mBean = data.getHwRequirementAPI();
|
|
|
+ needEnrollment = data.isNeedEnrollment();
|
|
|
+ }
|
|
|
if (mBean != null)
|
|
|
- callBack.onData(mBean);
|
|
|
+ callBack.onData(true);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -73,6 +76,36 @@ public class DemandDetailModel extends BaseModel implements DemandDetailContacts
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 返回需求对象
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public RequirementBean getRequirementBean() {
|
|
|
+ return mBean;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 返回是否可以报名
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean isNeedEnrollment() {
|
|
|
+ return needEnrollment;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置是否可以报名
|
|
|
+ *
|
|
|
+ * @param isNeedEnrollment
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void setIsNeedEnrollment(boolean isNeedEnrollment) {
|
|
|
+ this.needEnrollment = isNeedEnrollment;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取岗位详情
|