feat(t226): add Go ERP session login
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"cmroubao/backend-api/internal/platform/erpconnector"
|
||||
"cmroubao/backend-api/internal/platform/migration"
|
||||
"cmroubao/backend-api/internal/platform/password"
|
||||
"cmroubao/backend-api/internal/platform/shunyunbao"
|
||||
repository "cmroubao/backend-api/internal/repository/sqlite"
|
||||
"cmroubao/backend-api/internal/transport/authcommon"
|
||||
"cmroubao/backend-api/internal/transport/httpapi"
|
||||
@@ -230,6 +231,15 @@ func buildRouter(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
erpSession, err := shunyunbao.NewSessionManager(shunyunbao.SessionConfig{
|
||||
BaseURL: cfg.ShunyunbaoURL,
|
||||
Username: cfg.ShunyunbaoUsername,
|
||||
Password: cfg.ShunyunbaoPassword,
|
||||
Timeout: cfg.ShunyunbaoTimeout,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
freight, err := usecase.NewFreightService(
|
||||
store,
|
||||
erpClient,
|
||||
@@ -285,6 +295,7 @@ func buildRouter(
|
||||
return nil, err
|
||||
}
|
||||
webService.SetProcurement(procurement)
|
||||
webService.SetERPConnection(erpSession)
|
||||
renderer, err := webui.NewRenderer()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -328,6 +339,7 @@ func buildRouter(
|
||||
Authorizations: authorizations,
|
||||
Freight: freight,
|
||||
Procurement: procurement,
|
||||
ERP: erpSession,
|
||||
},
|
||||
webHandler,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user