Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
804a1896
Commit
804a1896
authored
Sep 23, 2024
by
wyc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
连接地址配置
parent
de2d9088
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
12 deletions
+28
-12
performance/Performance.Api/wwwroot/Performance.Api.xml
+1
-1
performance/Performance.DtoModels/AppSettings/AppSQLEncrypt.cs
+1
-0
performance/Performance.Repository/Common/ConnectionBuilder.cs
+18
-5
performance/Performance.Repository/Common/DatabaseType.cs
+2
-1
performance/Performance.Repository/Performance.Repository.csproj
+1
-0
performance/Performance.Services/ExtractExcelService/ExtractPreConfigService.cs
+5
-5
No files found.
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
804a1896
...
...
@@ -2301,7 +2301,7 @@
<param
name=
"procIds"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.LowProcController.GetDatumAsync(System.Int64,System.
Nullable{System.Int64}
,Performance.DtoModels.PagedQueryRequest,System.Collections.Generic.List{Performance.DtoModels.DynamicQuery})"
>
<member
name=
"M:Performance.Api.Controllers.LowProcController.GetDatumAsync(System.Int64,System.
String
,Performance.DtoModels.PagedQueryRequest,System.Collections.Generic.List{Performance.DtoModels.DynamicQuery})"
>
<summary>
扩展数据查询
</summary>
...
...
performance/Performance.DtoModels/AppSettings/AppSQLEncrypt.cs
View file @
804a1896
...
...
@@ -12,5 +12,6 @@ public class AppSQLEncrypt
public
string
TempMySqlConnectionString
{
get
;
set
;
}
=
""
;
public
string
TempSqlServerConnectionString
{
get
;
set
;
}
=
""
;
public
string
TempOracleConnectionString
{
get
;
set
;
}
=
""
;
public
string
TempPostgreSqlConnectionString
{
get
;
set
;
}
=
""
;
}
}
performance/Performance.Repository/Common/ConnectionBuilder.cs
View file @
804a1896
using
System
;
using
System.Data
;
using
System.Data.SqlClient
;
using
MySql.Data.MySqlClient
;
using
MySql.Data.MySqlClient
;
using
Npgsql
;
using
Oracle.ManagedDataAccess.Client
;
using
Performance.Infrastructure.Helper
;
using
System
;
using
System.Data
;
using
System.Data.SqlClient
;
namespace
Performance.Repository
{
...
...
@@ -31,11 +32,15 @@ public static IDbConnection Create(DatabaseType type, string connectionString)
case
DatabaseType
.
Oracle
:
return
new
OracleConnection
(
connectionString
);
case
DatabaseType
.
PostgreSql
:
return
new
NpgsqlConnection
(
connectionString
);
default
:
throw
new
Exception
(
$"
nonsupport
{
DatabaseType
.
MySql
}
"
);
throw
new
Exception
(
$"
不支持的数据库类型:
{
type
}
"
);
}
}
/// <summary>
/// 创建连接字符串
/// </summary>
...
...
@@ -75,6 +80,14 @@ public static string GetConnectionString(DatabaseType type, string ip, string da
return
string
.
Format
(
connectionString
,
ip
,
database
,
uid
,
pwd
);
}
if
(
type
==
DatabaseType
.
PostgreSql
)
{
string
connectionString
=
string
.
IsNullOrEmpty
(
AppSQLEncryptConfig
.
Instance
.
TempPostgreSqlConnectionString
)
?
"Host={0};Database={1};Username={2};Password={3};timeout=1024;Pooling=true;"
:
AppSQLEncryptConfig
.
Instance
.
TempPostgreSqlConnectionString
;
return
string
.
Format
(
connectionString
,
ip
,
database
,
uid
,
pwd
);
}
return
""
;
}
...
...
performance/Performance.Repository/Common/DatabaseType.cs
View file @
804a1896
...
...
@@ -4,6 +4,7 @@ public enum DatabaseType
{
MySql
=
0
,
SqlServer
=
1
,
Oracle
=
2
Oracle
=
2
,
PostgreSql
=
3
}
}
performance/Performance.Repository/Performance.Repository.csproj
View file @
804a1896
...
...
@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Npgsql" Version="5.0.18" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.4" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
</ItemGroup>
...
...
performance/Performance.Services/ExtractExcelService/ExtractPreConfigService.cs
View file @
804a1896
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
AutoMapper
;
using
AutoMapper
;
using
Microsoft.Extensions.Logging
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Infrastructure.Helper
;
using
Performance.Repository
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
namespace
Performance.Services.ExtractExcelService
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment