service.go 476 B

123456789101112131415161718192021222324252627282930313233
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/admin/openplatform/sug/conf"
  5. "go-common/app/admin/openplatform/sug/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. }