diff --git a/pkg/database/postgres.go b/pkg/database/postgres.go index 807ff1f..27edf65 100644 --- a/pkg/database/postgres.go +++ b/pkg/database/postgres.go @@ -16,7 +16,7 @@ import ( // InitPostgreSQL 初始化 PostgreSQL 数据库连接 func InitPostgreSQL(cfg *config.DatabaseConfig, log *zap.Logger) (*gorm.DB, error) { // 构建 DSN (数据源名称) - dsn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=%s", + dsn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=%s TimeZone=Asia/Shanghai", cfg.Host, cfg.Port, cfg.User,