DI&GIN验证尝试
DI 框架我是没招了,GO 的狗屎接口系统让运行时的DI注入都没办法自动收集接口。 所以...只能捏着鼻子用了。正在想办法解决 GIN 验证框架返回英文的问题
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"Crimson-Gatekeeper/internal/database"
|
||||
"Crimson-Gatekeeper/internal/route"
|
||||
|
||||
"github.com/go-spring/spring-core/gs"
|
||||
)
|
||||
|
||||
type Test struct{}
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
gs.Provide(database.GetDataBaseClient)
|
||||
gs.Provide(database.GetQuery)
|
||||
gs.Provide(route.NewTestBoot).AsRunner()
|
||||
gs.Run()
|
||||
app, err := getApplication()
|
||||
if err != nil {
|
||||
fmt.Println("应用初始化失败")
|
||||
panic(err)
|
||||
}
|
||||
err = app.Start()
|
||||
if err != nil {
|
||||
fmt.Println("应用启动失败")
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user