service.go 772 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/interface/live/app-interface/conf"
  5. "go-common/app/interface/live/app-interface/dao"
  6. )
  7. // Service struct
  8. type Service struct {
  9. c *conf.Config
  10. dao *dao.Dao
  11. }
  12. // New init
  13. func New(c *conf.Config) (s *Service) {
  14. s = &Service{
  15. c: c,
  16. dao: dao.New(c),
  17. }
  18. return s
  19. }
  20. // Ping Service
  21. func (s *Service) Ping(c context.Context) (err error) {
  22. return s.dao.Ping(c)
  23. }
  24. // Close Service
  25. func (s *Service) Close() {
  26. s.dao.Close()
  27. }
  28. // Test ...
  29. func (s *Service) Test(c context.Context) (err error) {
  30. // srv := &v2.IndexService{}
  31. // res, err := srv.GetIndexV2TagList(c, &liveUserV1.UserSettingGetTagReq{})
  32. // res, err := srv.GetIndexV2SeaPatrol(c, &liveUserV1.NoteGetReq{})
  33. // fmt.Printf("%#v \n", res)
  34. return
  35. }