|
|
@@ -20,13 +20,13 @@ package main
|
|
|
import (
|
|
|
"fmt"
|
|
|
"git.sxidc.com/go-framework/baize"
|
|
|
- "git.sxidc.com/go-framework/baize/convenient/binding"
|
|
|
- "git.sxidc.com/go-framework/baize/convenient/binding/request"
|
|
|
- "git.sxidc.com/go-framework/baize/convenient/binding/response"
|
|
|
- "git.sxidc.com/go-framework/baize/framwork/api"
|
|
|
- "git.sxidc.com/go-framework/baize/framwork/application"
|
|
|
- "git.sxidc.com/go-framework/baize/framwork/domain"
|
|
|
- "git.sxidc.com/go-framework/baize/framwork/infrastructure"
|
|
|
+ "git.sxidc.com/go-framework/baize/framework/binding"
|
|
|
+ "git.sxidc.com/go-framework/baize/framework/core/api"
|
|
|
+ "git.sxidc.com/go-framework/baize/framework/core/api/request"
|
|
|
+ "git.sxidc.com/go-framework/baize/framework/core/api/response"
|
|
|
+ "git.sxidc.com/go-framework/baize/framework/core/application"
|
|
|
+ "git.sxidc.com/go-framework/baize/framework/core/domain"
|
|
|
+ "git.sxidc.com/go-framework/baize/framework/core/infrastructure"
|
|
|
DEATH "github.com/vrecan/death"
|
|
|
"net/http"
|
|
|
"syscall"
|
|
|
@@ -52,11 +52,11 @@ func main() {
|
|
|
fmt.Println("Global After2")
|
|
|
})
|
|
|
|
|
|
- rootBinder := app.Binder(application.RouterRoot, "")
|
|
|
+ rootBinder := binding.NewBinder(app.ChooseRouter(api.RouterRoot, ""), app.Infrastructure())
|
|
|
|
|
|
binding.GetBind(rootBinder, &binding.SimpleBindItem[any]{
|
|
|
- Path: "/ping",
|
|
|
- ResponseFunc: response.NoResponse,
|
|
|
+ Path: "/ping",
|
|
|
+ SendResponseFunc: response.NoResponse,
|
|
|
ServiceFunc: func(c *api.Context, params request.Params, objects []domain.Object, i *infrastructure.Infrastructure) (any, error) {
|
|
|
c.String(http.StatusOK, "pong")
|
|
|
return nil, nil
|
|
|
@@ -83,11 +83,11 @@ func main() {
|
|
|
fmt.Println("Global After2")
|
|
|
})
|
|
|
|
|
|
- prefixRootBinder := app.Binder(application.RouterPrefix, "v1")
|
|
|
+ prefixRootBinder := binding.NewBinder(app.ChooseRouter(api.RouterPrefix, "v1"), app.Infrastructure())
|
|
|
|
|
|
binding.GetBind(prefixRootBinder, &binding.SimpleBindItem[any]{
|
|
|
- Path: "/ping",
|
|
|
- ResponseFunc: response.NoResponse,
|
|
|
+ Path: "/ping",
|
|
|
+ SendResponseFunc: response.NoResponse,
|
|
|
ServiceFunc: func(c *api.Context, params request.Params, objects []domain.Object, i *infrastructure.Infrastructure) (any, error) {
|
|
|
c.String(http.StatusOK, "pong")
|
|
|
return nil, nil
|