From 8ddcdeedff25aa937a771769a369461b8e2d6ead Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 05 二月 2021 17:14:43 +0800
Subject: [PATCH] 加入 题目选项 功能
---
service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java | 97 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 97 insertions(+), 0 deletions(-)
diff --git a/service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java b/service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java
index ad34de5..f77c464 100644
--- a/service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java
+++ b/service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java
@@ -3,8 +3,10 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.dto.questionAnswer.QuestionAnswerDto;
import com.java110.dto.questionAnswerTitle.QuestionAnswerTitleDto;
+import com.java110.dto.questionAnswerTitleValue.QuestionAnswerTitleValueDto;
import com.java110.po.questionAnswer.QuestionAnswerPo;
import com.java110.po.questionAnswerTitle.QuestionAnswerTitlePo;
+import com.java110.po.questionAnswerTitleValue.QuestionAnswerTitleValuePo;
import com.java110.user.bmo.questionAnswer.IDeleteQuestionAnswerBMO;
import com.java110.user.bmo.questionAnswer.IGetQuestionAnswerBMO;
import com.java110.user.bmo.questionAnswer.ISaveQuestionAnswerBMO;
@@ -13,6 +15,10 @@
import com.java110.user.bmo.questionAnswerTitle.IGetQuestionAnswerTitleBMO;
import com.java110.user.bmo.questionAnswerTitle.ISaveQuestionAnswerTitleBMO;
import com.java110.user.bmo.questionAnswerTitle.IUpdateQuestionAnswerTitleBMO;
+import com.java110.user.bmo.questionAnswerTitleValue.IDeleteQuestionAnswerTitleValueBMO;
+import com.java110.user.bmo.questionAnswerTitleValue.IGetQuestionAnswerTitleValueBMO;
+import com.java110.user.bmo.questionAnswerTitleValue.ISaveQuestionAnswerTitleValueBMO;
+import com.java110.user.bmo.questionAnswerTitleValue.IUpdateQuestionAnswerTitleValueBMO;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,6 +49,17 @@
@Autowired
private IGetQuestionAnswerTitleBMO getQuestionAnswerTitleBMOImpl;
+
+ @Autowired
+ private ISaveQuestionAnswerTitleValueBMO saveQuestionAnswerTitleValueBMOImpl;
+ @Autowired
+ private IUpdateQuestionAnswerTitleValueBMO updateQuestionAnswerTitleValueBMOImpl;
+ @Autowired
+ private IDeleteQuestionAnswerTitleValueBMO deleteQuestionAnswerTitleValueBMOImpl;
+
+ @Autowired
+ private IGetQuestionAnswerTitleValueBMO getQuestionAnswerTitleValueBMOImpl;
+
/**
* 寰俊淇濆瓨娑堟伅妯℃澘
@@ -216,4 +233,84 @@
questionAnswerTitleDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.endsWith(objType) ? communityId : storeId);
return getQuestionAnswerTitleBMOImpl.get(questionAnswerTitleDto);
}
+
+ /**
+ * 寰俊淇濆瓨娑堟伅妯℃澘
+ * @serviceCode /questionAnswer/saveQuestionAnswerTitleValue
+ * @path /app/questionAnswer/saveQuestionAnswerTitleValue
+ * @param reqJson
+ * @return
+ */
+ @RequestMapping(value = "/saveQuestionAnswerTitleValue", method = RequestMethod.POST)
+ public ResponseEntity<String> saveQuestionAnswerTitleValue(@RequestBody JSONObject reqJson) {
+
+ Assert.hasKeyAndValue(reqJson, "titleId", "璇锋眰鎶ユ枃涓湭鍖呭惈titleId");
+ Assert.hasKeyAndValue(reqJson, "qaValue", "璇锋眰鎶ユ枃涓湭鍖呭惈qaValue");
+ Assert.hasKeyAndValue(reqJson, "objType", "璇锋眰鎶ユ枃涓湭鍖呭惈objType");
+ Assert.hasKeyAndValue(reqJson, "seq", "璇锋眰鎶ユ枃涓湭鍖呭惈seq");
+
+
+ QuestionAnswerTitleValuePo questionAnswerTitleValuePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitleValuePo.class);
+ return saveQuestionAnswerTitleValueBMOImpl.save(questionAnswerTitleValuePo);
+ }
+
+ /**
+ * 寰俊淇敼娑堟伅妯℃澘
+ * @serviceCode /questionAnswer/updateQuestionAnswerTitleValue
+ * @path /app/questionAnswer/updateQuestionAnswerTitleValue
+ * @param reqJson
+ * @return
+ */
+ @RequestMapping(value = "/updateQuestionAnswerTitleValue", method = RequestMethod.POST)
+ public ResponseEntity<String> updateQuestionAnswerTitleValue(@RequestBody JSONObject reqJson) {
+
+ Assert.hasKeyAndValue(reqJson, "titleId", "璇锋眰鎶ユ枃涓湭鍖呭惈titleId");
+ Assert.hasKeyAndValue(reqJson, "qaValue", "璇锋眰鎶ユ枃涓湭鍖呭惈qaValue");
+ Assert.hasKeyAndValue(reqJson, "objType", "璇锋眰鎶ユ枃涓湭鍖呭惈objType");
+ Assert.hasKeyAndValue(reqJson, "seq", "璇锋眰鎶ユ枃涓湭鍖呭惈seq");
+ Assert.hasKeyAndValue(reqJson, "valueId", "valueId涓嶈兘涓虹┖");
+
+
+ QuestionAnswerTitleValuePo questionAnswerTitleValuePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitleValuePo.class);
+ return updateQuestionAnswerTitleValueBMOImpl.update(questionAnswerTitleValuePo);
+ }
+
+ /**
+ * 寰俊鍒犻櫎娑堟伅妯℃澘
+ * @serviceCode /questionAnswer/deleteQuestionAnswerTitleValue
+ * @path /app/questionAnswer/deleteQuestionAnswerTitleValue
+ * @param reqJson
+ * @return
+ */
+ @RequestMapping(value = "/deleteQuestionAnswerTitleValue", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteQuestionAnswerTitleValue(@RequestBody JSONObject reqJson) {
+ Assert.hasKeyAndValue(reqJson, "communityId", "灏忓尯ID涓嶈兘涓虹┖");
+
+ Assert.hasKeyAndValue(reqJson, "valueId", "valueId涓嶈兘涓虹┖");
+
+
+ QuestionAnswerTitleValuePo questionAnswerTitleValuePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitleValuePo.class);
+ return deleteQuestionAnswerTitleValueBMOImpl.delete(questionAnswerTitleValuePo);
+ }
+
+ /**
+ * 寰俊鍒犻櫎娑堟伅妯℃澘
+ * @serviceCode /questionAnswer/queryQuestionAnswerTitleValue
+ * @path /app/questionAnswer/queryQuestionAnswerTitleValue
+ * @param communityId 灏忓尯ID
+ * @return
+ */
+ @RequestMapping(value = "/queryQuestionAnswerTitleValue", method = RequestMethod.GET)
+ public ResponseEntity<String> queryQuestionAnswerTitleValue(@RequestHeader(value = "store-id") String storeId,
+ @RequestParam(value = "communityId", required = false) String communityId,
+ @RequestParam(value = "objType") String objType,
+ @RequestParam(value = "page") int page,
+ @RequestParam(value = "row") int row) {
+ QuestionAnswerTitleValueDto questionAnswerTitleValueDto = new QuestionAnswerTitleValueDto();
+ questionAnswerTitleValueDto.setPage(page);
+ questionAnswerTitleValueDto.setRow(row);
+ questionAnswerTitleValueDto.setObjType(objType);
+ questionAnswerTitleValueDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.endsWith(objType) ? communityId : storeId);
+ return getQuestionAnswerTitleValueBMOImpl.get(questionAnswerTitleValueDto);
+ }
}
--
Gitblit v1.8.0