|
@@ -5,18 +5,34 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
public class RiskRuleConfigService {
|
|
|
-// @Autowired
|
|
|
-//
|
|
|
-// //过滤规则,打开开关的群生效
|
|
|
-// Map<String, List<RoomListResponse.RoomInfo>> kickOpenedRoom(Map<String, List<RoomListResponse.RoomInfo>> tobeOperate) {
|
|
|
-// Map<String, List<RoomListResponse.RoomInfo>> filterdMap = tobeOperate;
|
|
|
-// return null;
|
|
|
-// }
|
|
|
+ @Autowired
|
|
|
+ private WorkWechatServiceImpl workWechatServiceImpl;
|
|
|
+ Map<String, List<RoomListResponse.RoomInfo>> getKickOpenedRoom(Map<String, List<RoomListResponse.RoomInfo>> tobeOperate) {
|
|
|
+ Map<String, List<RoomListResponse.RoomInfo>> filteredMap = new HashMap<>();
|
|
|
+
|
|
|
+ for (Map.Entry<String, List<RoomListResponse.RoomInfo>> entry : tobeOperate.entrySet()) {
|
|
|
+ List<RoomListResponse.RoomInfo> filteredRooms = new ArrayList<>();
|
|
|
+
|
|
|
+ for (RoomListResponse.RoomInfo room : entry.getValue()) {
|
|
|
+ if (workWechatServiceImpl.checkAutoRemoveUserStatusIsOpen(room.getRoomId())) {
|
|
|
+ filteredRooms.add(room);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!filteredRooms.isEmpty()) {
|
|
|
+ filteredMap.put(entry.getKey(), filteredRooms);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return filteredMap;
|
|
|
+ }
|
|
|
|
|
|
}
|