| | |
| | | import com.stylefeng.guns.modular.system.model.Problem; |
| | | import com.stylefeng.guns.modular.system.model.SensitiveWords; |
| | | import com.stylefeng.guns.modular.system.service.IProblemService; |
| | | 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; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private SensitiveWordsMapper sensitiveWordsMapper; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil leaveMessage(String content, Integer uid) throws Exception { |
| | | public ResultUtil leaveMessage(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 ? "Message is too long" : "Le message est trop long"); |
| | | } |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | | for(SensitiveWords s : sensitiveWords){ |