feat: add main_test.go
This commit is contained in:
@@ -26,8 +26,8 @@ func Default(providers ...container.ProviderContainer) container.Providers {
|
|||||||
}, providers...)
|
}, providers...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Command() atom.Option {
|
func Options() []atom.Option {
|
||||||
return atom.Command(
|
return []atom.Option{
|
||||||
atom.Name("model"),
|
atom.Name("model"),
|
||||||
atom.Short("run model generator"),
|
atom.Short("run model generator"),
|
||||||
atom.RunE(Serve),
|
atom.RunE(Serve),
|
||||||
@@ -36,7 +36,11 @@ func Command() atom.Option {
|
|||||||
cmd.Flags().String("path", "./database/models", "generate to path")
|
cmd.Flags().String("path", "./database/models", "generate to path")
|
||||||
cmd.Flags().String("transform", "./database/.transform.yaml", "transform config")
|
cmd.Flags().String("transform", "./database/.transform.yaml", "transform config")
|
||||||
}),
|
}),
|
||||||
)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func Command() atom.Option {
|
||||||
|
return atom.Command(Options()...)
|
||||||
}
|
}
|
||||||
|
|
||||||
type Migrate struct {
|
type Migrate struct {
|
||||||
|
|||||||
16
backend/main_test.go
Executable file
16
backend/main_test.go
Executable 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user