重构架构

This commit is contained in:
2026-02-20 18:44:43 +08:00
parent aba7b68439
commit cc71248ef4
52 changed files with 1404 additions and 2360 deletions

19
internal/cli/init/init.go Normal file
View File

@@ -0,0 +1,19 @@
package initcmd
import (
"github.com/spf13/cobra"
)
// 仅定义 Cmd 注册子命令,只负责组装命令树,尽量不包含业务逻辑
func NewInitCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "init",
Short: "初始化集群配置",
Long: "初始化 SunHPC 配置文件、数据库、系统参数及相关服务",
}
cmd.AddCommand(NewInitDBCmd())
cmd.AddCommand(NewInitCfgCmd())
return cmd
}