定义接口

This commit is contained in:
2025-09-13 14:09:22 +08:00
parent 32e260ed73
commit 986bdf15a6
6 changed files with 900 additions and 4 deletions

View File

@@ -55,10 +55,13 @@ func NewApplication(configPath string) (*Application, error) {
// 7. 初始化设备仓库
deviceRepo := repository.NewGormDeviceRepository(storage.GetDB())
// 8. 初始化 API 服务器
apiServer := api.NewAPI(cfg.Server, logger, userRepo, deviceRepo, tokenService)
// 8. 初始化计划仓库
planRepo := repository.NewGormPlanRepository(storage.GetDB())
// 9. 组装 Application 对象
// 9. 初始化 API 服务器
apiServer := api.NewAPI(cfg.Server, logger, userRepo, deviceRepo, planRepo, tokenService)
// 10. 组装 Application 对象
app := &Application{
Config: cfg,
Logger: logger,