From 8238616ab5798c36eda6545437bc17ea45cc5ce2 Mon Sep 17 00:00:00 2001
From: dtapps
Date: Sat, 30 Mar 2024 09:56:50 +0800
Subject: [PATCH] - update
---
gorm.go | 4 ++--
gorm_mysql.go | 4 ++--
gorm_postgres.go | 4 ++--
gorm_postgresql.go | 4 ++--
redis_hash_operation.go | 1 +
redis_list_operation.go | 1 +
version.go | 1 +
7 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/gorm.go b/gorm.go
index 9d287bd..7aa91bd 100644
--- a/gorm.go
+++ b/gorm.go
@@ -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())
diff --git a/gorm_mysql.go b/gorm_mysql.go
index 28b5461..e3c81bf 100644
--- a/gorm_mysql.go
+++ b/gorm_mysql.go
@@ -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 {
diff --git a/gorm_postgres.go b/gorm_postgres.go
index bd1b4e8..55edd78 100644
--- a/gorm_postgres.go
+++ b/gorm_postgres.go
@@ -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 {
diff --git a/gorm_postgresql.go b/gorm_postgresql.go
index 56a4b79..5b9b485 100644
--- a/gorm_postgresql.go
+++ b/gorm_postgresql.go
@@ -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 {
diff --git a/redis_hash_operation.go b/redis_hash_operation.go
index b79e447..6091edd 100644
--- a/redis_hash_operation.go
+++ b/redis_hash_operation.go
@@ -5,6 +5,7 @@ import (
"github.com/redis/go-redis/v9"
)
+// HashOperation Hash类型数据操作
type HashOperation struct {
db *redis.Client
}
diff --git a/redis_list_operation.go b/redis_list_operation.go
index 0463856..7cec4ad 100644
--- a/redis_list_operation.go
+++ b/redis_list_operation.go
@@ -5,6 +5,7 @@ import (
"github.com/redis/go-redis/v9"
)
+// ListOperation 列表(list)类型数据操作
type ListOperation struct {
db *redis.Client
ctx context.Context
diff --git a/version.go b/version.go
index fc9be9c..a375967 100644
--- a/version.go
+++ b/version.go
@@ -1,3 +1,4 @@
package dorm
+// Version 版本
const Version = "1.0.57"