|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -35,12 +36,13 @@ import java.util.stream.Collectors;
|
|
@Slf4j
|
|
@Slf4j
|
|
@Component
|
|
@Component
|
|
@ServerEndpoint(value = "/socket/{sendId}")
|
|
@ServerEndpoint(value = "/socket/{sendId}")
|
|
|
|
+@RequiredArgsConstructor
|
|
public class WebSocketProcess {
|
|
public class WebSocketProcess {
|
|
|
|
|
|
- private final LifeMessageMapper lifeMessageMapper = SpringContext.getBean(LifeMessageMapper.class);
|
|
|
|
- private final BaseRedisService baseRedisService = SpringContext.getBean(BaseRedisService.class);
|
|
|
|
- private final LifeBlacklistMapper lifeBlacklistMapper = SpringContext.getBean(LifeBlacklistMapper.class);
|
|
|
|
- private final TextModerationUtil textModerationUtil = SpringContext.getBean(TextModerationUtil.class);
|
|
|
|
|
|
+ private final LifeMessageMapper lifeMessageMapper;
|
|
|
|
+ private final BaseRedisService baseRedisService;
|
|
|
|
+ private final LifeBlacklistMapper lifeBlacklistMapper;
|
|
|
|
+ private final TextModerationUtil textModerationUtil;
|
|
|
|
|
|
/*
|
|
/*
|
|
* 持有每个webSocket对象,以key-value存储到线程安全ConcurrentHashMap,
|
|
* 持有每个webSocket对象,以key-value存储到线程安全ConcurrentHashMap,
|