package main

import (
	"Wine-Server/handlers"
	"Wine-Server/handlers/manager"
	"Wine-Server/handlers/seller"
	"Wine-Server/handlers/worker"
	"Wine-Server/utils"
	"os"
)

func main() {
	/*
	TODO: 微信支付、管理端、（员工端、用户端）小程序
	*/
	args, filepath := os.Args, "config.json"
	if len(args) == 2 {
		filepath = args[1]
	}
	config := utils.ReadConfig(filepath)
	app := handlers.CreateApp(&config)
	app.RouteRegister(
		seller.Router,
		manager.Router,
		worker.Router,
	)
	app.Start()
}
