feat(t227): query ERP directly from Go
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
||||
"cmroubao/backend-api/internal/config"
|
||||
"cmroubao/backend-api/internal/platform/assetstore"
|
||||
"cmroubao/backend-api/internal/platform/database"
|
||||
"cmroubao/backend-api/internal/platform/erpconnector"
|
||||
"cmroubao/backend-api/internal/platform/migration"
|
||||
"cmroubao/backend-api/internal/platform/password"
|
||||
"cmroubao/backend-api/internal/platform/shunyunbao"
|
||||
@@ -219,18 +218,6 @@ func buildRouter(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
erpTimeout := cfg.ERPConnectorTimeout
|
||||
if erpTimeout <= 0 {
|
||||
erpTimeout = 90 * time.Second
|
||||
}
|
||||
erpClient, err := erpconnector.New(
|
||||
cfg.ERPConnectorURL,
|
||||
cfg.ERPConnectorAPIKey,
|
||||
erpTimeout,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
erpSession, err := shunyunbao.NewSessionManager(shunyunbao.SessionConfig{
|
||||
BaseURL: cfg.ShunyunbaoURL,
|
||||
Username: cfg.ShunyunbaoUsername,
|
||||
@@ -242,10 +229,10 @@ func buildRouter(
|
||||
}
|
||||
freight, err := usecase.NewFreightService(
|
||||
store,
|
||||
erpClient,
|
||||
erpSession,
|
||||
clock,
|
||||
ids,
|
||||
erpTimeout,
|
||||
90*time.Second,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user