package main

import (
	"log"

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

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

	srv := httpserver.New(cfg)

	// TODO: 注册蓝图路由
	// r := srv.Group("/api/blueprints")
	// r.GET("/", ...)
	// r.POST("/", ...)
	// r.POST("/:id/buy", ...)

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