go-common/app/interface/main/shorturl/service/service.go

30 lines
526 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package service
import (
"context"
"go-common/app/interface/main/shorturl/conf"
shortdao "go-common/app/interface/main/shorturl/dao"
"go-common/library/log"
)
// Service service struct
type Service struct {
shortd *shortdao.Dao
}
// New new service
func New(c *conf.Config) (s *Service) {
s = &Service{
shortd: shortdao.New(c),
}
return
}
// Ping ping service.
func (s *Service) Ping(c context.Context) (err error) {
if err = s.shortd.Ping(c); err != nil {
log.Error("s.dao.Ping error(%v)", err)
}
return
}