feat:完善项目

This commit is contained in:
henry
2021-09-28 11:47:19 +08:00
commit da7b3130fe
167 changed files with 456676 additions and 0 deletions

20
serve/orm/logic/mysql.go Normal file
View File

@ -0,0 +1,20 @@
package logic
import (
"fmt"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
type Mysql struct {
User, Password, Host string
Port int
DBName, Parameters string
}
func (this *Mysql) DSN() gorm.Dialector {
return mysql.Open(fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?%s",
this.User, this.Password, this.Host, this.Port, this.DBName, this.Parameters,
))
}