| 
														
															@@ -1,10 +1,13 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 package com.tzld.longarticle.recommend.server; 
														 | 
														
														 | 
														
															 package com.tzld.longarticle.recommend.server; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import cn.hutool.core.io.resource.ResourceUtil; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.alibaba.fastjson.JSONObject; 
														 | 
														
														 | 
														
															 import com.alibaba.fastjson.JSONObject; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.tencentcloudapi.tms.v20201229.models.TextModerationResponse; 
														 | 
														
														 | 
														
															 import com.tencentcloudapi.tms.v20201229.models.TextModerationResponse; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.tzld.longarticle.recommend.server.model.Content; 
														 | 
														
														 | 
														
															 import com.tzld.longarticle.recommend.server.model.Content; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.tzld.longarticle.recommend.server.remote.AIGCRemoteService; 
														 | 
														
														 | 
														
															 import com.tzld.longarticle.recommend.server.remote.AIGCRemoteService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.tzld.longarticle.recommend.server.remote.ArticleSensitiveRemoteService; 
														 | 
														
														 | 
														
															 import com.tzld.longarticle.recommend.server.remote.ArticleSensitiveRemoteService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.tzld.longarticle.recommend.server.repository.crawler.AccountAvgInfoRepository; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.tzld.longarticle.recommend.server.repository.entity.crawler.AccountAvgInfo; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.tzld.longarticle.recommend.server.service.filter.FilterParam; 
														 | 
														
														 | 
														
															 import com.tzld.longarticle.recommend.server.service.filter.FilterParam; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.tzld.longarticle.recommend.server.service.filter.FilterResult; 
														 | 
														
														 | 
														
															 import com.tzld.longarticle.recommend.server.service.filter.FilterResult; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.tzld.longarticle.recommend.server.service.filter.FilterStrategy; 
														 | 
														
														 | 
														
															 import com.tzld.longarticle.recommend.server.service.filter.FilterStrategy; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -20,6 +23,7 @@ import java.io.File; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.nio.charset.StandardCharsets; 
														 | 
														
														 | 
														
															 import java.nio.charset.StandardCharsets; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.nio.file.Files; 
														 | 
														
														 | 
														
															 import java.nio.file.Files; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.List; 
														 | 
														
														 | 
														
															 import java.util.List; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import java.util.Set; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 @SpringBootTest(classes = Application.class) 
														 | 
														
														 | 
														
															 @SpringBootTest(classes = Application.class) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 @Slf4j 
														 | 
														
														 | 
														
															 @Slf4j 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -33,6 +37,8 @@ public class FilterStrategyTest { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     AIGCRemoteService aigcRemoteService; 
														 | 
														
														 | 
														
															     AIGCRemoteService aigcRemoteService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     @Resource 
														 | 
														
														 | 
														
															     @Resource 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     ArticleSensitiveRemoteService articleSensitiveRemoteService; 
														 | 
														
														 | 
														
															     ArticleSensitiveRemoteService articleSensitiveRemoteService; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Resource 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    private AccountAvgInfoRepository accountAvgInfoRepository; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 //    @Test 
														 | 
														
														 | 
														
															 //    @Test 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 //    public void badStrategyTest() { 
														 | 
														
														 | 
														
															 //    public void badStrategyTest() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 //        FilterParam param = new FilterParam(); 
														 | 
														
														 | 
														
															 //        FilterParam param = new FilterParam(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -92,4 +98,15 @@ public class FilterStrategyTest { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             log.error("No JSON files found in the folder."); 
														 | 
														
														 | 
														
															             log.error("No JSON files found in the folder."); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @Test 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    void AccountAvgInfoTest() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String cardJSON = ResourceUtil.readUtf8Str("file/AccountInfo.json"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        JSONObject accountInfo = JSONObject.parseObject(cardJSON); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Set<String> keys = accountInfo.keySet(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        for (String key : keys) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            AccountAvgInfo info = accountInfo.getObject(key, AccountAvgInfo.class); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            accountAvgInfoRepository.save(info); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 |