package test

import (
	"ddpf/model/dbm"
	"ddpf/model/session"
	tdbm "github.com/tangs-drm/go-tool/dbm"
)

var SqlConf = ""

func Init() {
	// 开启服务
	session.SessionLog = true
	db, err := tdbm.Default("testUser:123@tcp(localhost:3306)/testdb?charset=utf8")
	if err != nil {
		panic(err)
		return
	}
	err = db.Ping()
	if err != nil {
		panic(err)
		return
	}
	// init order.sql
	var sqlConf string = SqlConf
	err = dbm.Init(sqlConf)
	if err != nil {
		panic(err)
		return
	}
}