|
@@ -0,0 +1,38 @@
|
|
|
+package org.jeecg.modules.adweb.seo.service;
|
|
|
+
|
|
|
+import io.github.dataforseo.client.api.SerpApi;
|
|
|
+import io.github.dataforseo.client.model.SerpGoogleOrganicLiveAdvancedRequestInfo;
|
|
|
+import io.github.dataforseo.client.model.SerpGoogleOrganicLiveAdvancedResponseInfo;
|
|
|
+
|
|
|
+import org.junit.jupiter.api.Test;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
|
+import org.springframework.test.context.ActiveProfiles;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
|
|
+@ActiveProfiles("dev")
|
|
|
+public class DataForSEOTest {
|
|
|
+
|
|
|
+ @Autowired private SerpApi serpApi;
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testSerpGoogleOrganic() throws Exception {
|
|
|
+ SerpGoogleOrganicLiveAdvancedRequestInfo task =
|
|
|
+ new SerpGoogleOrganicLiveAdvancedRequestInfo();
|
|
|
+
|
|
|
+ task.setLocationCode(2840);
|
|
|
+ task.setLanguageCode("en");
|
|
|
+ task.setKeyword("Aluminum Plastic Composite Panel Extrusion Line");
|
|
|
+
|
|
|
+ List<SerpGoogleOrganicLiveAdvancedRequestInfo> serpTaskRequestInfo =
|
|
|
+ new ArrayList<SerpGoogleOrganicLiveAdvancedRequestInfo>();
|
|
|
+ serpTaskRequestInfo.add(task);
|
|
|
+
|
|
|
+ SerpGoogleOrganicLiveAdvancedResponseInfo result =
|
|
|
+ serpApi.googleOrganicLiveAdvanced(serpTaskRequestInfo);
|
|
|
+ System.out.println(result);
|
|
|
+ }
|
|
|
+}
|