dao.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package danmu
  2. import (
  3. "go-common/app/interface/main/creative/conf"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. // Dao is creative dao.
  7. type Dao struct {
  8. // config
  9. c *conf.Config
  10. // http client
  11. client *bm.Client
  12. // assist url
  13. assistDmBannedURL string
  14. advDmPurchaseListURL string
  15. advDmPurchasePassURL string
  16. advDmPurchaseDenyURL string
  17. advDmPurchaseCancelURL string
  18. dmSearchURL string
  19. dmEditURL string
  20. dmRecentURL string
  21. dmTransferURL string
  22. dmPoolURL string
  23. dmDistriURL string
  24. dmProtectApplyListURL string
  25. dmProtectApplyStatusURL string
  26. dmProtectApplyVideoListURL string
  27. dmReportUpListURL string
  28. dmReportUpArchivesURL string
  29. dmReportUpEditURL string
  30. }
  31. // New init api url
  32. func New(c *conf.Config) (d *Dao) {
  33. d = &Dao{
  34. c: c,
  35. client: bm.NewClient(c.HTTPClient.Slow),
  36. assistDmBannedURL: c.Host.API + _setDmBannedURI,
  37. advDmPurchaseListURL: c.Host.API + _getDmPurchaseListURI,
  38. advDmPurchasePassURL: c.Host.API + _setDmPurchasePassURI,
  39. advDmPurchaseDenyURL: c.Host.API + _setDmPurchaseDenyURI,
  40. advDmPurchaseCancelURL: c.Host.API + _setDmPurchaseCancelURI,
  41. dmSearchURL: c.Host.API + _dmSearchURI,
  42. dmEditURL: c.Host.API + _dmEditURI,
  43. dmRecentURL: c.Host.API + _dmRecentURI,
  44. dmTransferURL: c.Host.API + _dmTransferURI,
  45. dmPoolURL: c.Host.API + _dmPoolURI,
  46. dmDistriURL: c.Host.API + _dmDistriURI,
  47. dmProtectApplyStatusURL: c.Host.API + _dmProtectApplyStatusURI,
  48. dmProtectApplyListURL: c.Host.API + _dmProtectApplyListURI,
  49. dmProtectApplyVideoListURL: c.Host.API + _dmProtectApplyVideoListURI,
  50. dmReportUpEditURL: c.Host.API + _dmReportUpEditURI,
  51. dmReportUpListURL: c.Host.API + _dmReportUpListURI,
  52. dmReportUpArchivesURL: c.Host.API + _dmReportUpArchivesURI,
  53. }
  54. return
  55. }