yanghui
2022-11-17 55f23f21fc836d591e8f86bf2233b87d7b019446
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java
@@ -1,5 +1,7 @@
package com.panzhihua.applets.api;
import cn.hutool.core.util.StrUtil;
import com.panzhihua.applets.weixin.CheckService;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO;
import com.panzhihua.common.model.dtos.shop.*;
@@ -33,6 +35,8 @@
    @Resource
    private CommunityService communityService;
    @Resource
    private CheckService checkService;
    @ApiOperation(value = "查询便民服务商家详情", response = ConvenientMerchantVO.class)
@@ -217,6 +221,13 @@
    @ApiOperation(value = "保存评价")
    @PostMapping("/saveEvaluate")
    public R saveEvaluate(@RequestBody ComShopFlowerEvaluateDTO comShopFlowerEvaluateDTO) {
        String evaluateContent = comShopFlowerEvaluateDTO.getEvaluateContent();
        if (StrUtil.isNotBlank(evaluateContent)) {
            String result = checkService.checkMessageBy(evaluateContent,this.getLoginUserInfo().getOpenid(),this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        return communityService.saveEvaluate(comShopFlowerEvaluateDTO);
    }