java110
2021-05-24 78fffad1fffb77ada79a329fc52dcce98661e870
service-user/src/main/java/com/java110/user/api/QuestionAnswerApi.java
old mode 100644 new mode 100755
@@ -147,6 +147,7 @@
    @RequestMapping(value = "/queryQuestionAnswer", method = RequestMethod.GET)
    public ResponseEntity<String> queryQuestionAnswer(
            @RequestHeader(value = "store-id", required = false) String storeId,
            @RequestHeader(value = "user-id", required = false) String userId,
            @RequestParam(value = "communityId", required = false) String communityId,
            @RequestParam(value = "objType", required = false) String objType,
            @RequestParam(value = "page") int page,
@@ -154,6 +155,7 @@
        QuestionAnswerDto questionAnswerDto = new QuestionAnswerDto();
        questionAnswerDto.setPage(page);
        questionAnswerDto.setRow(row);
        questionAnswerDto.setUserId(userId);
        if (!StringUtil.isEmpty(objType)) {
            questionAnswerDto.setObjType(objType);
            questionAnswerDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.equals(objType) ? communityId : storeId);
@@ -192,7 +194,7 @@
        QuestionAnswerTitlePo questionAnswerTitlePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitlePo.class);
        return saveQuestionAnswerTitleBMOImpl.save(questionAnswerTitlePo,titleValues);
        return saveQuestionAnswerTitleBMOImpl.save(questionAnswerTitlePo, titleValues);
    }
    /**
@@ -206,16 +208,23 @@
    @RequestMapping(value = "/updateQuestionAnswerTitle", method = RequestMethod.POST)
    public ResponseEntity<String> updateQuestionAnswerTitle(@RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "qaId", "请求报文中未包含qaId");
//        Assert.hasKeyAndValue(reqJson, "qaId", "请求报文中未包含qaId");
        Assert.hasKeyAndValue(reqJson, "qaTitle", "请求报文中未包含qaTitle");
        Assert.hasKeyAndValue(reqJson, "titleType", "请求报文中未包含titleType");
        Assert.hasKeyAndValue(reqJson, "objType", "请求报文中未包含objType");
        Assert.hasKeyAndValue(reqJson, "seq", "请求报文中未包含seq");
        Assert.hasKeyAndValue(reqJson, "titleId", "titleId不能为空");
        JSONArray titleValues = null;
        if (!QuestionAnswerTitleDto.TITLE_TYPE_QUESTIONS.equals(reqJson.getString("titleType"))) {
            titleValues = reqJson.getJSONArray("titleValues");
            if (titleValues.size() < 1) {
                throw new IllegalArgumentException("未包含选项");
            }
        }
        QuestionAnswerTitlePo questionAnswerTitlePo = BeanConvertUtil.covertBean(reqJson, QuestionAnswerTitlePo.class);
        return updateQuestionAnswerTitleBMOImpl.update(questionAnswerTitlePo);
        return updateQuestionAnswerTitleBMOImpl.update(questionAnswerTitlePo, titleValues);
    }
    /**
@@ -247,6 +256,7 @@
     */
    @RequestMapping(value = "/queryQuestionAnswerTitle", method = RequestMethod.GET)
    public ResponseEntity<String> queryQuestionAnswerTitle(@RequestHeader(value = "store-id", required = false) String storeId,
                                                          // @RequestHeader(value = "user-id", required = false) String userId,
                                                           @RequestParam(value = "communityId", required = false) String communityId,
                                                           @RequestParam(value = "objType") String objType,
                                                           @RequestParam(value = "qaId") String qaId,
@@ -256,6 +266,7 @@
        questionAnswerTitleDto.setPage(page);
        questionAnswerTitleDto.setRow(row);
        questionAnswerTitleDto.setQaId(qaId);
        //questionAnswerTitleDto.setUserId(userId);
        if (!StringUtil.isEmpty(objType)) {
            questionAnswerTitleDto.setObjType(objType);
            questionAnswerTitleDto.setObjId(QuestionAnswerDto.QA_TYPE_COMMUNITY.equals(objType) ? communityId : storeId);