diff --git a/src/main/java/com/example/datacollect/model/HistoryCommand.java b/src/main/java/com/example/datacollect/model/HistoryCommand.java deleted file mode 100644 index 3d8fd5a..0000000 --- a/src/main/java/com/example/datacollect/model/HistoryCommand.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.example.datacollect.model; - -import com.example.datacollect.command.Command; -import com.example.datacollect.view.ConsoleView; - -import java.util.List; - -public class HistoryCommand implements Command { - private final ConsoleView view; - private final List commandHistory; - - public HistoryCommand(ConsoleView view, List commandHistory) { - this.view = view; - this.commandHistory = commandHistory; - } - - @Override - public String getName() { - return "history"; - } - - @Override - public void execute(String[] args, List
articles) { - if (commandHistory.isEmpty()) { - view.printInfo("暂无命令历史记录"); - return; - } - view.printInfo("命令历史记录:"); - for (int i = 0; i < commandHistory.size(); i++) { - System.out.println((i + 1) + ". " + commandHistory.get(i)); - } - } -}