|
@@ -1,5 +1,6 @@
|
|
|
package com.dgtly.member.controller;
|
|
|
|
|
|
+import com.dgtly.apiframework.util.TokenUtil;
|
|
|
import com.dgtly.common.annotation.ApiNoCheckSign;
|
|
|
import com.dgtly.common.annotation.ApiPassToken;
|
|
|
import com.dgtly.common.core.controller.ApiBaseController;
|
|
@@ -7,6 +8,7 @@ import com.dgtly.common.core.domain.AjaxResult;
|
|
|
import com.dgtly.common.core.domain.ParameterObject;
|
|
|
import com.dgtly.common.core.domain.ResultType;
|
|
|
import com.dgtly.common.utils.DateUtils;
|
|
|
+import com.dgtly.common.utils.StringUtils;
|
|
|
import com.dgtly.notice.domain.NoticeDemand;
|
|
|
import com.dgtly.notice.service.INoticeDemandService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -81,18 +83,71 @@ public class DemandInfoController extends ApiBaseController {
|
|
|
return AjaxResult.success(getDataTable(noticeDemandList));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * @descption: 发布需求信息
|
|
|
+ * @param:
|
|
|
+ * @return:
|
|
|
+ * @auther: LiuLingChao
|
|
|
+ * @date: 2020-2-27 16:03
|
|
|
+ */
|
|
|
@PostMapping("/insertDemandInfo")
|
|
|
public Object insertDemandInfo(){
|
|
|
- ParameterObject obj = getParameterObject();
|
|
|
- NoticeDemand noticeDemand = obj.parseBean(NoticeDemand.class);
|
|
|
- noticeDemand.setCreateTime(DateUtils.getNowDate());
|
|
|
- noticeDemand.setReleaseTime(DateUtils.getNowDate());
|
|
|
- int flag = noticeDemandService.insertNoticeDemand(noticeDemand);
|
|
|
- return toAjax(flag);
|
|
|
+ String userId = TokenUtil.getTokenUserId();
|
|
|
+ if(StringUtils.isNotEmpty(userId)){
|
|
|
+ ParameterObject obj = getParameterObject();
|
|
|
+ NoticeDemand noticeDemand = obj.parseBean(NoticeDemand.class);
|
|
|
+ noticeDemand.setMemberId(Long.parseLong(userId));
|
|
|
+ noticeDemand.setCreateTime(DateUtils.getNowDate());
|
|
|
+ noticeDemand.setReleaseTime(DateUtils.getNowDate());
|
|
|
+ int flag = noticeDemandService.insertNoticeDemand(noticeDemand);
|
|
|
+ return toAjax(flag);
|
|
|
+ }else{
|
|
|
+ return AjaxResult.error(301,"获取token信息出错");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+ * @descption: 获取网站用户发布的需求
|
|
|
+ * @param:
|
|
|
+ * @return:
|
|
|
+ * @auther: LiuLingChao
|
|
|
+ * @date: 2020-2-27 16:08
|
|
|
+ */
|
|
|
+ @PostMapping("/getMemberDemandList")
|
|
|
+ public Object getMemberDemandList(){
|
|
|
+ String userId = TokenUtil.getTokenUserId();
|
|
|
+ if(StringUtils.isNotEmpty(userId)){
|
|
|
+ ParameterObject obj = getParameterObject();
|
|
|
+ startPage(obj);
|
|
|
+ NoticeDemand noticeDemand = new NoticeDemand();
|
|
|
+
|
|
|
+ noticeDemand.setMemberId(Long.parseLong(userId));
|
|
|
+ List<NoticeDemand> noticeDemandList = noticeDemandService.selectNoticeDemandList(noticeDemand);
|
|
|
+ return AjaxResult.success(getDataTable(noticeDemandList));
|
|
|
+
|
|
|
+ }else{
|
|
|
+ return AjaxResult.error(301,"获取token信息出错");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * @descption: 撤销需求
|
|
|
+ * @param:
|
|
|
+ * @return:
|
|
|
+ * @auther: LiuLingChao
|
|
|
+ * @date: 2020-2-27 16:17
|
|
|
+ */
|
|
|
+ @PostMapping("/cancleMemberDemandInfo")
|
|
|
+ public Object cancleMemberDemandInfo(){
|
|
|
+ ParameterObject obj = getParameterObject();
|
|
|
+ NoticeDemand noticeDemand = obj.parseBean(NoticeDemand.class);
|
|
|
+ int flag = noticeDemandService.deleteNoticeDemandById(noticeDemand.getId());
|
|
|
+ return toAjax(flag);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|