dao.go 969 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package vip
  2. import (
  3. "go-common/app/interface/main/account/conf"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. // Dao dao
  7. type Dao struct {
  8. c *conf.Config
  9. client *bm.Client
  10. clientSlow *bm.Client
  11. infoURL string
  12. codeOpenURL string
  13. codeVerifyURL string
  14. tipsURL string
  15. cancelCouponURL string
  16. codeOpenedURL string
  17. cl *Clientl
  18. }
  19. // New new
  20. func New(c *conf.Config) (d *Dao) {
  21. d = &Dao{
  22. c: c,
  23. client: bm.NewClient(c.HTTPClient.Normal),
  24. clientSlow: bm.NewClient(c.HTTPClient.Slow),
  25. infoURL: c.Host.Vip + _vipInfo,
  26. codeOpenURL: c.Host.API + _vipCodeOpen,
  27. codeVerifyURL: c.Host.API + _vipCodeVerify,
  28. tipsURL: c.Host.API + _viptips,
  29. cancelCouponURL: c.Host.API + _couponCancel,
  30. codeOpenedURL: c.Host.API + _vipCodeOpened,
  31. }
  32. // http client for had url md5 sign.
  33. d.cl = NewClientl(c.Vipproperty.OAuthClient, d.client)
  34. return
  35. }