feat: add main_test.go

This commit is contained in:
Rogee
2024-11-29 17:46:47 +08:00
parent 725a6de5ab
commit a6fc3c5d05
2 changed files with 23 additions and 3 deletions

View File

@@ -26,8 +26,8 @@ func Default(providers ...container.ProviderContainer) container.Providers {
}, providers...)
}
func Command() atom.Option {
return atom.Command(
func Options() []atom.Option {
return []atom.Option{
atom.Name("model"),
atom.Short("run model generator"),
atom.RunE(Serve),
@@ -36,7 +36,11 @@ func Command() atom.Option {
cmd.Flags().String("path", "./database/models", "generate to path")
cmd.Flags().String("transform", "./database/.transform.yaml", "transform config")
}),
)
}
}
func Command() atom.Option {
return atom.Command(Options()...)
}
type Migrate struct {

16
backend/main_test.go Executable file
View File

@@ -0,0 +1,16 @@
package main
import (
"testing"
"backend/common/service/model"
"git.ipao.vip/rogeecn/atom"
)
func Test_GenModel(t *testing.T) {
err := atom.Serve(model.Options()...)
if err != nil {
t.Fatal(err)
}
}