master
dtapps 1 month ago
parent b4cf941dd9
commit 8238616ab5

@ -39,14 +39,14 @@ type GormClient struct {
type writer struct{}
// 日志路径
var logsUrl = ""
var logsURL = ""
func (w writer) Printf(format string, args ...interface{}) {
now := time.Now()
logFilePath := ""
if dir, err := os.Getwd(); err == nil {
logFilePath = dir + logsUrl
logFilePath = dir + logsURL
}
if err := os.MkdirAll(logFilePath, 0777); err != nil {
fmt.Println(err.Error())

@ -18,9 +18,9 @@ func NewGormMysqlClient(ctx context.Context, config *GormClientConfig) (*GormCli
// 判断路径
if c.config.LogPath == "" {
logsUrl = "/logs/mysql"
logsURL = "/logs/mysql"
} else {
logsUrl = c.config.LogPath
logsURL = c.config.LogPath
}
if c.config.LogStatus {

@ -19,9 +19,9 @@ func NewGormPostgresClient(ctx context.Context, config *GormClientConfig) (*Gorm
// 判断路径
if c.config.LogPath == "" {
logsUrl = "/logs/postgresql"
logsURL = "/logs/postgresql"
} else {
logsUrl = c.config.LogPath
logsURL = c.config.LogPath
}
if c.config.LogStatus {

@ -19,9 +19,9 @@ func NewGormPostgresqlClient(ctx context.Context, config *GormClientConfig) (*Go
// 判断路径
if c.config.LogPath == "" {
logsUrl = "/logs/postgresql"
logsURL = "/logs/postgresql"
} else {
logsUrl = c.config.LogPath
logsURL = c.config.LogPath
}
if c.config.LogStatus {

@ -5,6 +5,7 @@ import (
"github.com/redis/go-redis/v9"
)
// HashOperation Hash类型数据操作
type HashOperation struct {
db *redis.Client
}

@ -5,6 +5,7 @@ import (
"github.com/redis/go-redis/v9"
)
// ListOperation 列表(list)类型数据操作
type ListOperation struct {
db *redis.Client
ctx context.Context

@ -1,3 +1,4 @@
package dorm
// Version 版本
const Version = "1.0.57"

Loading…
Cancel
Save