service.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package favorite
  2. import (
  3. "go-common/app/interface/main/app-interface/conf"
  4. artdao "go-common/app/interface/main/app-interface/dao/article"
  5. audiodao "go-common/app/interface/main/app-interface/dao/audio"
  6. bangumidao "go-common/app/interface/main/app-interface/dao/bangumi"
  7. bplusdao "go-common/app/interface/main/app-interface/dao/bplus"
  8. favdao "go-common/app/interface/main/app-interface/dao/favorite"
  9. malldao "go-common/app/interface/main/app-interface/dao/mall"
  10. spdao "go-common/app/interface/main/app-interface/dao/sp"
  11. ticketdao "go-common/app/interface/main/app-interface/dao/ticket"
  12. topicdao "go-common/app/interface/main/app-interface/dao/topic"
  13. )
  14. // Service is favorite.
  15. type Service struct {
  16. c *conf.Config
  17. // dao
  18. favDao *favdao.Dao
  19. artDao *artdao.Dao
  20. spDao *spdao.Dao
  21. topicDao *topicdao.Dao
  22. bplusDao *bplusdao.Dao
  23. audioDao *audiodao.Dao
  24. bangumiDao *bangumidao.Dao
  25. ticketDao *ticketdao.Dao
  26. mallDao *malldao.Dao
  27. }
  28. // New new favorite。
  29. func New(c *conf.Config) (s *Service) {
  30. s = &Service{
  31. c: c,
  32. // dao
  33. favDao: favdao.New(c),
  34. topicDao: topicdao.New(c),
  35. artDao: artdao.New(c),
  36. spDao: spdao.New(c),
  37. bplusDao: bplusdao.New(c),
  38. audioDao: audiodao.New(c),
  39. bangumiDao: bangumidao.New(c),
  40. ticketDao: ticketdao.New(c),
  41. mallDao: malldao.New(c),
  42. }
  43. return s
  44. }