package main

import (
	"log"

	"mrcc/internal/config"
	"mrcc/internal/httpserver"
	"mrcc/internal/logger"
)

func main() {
	cfg := config.Load("economy-service", "8082")
	logger.WithService(cfg.Name).Info("starting service", "port", cfg.Port)

	srv := httpserver.New(cfg)

	// TODO: 注册经济路由
	// r := srv.Group("/api/user")
	// r.GET("/balance", ...)
	// r := srv.Group("/api/shop")
	// r.GET("/items", ...)

	log.Printf("economy-service listening on %s", cfg.Address())
	if err := srv.Run(cfg.Address()); err != nil {
		log.Fatal(err)
	}
}
