1 changed files with 23 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||||
|
package org.example; |
||||
|
|
||||
|
import org.example.command.Command; |
||||
|
import org.example.command.SearchCommand; |
||||
|
import org.example.service.CrawlerService; |
||||
|
import java.util.Scanner; |
||||
|
|
||||
|
public class Main { |
||||
|
public static void main(String[] args) { |
||||
|
System.out.println("简易搜索引擎启动"); |
||||
|
|
||||
|
// 1. 初始化 Service
|
||||
|
CrawlerService service = new CrawlerService(); |
||||
|
|
||||
|
// 2. 初始化 Command (注入 Service)
|
||||
|
Command searchCmd = new SearchCommand(service); |
||||
|
|
||||
|
// 3. 执行命令
|
||||
|
searchCmd.execute(); |
||||
|
|
||||
|
System.out.println("程序结束"); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue