1 changed files with 34 additions and 0 deletions
@ -0,0 +1,34 @@ |
|||
package com.example.datacollect; |
|||
|
|||
import com.example.datacollect.controller.CrawlerController; |
|||
import com.example.datacollect.repository.ArticleRepository; |
|||
import com.example.datacollect.strategy.StrategyFactory; |
|||
import com.example.datacollect.view.ConsoleView; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
|
|||
import java.util.Scanner; |
|||
|
|||
public class Main { |
|||
private static final Logger logger = LoggerFactory.getLogger(Main.class); |
|||
|
|||
public static void main(String[] args) { |
|||
logger.info("Starting DataCollect application"); |
|||
|
|||
ConsoleView view = new ConsoleView(); |
|||
ArticleRepository repository = new ArticleRepository(); |
|||
StrategyFactory strategyFactory = new StrategyFactory(); |
|||
CrawlerController controller = new CrawlerController(view, repository, strategyFactory); |
|||
|
|||
view.printInfo("DataCollect Crawler System Started"); |
|||
view.printInfo("Type 'help' for available commands"); |
|||
|
|||
Scanner scanner = new Scanner(System.in); |
|||
|
|||
while (true) { |
|||
System.out.print("> "); |
|||
String input = scanner.nextLine(); |
|||
controller.handle(input); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue