dao.go 391 B

123456789101112131415161718192021222324252627
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/interface/main/upload/conf"
  5. "go-common/library/database/orm"
  6. "github.com/jinzhu/gorm"
  7. )
  8. // Dao dao struct
  9. type Dao struct {
  10. orm *gorm.DB
  11. }
  12. // NewDao new a dao instance.
  13. func NewDao(c *conf.Config) *Dao {
  14. return &Dao{
  15. orm: orm.NewMySQL(c.ORM),
  16. }
  17. }
  18. // Ping ping database.
  19. func (d *Dao) Ping(c context.Context) error {
  20. return nil
  21. }