feat: replace iot adapter with mqtt command pipeline

This commit is contained in:
2026-08-03 13:18:11 +08:00
parent 6ed417c8c1
commit fefdba470a
48 changed files with 1620 additions and 338 deletions

View File

@@ -0,0 +1,30 @@
package main
import (
"context"
"flag"
"log"
"os/signal"
"syscall"
"git.apinb.com/heqiapp/platforms/backend/iot-server/internal/config"
"git.apinb.com/heqiapp/platforms/backend/iot-server/internal/service"
)
func main() {
path := flag.String("config", "etc/platform_iot_server_dev.yaml", "YAML 配置文件")
flag.Parse()
cfg, err := config.Load(*path)
if err != nil {
log.Fatal(err)
}
srv, err := service.New(cfg)
if err != nil {
log.Fatal(err)
}
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer cancel()
if err = srv.Run(ctx); err != nil {
log.Fatal(err)
}
}