提交 5bfbda52 authored 作者: mooncake's avatar mooncake

单元测试

上级 71f88367
...@@ -103,6 +103,27 @@ func (x *Application) Run() { ...@@ -103,6 +103,27 @@ func (x *Application) Run() {
x.app.Run() x.app.Run()
} }
func (x *Application) Prepare() {
defer goutils.Recover()
ctx := context.TODO()
eventbus.Eb.Publish(ctx, eventbus.TopicParseConf)
eventbus.Eb.Publish(ctx, eventbus.TopicParseConfFinish)
eventbus.Eb.Publish(ctx, eventbus.TopicLoggerInit)
eventbus.Eb.Publish(ctx, eventbus.TopicLoggerInitFinish)
eventbus.Eb.Publish(ctx, eventbus.TopicDBInit)
eventbus.Eb.Publish(ctx, eventbus.TopicDBInitFinish)
eventbus.Eb.Publish(ctx, eventbus.TopicCacheInit)
eventbus.Eb.Publish(ctx, eventbus.TopicCacheInitFinish)
eventbus.Eb.Publish(ctx, eventbus.TopicMiddlewareInit)
eventbus.Eb.Publish(ctx, eventbus.TopicMiddlewareInitFinish)
eventbus.Eb.Publish(ctx, eventbus.TopicCronInit)
eventbus.Eb.Publish(ctx, eventbus.TopicCronInitFinish)
eventbus.Eb.Publish(ctx, eventbus.TopicRdInit)
eventbus.Eb.Publish(ctx, eventbus.TopicRdInitFinish)
eventbus.Eb.Publish(ctx, eventbus.TopicGinEngineCreated)
eventbus.Eb.Publish(ctx, eventbus.TopicPrintSwagger)
}
func New(h func() *gin.Engine) *Application { func New(h func() *gin.Engine) *Application {
return &Application{ return &Application{
h: h, h: h,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论