main.go 986 B

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