add swagger

This commit is contained in:
yanghao05
2023-06-09 14:32:21 +08:00
parent 37bf456102
commit 3f27dee0b2
23 changed files with 245 additions and 89 deletions

View File

@@ -20,12 +20,8 @@ var (
GroupCommand = dig.Group("command_services")
)
func init() {
}
func Serve(providers container.Providers, opts ...Option) error {
var rootCmd = &cobra.Command{Use: "app"}
rootCmd := &cobra.Command{Use: "app"}
for _, opt := range opts {
opt(rootCmd)
}
@@ -77,6 +73,7 @@ func Long(long string) Option {
cmd.Long = long
}
}
func Run(run func(cmd *cobra.Command, args []string)) Option {
return func(cmd *cobra.Command) {
cmd.Run = run