main.go 664 B

123456789101112131415161718192021222324252627282930
  1. package main
  2. import (
  3. "fmt"
  4. "youngmini_server/app/utils"
  5. _ "youngmini_server/boot"
  6. _ "youngmini_server/router"
  7. "github.com/gogf/gcache-adapter/adapter"
  8. "github.com/gogf/gf/os/gsession"
  9. "github.com/gogf/gf/frame/g"
  10. )
  11. func main() {
  12. // 设置session存储于redis
  13. g.Server().SetConfigWithMap(g.Map{
  14. "SessionStorage": gsession.NewStorageRedis(g.Redis()),
  15. })
  16. adapter := adapter.NewRedis(g.Redis())
  17. g.DB().GetCache().SetAdapter(adapter)
  18. var resp = utils.GetKDDetails("圆通速递", "2163347472375261969")
  19. fmt.Printf("resp=%+v\n", resp)
  20. //var resp = service.ShowLogisticsDetail("2508915060")
  21. //fmt.Printf("resp=%+v\n", resp)
  22. g.Server().Run()
  23. }