dao.go 281 B

1234567891011121314151617181920212223
  1. package dao
  2. import (
  3. "go-common/app/infra/canal/conf"
  4. "go-common/library/database/sql"
  5. )
  6. // Dao dao
  7. type Dao struct {
  8. // config
  9. c *conf.Config
  10. // db
  11. db *sql.DB
  12. }
  13. // New dao new
  14. func New(c *conf.Config) (d *Dao) {
  15. d = &Dao{
  16. c: c,
  17. db: sql.NewMySQL(c.DB),
  18. }
  19. return
  20. }