service.go 477 B

12345678910111213141516171819202122232425262728293031
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/interface/main/ugcpay-rank/internal/conf"
  5. "go-common/app/interface/main/ugcpay-rank/internal/dao"
  6. )
  7. // Service struct
  8. type Service struct {
  9. dao *dao.Dao
  10. }
  11. // New init
  12. func New(c *conf.Config) (s *Service) {
  13. s = &Service{
  14. dao: dao.New(),
  15. }
  16. return s
  17. }
  18. // Ping Service
  19. func (s *Service) Ping(ctx context.Context) (err error) {
  20. return s.dao.Ping(ctx)
  21. }
  22. // Close Service
  23. func (s *Service) Close() {
  24. s.dao.Close()
  25. }