dao.go 475 B

12345678910111213141516171819202122232425262728
  1. package abtest
  2. import (
  3. "go-common/app/service/main/resource/conf"
  4. httpx "go-common/library/net/http/blademaster"
  5. )
  6. // Dao define db struct
  7. type Dao struct {
  8. c *conf.Config
  9. // cpt
  10. httpClient *httpx.Client
  11. testURL string
  12. }
  13. const (
  14. _abTestURL = "/abserver/v1/app/query-exp"
  15. )
  16. // New init mysql db
  17. func New(c *conf.Config) (d *Dao) {
  18. d = &Dao{
  19. c: c,
  20. httpClient: httpx.NewClient(c.HTTPClient),
  21. testURL: c.Host.DataPlat + _abTestURL,
  22. }
  23. return
  24. }