dao.go 381 B

123456789101112131415161718192021222324
  1. package dao
  2. import (
  3. "go-common/app/job/main/click/conf"
  4. "go-common/library/database/sql"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. // Dao is
  8. type Dao struct {
  9. c *conf.Config
  10. db *sql.DB
  11. client *bm.Client
  12. }
  13. // New is
  14. func New(c *conf.Config) (d *Dao) {
  15. d = &Dao{
  16. c: c,
  17. db: sql.NewMySQL(c.DB),
  18. client: bm.NewClient(c.HTTPClient),
  19. }
  20. return d
  21. }