Files
ops-assistant/internal/module/mail/commands.go
2026-03-19 21:23:28 +08:00

26 lines
626 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package mail
import (
"fmt"
coremodule "ops-assistant/internal/core/module"
)
func commandSpecs() []coremodule.CommandSpec {
return []coremodule.CommandSpec{
{
Prefixes: []string{"/mail status"},
Template: coremodule.CommandTemplate{
RunbookName: "mail_status",
Gate: coremodule.Gate{
NeedFlag: "enable_module_mail",
AllowDryRun: true,
},
DryRunMsg: "🧪 dry-run: 将执行 /mail status未实际执行",
SuccessMsg: func(jobID uint) string { return fmt.Sprintf("✅ /mail status 已执行job=%d", jobID) },
},
ErrPrefix: "/mail status 执行失败: ",
},
}
}