puzhibing
2022-09-29 e28d33c09405e246a2d75fcb1f69a9e8e9d911b8
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/FeedbackServiceImpl.java
@@ -8,6 +8,7 @@
import com.stylefeng.guns.modular.system.model.SensitiveWords;
import com.stylefeng.guns.modular.system.service.IFeedbackService;
import com.stylefeng.guns.modular.system.service.ISystemNoticeService;
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -26,6 +27,9 @@
    @Autowired
    private ISystemNoticeService systemNoticeService;
    @Autowired
    private IUserInfoService userInfoService;
@@ -36,10 +40,11 @@
     * @throws Exception
     */
    @Override
    public ResultUtil feedback(String content, Integer uid) throws Exception {
    public ResultUtil feedback(String content, Integer uid, Integer language) throws Exception {
        if(ToolUtil.isNotEmpty(content)){
            if(content.length() > 200){
                return ResultUtil.error("反馈内容过长");
                language = userInfoService.queryLanguage(uid, language);
                return ResultUtil.error(language == 1 ? "反馈内容过长" : language == 2 ? "Feedback is too long" : "Les commentaires sont trop longs");
            }
            List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null);
            for(SensitiveWords s : sensitiveWords){
@@ -56,7 +61,8 @@
        feedback.setUserId(uid);
        this.insert(feedback);
        systemNoticeService.addSystemNotice(1, "您的反馈已提交成功,我们会尽快处理!", uid, 1);
        systemNoticeService.addSystemNotice(1, language == 1 ? "您的反馈已提交成功,我们会尽快处理!" : language == 2 ? "Your feedback has been submitted successfully, we will deal with it as soon as possible"
                : "Vos commentaires ont été soumis avec succès, nous les traiterons dès que possible", uid, 1);
        return ResultUtil.success();
    }
}