dao.go 488 B

12345678910111213141516171819202122232425
  1. package game
  2. import (
  3. "go-common/app/interface/main/creative/conf"
  4. httpx "go-common/library/net/http/blademaster"
  5. )
  6. // Dao define
  7. type Dao struct {
  8. c *conf.Config
  9. client *httpx.Client
  10. gameListURL string
  11. gameInfoURL string
  12. }
  13. // New init dao
  14. func New(c *conf.Config) (d *Dao) {
  15. d = &Dao{
  16. c: c,
  17. client: httpx.NewClient(c.HTTPClient.Slow),
  18. gameListURL: c.Game.OpenHost + _gameListURI,
  19. gameInfoURL: c.Game.OpenHost + _gameInfoURI,
  20. }
  21. return
  22. }