Files
耗子 ea22c2f0a7 refactor(di): restore compile-time Wire injection
Replace the samber/do runtime container with explicit constructor dependencies and generated Wire graphs for ace and cli. Keep CLI application loading isolated and verify generated files in CI.
2026-07-27 02:54:44 +08:00

43 lines
993 B
Go

package command
import (
"context"
"github.com/leonelquinteros/gotext"
"github.com/urfave/cli/v3"
"github.com/acepanel/panel/v3/internal/service"
)
// HttpsCommand 面板 HTTPS 管理命令组
func HttpsCommand(t *gotext.Locale, cliService *service.CliService) *cli.Command {
return &cli.Command{
Name: "https",
Usage: t.Get("Operate AcePanel HTTPS"),
Commands: []*cli.Command{
{
Name: "on",
Usage: t.Get("Enable HTTPS"),
Action: func(ctx context.Context, cmd *cli.Command) error {
return cliService.HTTPSOn(ctx, cmd)
},
},
{
Name: "off",
Usage: t.Get("Disable HTTPS"),
Action: func(ctx context.Context, cmd *cli.Command) error {
return cliService.HTTPSOff(ctx, cmd)
},
},
{
Name: "generate",
Usage: t.Get("Obtain a free certificate or generate a self-signed certificate"),
Action: func(ctx context.Context, cmd *cli.Command) error {
return cliService.HTTPSGenerate(ctx, cmd)
},
},
},
}
}