2026-08-28 15:06:01 +08:00
|
|
|
package svc
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"io/fs"
|
|
|
|
|
|
2026-10-20 16:36:26 +08:00
|
|
|
"bj_power_workstation/internal/alertstream"
|
2026-08-28 15:06:01 +08:00
|
|
|
"bj_power_workstation/internal/config"
|
|
|
|
|
"bj_power_workstation/internal/mes"
|
|
|
|
|
"bj_power_workstation/internal/pdfcache"
|
|
|
|
|
"bj_power_workstation/internal/store"
|
|
|
|
|
"bj_power_workstation/internal/syncer"
|
2026-10-14 17:24:59 +08:00
|
|
|
"bj_power_workstation/internal/tightening"
|
2026-08-28 15:06:01 +08:00
|
|
|
)
|
|
|
|
|
|
2026-10-14 17:24:59 +08:00
|
|
|
// ServiceContext 服务上下文:配置 + 本地存储 + MES 客户端 + 同步器 + PDF 缓存 + 前端静态资源 + 拧紧枪 OP 接入
|
2026-08-28 15:06:01 +08:00
|
|
|
type ServiceContext struct {
|
2026-10-20 16:36:26 +08:00
|
|
|
Config config.Config
|
|
|
|
|
Store *store.Store
|
|
|
|
|
Mes *mes.Client
|
|
|
|
|
Syncer *syncer.Syncer
|
|
|
|
|
PdfCache *pdfcache.Cache
|
|
|
|
|
WebFS fs.FS // go:embed 的 web/static 子文件系统
|
|
|
|
|
Tightening *tightening.Manager
|
|
|
|
|
AlertStream *alertstream.Manager // 工位报警事件流(SSE 事件驱动播报)
|
2026-08-28 15:06:01 +08:00
|
|
|
}
|