main.go 836 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package main
  2. import (
  3. "fmt"
  4. "go-admin/cmd"
  5. "log"
  6. "net/http"
  7. _ "net/http/pprof"
  8. "time"
  9. )
  10. //go:generate swag init --parseDependency --parseDepth=6
  11. // @title go-admin API
  12. // @version 2.0.0
  13. // @description 基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档
  14. // @description 添加qq群: 521386980 进入技术交流群 请先star,谢谢!
  15. // @license.name MIT
  16. // @license.url https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md
  17. // @securityDefinitions.apikey Bearer
  18. // @in header
  19. // @name Authorization
  20. func main() {
  21. go func() {
  22. if err := http.ListenAndServe(":8001", nil); err != nil {
  23. log.Fatal(err)
  24. }
  25. }()
  26. location, err := time.LoadLocation("Asia/Shanghai")
  27. if err != nil {
  28. fmt.Println("Failed to load location:", err)
  29. return
  30. }
  31. time.Local = location
  32. cmd.Execute()
  33. }