命名优化提交

This commit is contained in:
张家训
2026-06-09 09:16:35 +08:00
parent 213436c989
commit f7c9a4c2fe
31 changed files with 352 additions and 1264 deletions
@@ -1,7 +1,7 @@
package com.example.workutils;
import com.example.workutils.system.tool.Tool;
import com.example.workutils.system.tool.Registry;
import com.example.workutils.system.tool.ToolRegistry;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
@@ -16,10 +16,10 @@ import java.util.Scanner;
@Slf4j
public class WorkUtilsApplication implements CommandLineRunner {
private final Registry registry;
private final ToolRegistry toolRegistry;
public WorkUtilsApplication(Registry registry) {
this.registry = registry;
public WorkUtilsApplication(ToolRegistry toolRegistry) {
this.toolRegistry = toolRegistry;
}
public static void main(String[] args) {
@@ -37,7 +37,7 @@ public class WorkUtilsApplication implements CommandLineRunner {
private void showInteractiveMenu() {
Scanner scanner = new Scanner(System.in);
registry.runMainMenu(scanner);
toolRegistry.runMainMenu(scanner);
}
/**
@@ -47,7 +47,7 @@ public class WorkUtilsApplication implements CommandLineRunner {
private void processCommand(String... args) throws Exception {
String command = args[0].toLowerCase();
Optional<Tool> toolOpt = registry.getToolByCommand(command);
Optional<Tool> toolOpt = toolRegistry.getToolByCommand(command);
if (toolOpt.isPresent()) {
Tool tool = toolOpt.get();
try {