dao.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package notice
  2. import (
  3. "go-common/app/job/main/reply/conf"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. // Dao activity dao.
  7. type Dao struct {
  8. c *conf.Config
  9. urlLiveSmallVideo string
  10. urlLiveActivity string
  11. urlLiveNotice string
  12. urlLivePicture string
  13. urlCredit string
  14. urlTopic string
  15. urlActivity string
  16. urlActivitySub string
  17. urlDrwayoo string
  18. urlDynamic string
  19. urlNotice string
  20. urlBan string
  21. urlBangumi string
  22. urlAudio string
  23. urlAudioPlaylist string
  24. httpClient *bm.Client
  25. drawyooHTTPClient *bm.Client
  26. }
  27. // New new a dao and return.
  28. func New(c *conf.Config) *Dao {
  29. return &Dao{
  30. c: c,
  31. // http
  32. urlLiveSmallVideo: c.Host.LiveVC + "/clip/v1/video/detail",
  33. urlLiveActivity: c.Host.LiveAct + "/comment/v1/relation/get_by_id",
  34. urlLiveNotice: c.Host.LiveVC + "/news/v1/notice/info",
  35. urlLivePicture: c.Host.LiveVC + "/link_draw/v1/doc/detail",
  36. urlCredit: c.Host.API + "/x/internal/credit/blocked/cases",
  37. urlTopic: c.Host.Activity + "/activity/page/one/%d",
  38. urlActivity: c.Host.Activity + "/activity/page/one/%d",
  39. urlActivitySub: c.Host.Activity + "/activity/subject/url",
  40. urlDrwayoo: c.Host.DrawYoo + "/api/pushS",
  41. urlDynamic: c.Host.LiveVC + "/dynamic_repost/v0/dynamic_repost/ftch_rp_cont?dynamic_ids[]=%d",
  42. urlNotice: c.Host.API + "/x/internal/credit/publish/infos",
  43. urlBan: c.Host.API + "/x/internal/credit/blocked/infos",
  44. urlBangumi: c.Host.Bangumi + "/api/inner/aid_episodes_v2",
  45. urlAudio: c.Host.API + "/x/internal/v1/audio/songs/batch",
  46. urlAudioPlaylist: c.Host.API + "/x/internal/v1/audio/menus/%d",
  47. httpClient: bm.NewClient(c.HTTPClient),
  48. drawyooHTTPClient: bm.NewClient(c.DrawyooHTTPClient),
  49. }
  50. }