...
|
...
|
@@ -8,6 +8,9 @@ import org.springframework.web.bind.annotation.RequestMapping; |
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
@RestController
|
|
|
public class GrassDataSyncController {
|
|
|
|
...
|
...
|
@@ -22,21 +25,35 @@ public class GrassDataSyncController { |
|
|
|
|
|
@RequestMapping("/syncArticle")
|
|
|
public String syncArticle(@RequestParam("startTime") Long startTime, @RequestParam("endTime") Long endTime){
|
|
|
|
|
|
return grassArticleSyncService.syncArticle(startTime, endTime);
|
|
|
ExecutorService executorService = Executors.newSingleThreadExecutor();
|
|
|
executorService.submit(() -> {
|
|
|
grassArticleSyncService.syncArticle(startTime, endTime);
|
|
|
});
|
|
|
executorService.shutdown();
|
|
|
return "success";
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/syncInteractiveData")
|
|
|
public String syncInteractiveData(@RequestParam("startTime") Integer startTime, @RequestParam("endTime") Integer endTime,
|
|
|
@RequestParam("timeType") Integer timeType, @RequestParam("syncType") Integer syncType){
|
|
|
|
|
|
return grassInteractiveDataSyncService.syncInteractiveData(startTime, endTime, timeType, syncType);
|
|
|
ExecutorService executorService = Executors.newSingleThreadExecutor();
|
|
|
executorService.submit(() -> {
|
|
|
grassInteractiveDataSyncService.syncInteractiveData(startTime, endTime, timeType, syncType);
|
|
|
});
|
|
|
executorService.shutdown();
|
|
|
return "success";
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/syncUserData")
|
|
|
public String syncUserData(@RequestParam("startTime") Integer startTime, @RequestParam("endTime") Integer endTime,
|
|
|
@RequestParam("syncType") Integer syncType){
|
|
|
|
|
|
return grassUserDataSyncService.syncGrassUserData(startTime, endTime, syncType);
|
|
|
ExecutorService executorService = Executors.newSingleThreadExecutor();
|
|
|
executorService.submit(() -> {
|
|
|
grassUserDataSyncService.syncGrassUserData(startTime, endTime, syncType);
|
|
|
});
|
|
|
executorService.shutdown();
|
|
|
return "success";
|
|
|
}
|
|
|
} |
...
|
...
|
|