package main

import (
	"github.com/gin-gonic/gin"
	"slgserver/config"
	"slgserver/db"
	"slgserver/server/httpserver/controller"
)

func main() {
	// 设置 Gin 为 release 模式
	gin.SetMode(gin.ReleaseMode)

	db.TestDB()

	r := gin.Default()

	g := r.Group("")
	new(controller.AccountController).RegisterRoutes(g)
	
	addr := getHttpAddr()
	r.Run(addr)
}

func getHttpAddr() string {
	host := config.GetString("httpserver.host", "")
	port := config.GetString("httpserver.port", "8088")
	return host + ":" + port
}