package main import ( "flag" "github.com/gin-gonic/gin" "insure/global" "insure/initialize" "insure/router" ) func main() { initial() //runServer() runServerInWindows() //order, _ := service.OrderService.GetOrderByOrderNo("2024070111083101") //service.PdfService.Generate(order) //fmt.Println(utils.AmountToUpper(11089.11)) } func initial() { var configFilePath string flag.StringVar(&configFilePath, "config", "./conf/config.yaml", "配置文件") flag.Parse() global.Config = initialize.InitConfig(configFilePath) global.DB = initialize.InitDB(global.Config) global.Redis = initialize.InitRedis(global.Config) } /*func runServer() { r := gin.Default() s := &http.Server{ Addr: ":8080", Handler: r, ReadTimeout: 10 * time.Second, WriteTimeout: 10 * time.Second, MaxHeaderBytes: 1 << 20, } router.Initial(r) err := endless.ListenAndServe(":"+global.Config.Server.Port, s.Handler) if err != nil { panic(err) } }*/ func runServerInWindows() { r := gin.Default() router.Initial(r) r.Run(":" + global.Config.Server.Port) }