Browse Source

删除 'src/main/java/com/example/datacollect/model/HistoryCommand.java'

main
Songrui 3 weeks ago
parent
commit
83bcdad594
  1. 33
      src/main/java/com/example/datacollect/model/HistoryCommand.java

33
src/main/java/com/example/datacollect/model/HistoryCommand.java

@ -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<String> commandHistory;
public HistoryCommand(ConsoleView view, List<String> commandHistory) {
this.view = view;
this.commandHistory = commandHistory;
}
@Override
public String getName() {
return "history";
}
@Override
public void execute(String[] args, List<Article> 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));
}
}
}
Loading…
Cancel
Save