You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
673 B
38 lines
673 B
package template |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/app/interface/main/creative/conf" |
|
"go-common/app/interface/main/creative/dao/template" |
|
"go-common/app/interface/main/creative/service" |
|
"go-common/library/log" |
|
) |
|
|
|
//Service struct |
|
type Service struct { |
|
c *conf.Config |
|
tpl *template.Dao |
|
} |
|
|
|
//New get service |
|
func New(c *conf.Config, rpcdaos *service.RPCDaos) *Service { |
|
s := &Service{ |
|
c: c, |
|
tpl: template.New(c), |
|
} |
|
return s |
|
} |
|
|
|
// Ping service |
|
func (s *Service) Ping(c context.Context) (err error) { |
|
if err = s.tpl.Ping(c); err != nil { |
|
log.Error("s.template.Dao.PingDb err(%v)", err) |
|
} |
|
return |
|
} |
|
|
|
// Close dao |
|
func (s *Service) Close() { |
|
s.tpl.Close() |
|
}
|
|
|