nothing
This commit is contained in:
parent
eeeaa2a86f
commit
6b8fabb8d8
@ -141,17 +141,17 @@ func testInsertDeworming() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func insertData() {
|
func insertData() {
|
||||||
// testInsertSterilzation()
|
testInsertSterilzation()
|
||||||
// fmt.Println("testInsertSterilzation success.")
|
fmt.Println("testInsertSterilzation success.")
|
||||||
|
|
||||||
// testInsertBreed()
|
testInsertBreed()
|
||||||
// fmt.Println("testInsertBreed success.")
|
fmt.Println("testInsertBreed success.")
|
||||||
|
|
||||||
// testInsertStatus()
|
testInsertStatus()
|
||||||
// fmt.Println("testInsertStatus success.")
|
fmt.Println("testInsertStatus success.")
|
||||||
|
|
||||||
// testInsertAnmGender()
|
testInsertAnmGender()
|
||||||
// fmt.Println("testInsertAnmGender success.")
|
fmt.Println("testInsertAnmGender success.")
|
||||||
|
|
||||||
testInsertVaccination()
|
testInsertVaccination()
|
||||||
fmt.Println("testInsertVaccination success.")
|
fmt.Println("testInsertVaccination success.")
|
||||||
@ -163,7 +163,8 @@ func insertData() {
|
|||||||
func main() {
|
func main() {
|
||||||
// 1.
|
// 1.
|
||||||
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||||
"root", "Havocantelope412#", "113.44.68.213", "3306", "hav_cats") // ATT MySQL
|
// "root", "Havocantelope412#", "113.44.68.213", "3306", "hav_cats") // ATT MySQL dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||||
|
"root", "havocantelope412", "127.0.0.1", "3306", "hav_cats") // ATT MySQL
|
||||||
fmt.Println("dsn:", dsn)
|
fmt.Println("dsn:", dsn)
|
||||||
dbMySQL, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
dbMySQL, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -5,7 +5,8 @@ Gormv2: # 只针对 gorm 操作数据库有效
|
|||||||
IsInitGlobalGormMysql: 1 # 随项目启动为gorm db初始化一个全局 variable.GormDbMysql(完全等于*gorm.Db),正确配置数据库,该值必须设置为: 1
|
IsInitGlobalGormMysql: 1 # 随项目启动为gorm db初始化一个全局 variable.GormDbMysql(完全等于*gorm.Db),正确配置数据库,该值必须设置为: 1
|
||||||
SlowThreshold: 30 # 慢 SQL 阈值(sql执行时间超过此时间单位(秒),就会触发系统日志记录)
|
SlowThreshold: 30 # 慢 SQL 阈值(sql执行时间超过此时间单位(秒),就会触发系统日志记录)
|
||||||
Write:
|
Write:
|
||||||
Host: "113.44.68.213"
|
# Host: "113.44.68.213"
|
||||||
|
Host: "127.0.0.1"
|
||||||
DataBase: "hav_cats"
|
DataBase: "hav_cats"
|
||||||
Port: 3306
|
Port: 3306
|
||||||
Prefix: "tb_" # 目前没有用到该配置项
|
Prefix: "tb_" # 目前没有用到该配置项
|
||||||
|
@ -15,7 +15,8 @@ var DB *gorm.DB
|
|||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||||
"root", "Havocantelope412#", "113.44.68.213", "3306", "hav_cats") // danger MySQL
|
"root", "havocantelope412", "127.0.0.1", "3306", "hav_cats") // ATT MySQL
|
||||||
|
|
||||||
fmt.Println("dsn:", dsn)
|
fmt.Println("dsn:", dsn)
|
||||||
dbMySQL, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
dbMySQL, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user