service.go 668 B

123456789101112131415161718192021222324252627282930313233343536
  1. package up
  2. import (
  3. "context"
  4. "go-common/app/interface/main/creative/conf"
  5. "go-common/app/interface/main/creative/dao/account"
  6. "go-common/app/interface/main/creative/dao/up"
  7. "go-common/app/interface/main/creative/service"
  8. "go-common/library/log"
  9. )
  10. //Service struct
  11. type Service struct {
  12. c *conf.Config
  13. up *up.Dao
  14. acc *account.Dao
  15. }
  16. //New get service
  17. func New(c *conf.Config, rpcdaos *service.RPCDaos) *Service {
  18. s := &Service{
  19. c: c,
  20. up: up.New(c),
  21. acc: rpcdaos.Acc,
  22. }
  23. return s
  24. }
  25. // Ping service
  26. func (s *Service) Ping(c context.Context) (err error) {
  27. if err = s.up.Ping(c); err != nil {
  28. log.Error("s.up.Ping err(%v)", err)
  29. }
  30. return
  31. }