dao.go 709 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package pay
  2. import (
  3. "context"
  4. "go-common/app/interface/main/videoup/conf"
  5. "go-common/library/database/elastic"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. // Dao str
  9. type Dao struct {
  10. c *conf.Config
  11. client *bm.Client
  12. assRegURI string
  13. assURI string
  14. es *elastic.Elastic
  15. }
  16. // New fn
  17. func New(c *conf.Config) (d *Dao) {
  18. d = &Dao{
  19. c: c,
  20. client: bm.NewClient(c.HTTPClient.Write),
  21. assRegURI: c.Host.APICo + _assRegURI,
  22. assURI: c.Host.APICo + _assURI,
  23. es: elastic.NewElastic(&elastic.Config{
  24. Host: c.Host.MainSearch,
  25. HTTPClient: c.HTTPClient.Read,
  26. }),
  27. }
  28. return d
  29. }
  30. // Ping fn
  31. func (d *Dao) Ping(c context.Context) (err error) {
  32. return
  33. }