dao.go 417 B

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