package main

import (
	"netease_control_center/globals"
	"netease_control_center/interfaces/http"
	"netease_control_center/interfaces/log"
	"netease_control_center/manufacture"
	"netease_control_center/modules"
	"os"
	"time"
)

var (
	BuildDate    string
	BuildVersion string
	Tag          string
	Hv           string
)

func main() {
	globals.StartTime = time.Now()
	log.Init()
	log.Println(log.DebugLog, "Main app start")
	log.Println(log.DebugLog, "dbus", os.Getenv("DBUS_SESSION_BUS_ADDRESS"))

	//Tag = "0.4.8"

	globals.BuildVersion = BuildVersion
	globals.BuildDate = BuildDate
	globals.GitTag = &Tag
	globals.Hv = &Hv

	log.Println(log.DebugLog, "BuildVersion: ", globals.BuildVersion)
	log.Println(log.DebugLog, "BuildTime: ", globals.BuildDate)
	log.Println(log.DebugLog, "GitTag: ", *globals.GitTag)
	log.Println(log.DebugLog, "Hv: ", *globals.Hv)

	if os.Getenv("ccmode") == "manufacture" {
		manufacture.Start()
		select {}
	}

	http.HttpInit()
	modules.Init()

	select {}
}
