|
|
@@ -7,6 +7,7 @@ import com.izouma.nineth.domain.User;
|
|
|
import com.izouma.nineth.exception.BusinessException;
|
|
|
import com.izouma.nineth.repo.PublicScreenChatRepo;
|
|
|
import com.izouma.nineth.repo.UserRepo;
|
|
|
+import com.izouma.nineth.service.ContentAuditService;
|
|
|
import com.izouma.nineth.service.PurchaseLevelService;
|
|
|
import com.izouma.nineth.utils.ApplicationContextUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -40,6 +41,8 @@ public class PublicScreenChatWebsocket extends WebsocketCommon {
|
|
|
|
|
|
private PurchaseLevelService purchaseLevelService;
|
|
|
|
|
|
+ private ContentAuditService contentAuditService;
|
|
|
+
|
|
|
private void init() {
|
|
|
if (Objects.isNull(publicScreenChatRepo)) {
|
|
|
publicScreenChatRepo = (PublicScreenChatRepo) ApplicationContextUtil.getBean("publicScreenChatRepo");
|
|
|
@@ -50,6 +53,9 @@ public class PublicScreenChatWebsocket extends WebsocketCommon {
|
|
|
if (Objects.isNull(purchaseLevelService)) {
|
|
|
purchaseLevelService = (PurchaseLevelService) ApplicationContextUtil.getBean("purchaseLevelService");
|
|
|
}
|
|
|
+ if (Objects.isNull(contentAuditService)) {
|
|
|
+ contentAuditService = (ContentAuditService) ApplicationContextUtil.getBean("contentAuditService");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@OnOpen
|
|
|
@@ -112,6 +118,9 @@ public class PublicScreenChatWebsocket extends WebsocketCommon {
|
|
|
exceptionHandle(userId, errMsg);
|
|
|
return;
|
|
|
}
|
|
|
+ if (!contentAuditService.auditText(message)) {
|
|
|
+ exceptionHandle(userId, "消息包含非法内容");
|
|
|
+ }
|
|
|
PublicScreenChat publicScreenChat;
|
|
|
try {
|
|
|
publicScreenChat = savePublicScreenChat(userId, message);
|