You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
391 B
28 lines
391 B
package manager |
|
|
|
import ( |
|
"go-common/app/service/main/resource/conf" |
|
"go-common/library/database/sql" |
|
) |
|
|
|
//Dao manager dao |
|
type Dao struct { |
|
db *sql.DB |
|
c *conf.Config |
|
} |
|
|
|
//New new manager dao |
|
func New(c *conf.Config) (d *Dao) { |
|
d = &Dao{ |
|
c: c, |
|
db: sql.NewMySQL(c.DB.Manager), |
|
} |
|
return |
|
} |
|
|
|
// Close close db resource. |
|
func (d *Dao) Close() { |
|
if d.db != nil { |
|
d.db.Close() |
|
} |
|
}
|
|
|