service.go 568 B

12345678910111213141516171819202122232425262728293031
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/admin/main/space/conf"
  5. "go-common/app/admin/main/space/dao"
  6. relrpc "go-common/app/service/main/relation/rpc/client"
  7. )
  8. // Service biz service def.
  9. type Service struct {
  10. c *conf.Config
  11. dao *dao.Dao
  12. relation *relrpc.Service
  13. }
  14. // New new a Service and return.
  15. func New(c *conf.Config) (s *Service) {
  16. s = &Service{
  17. c: c,
  18. dao: dao.New(c),
  19. relation: relrpc.New(c.RelationRPC),
  20. }
  21. return s
  22. }
  23. // Ping .
  24. func (s *Service) Ping(c context.Context) (err error) {
  25. return s.dao.Ping(c)
  26. }