From bd5f13810069dc1ebd5008489882289e7131dcc9 Mon Sep 17 00:00:00 2001 From: LeiJuntao <2606542098@qq.com> Date: Sun, 31 May 2026 15:13:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'project/java-cli/src/main?= =?UTF-8?q?/java/com/example/datacollect/command/HistoryCommand.java'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacollect/command/HistoryCommand.java | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 project/java-cli/src/main/java/com/example/datacollect/command/HistoryCommand.java diff --git a/project/java-cli/src/main/java/com/example/datacollect/command/HistoryCommand.java b/project/java-cli/src/main/java/com/example/datacollect/command/HistoryCommand.java deleted file mode 100644 index 2162e08..0000000 --- a/project/java-cli/src/main/java/com/example/datacollect/command/HistoryCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.example.datacollect.command; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.example.datacollect.repository.ArticleRepository; -import com.example.datacollect.view.ConsoleView; - -import java.util.List; - -public class HistoryCommand implements Command { - private static final Logger logger = LoggerFactory.getLogger(HistoryCommand.class); - - private final ConsoleView view; - private final List history; - - public HistoryCommand(ConsoleView view, List history) { - this.view = view; - this.history = history; - } - - @Override - public String getName() { - return "history"; - } - - @Override - public void execute(String[] args, ArticleRepository repository) { - logger.debug("Displaying command history with {} entries", history.size()); - if (history.isEmpty()) { - view.printInfo("No command history."); - return; - } - for (int i = 0; i < history.size(); i++) { - System.out.println((i + 1) + ". " + history.get(i)); - } - } -} \ No newline at end of file