dao.go 448 B

12345678910111213141516171819202122232425262728
  1. package dao
  2. import (
  3. "time"
  4. "go-common/app/service/bbq/push/conf"
  5. "go-common/app/service/bbq/push/dao/jpush"
  6. )
  7. // Dao dao
  8. type Dao struct {
  9. c *conf.Config
  10. JPush *jpush.Client
  11. }
  12. // New init mysql db
  13. func New(c *conf.Config) (dao *Dao) {
  14. client := jpush.New(c.JPush.AppKey, c.JPush.SecretKey, time.Duration(c.JPush.Timeout))
  15. dao = &Dao{
  16. c: c,
  17. JPush: client,
  18. }
  19. return
  20. }
  21. // Close close the resource.
  22. func (d *Dao) Close() {
  23. }