feat(t226): add Go ERP session login

This commit is contained in:
QiuSW
2026-07-29 09:51:41 +08:00
parent c2f340d067
commit a5a61c05d0
23 changed files with 1633 additions and 33 deletions
+12
View File
@@ -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,
)