Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cdy816
Mars
提交
e7e3cd0b
Mars
项目概览
cdy816
/
Mars
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e7e3cd0b
编写于
8月 13, 2020
作者:
cdy816
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Proxy 服务端口可配置
上级
775d260e
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
194 addition
and
17 deletion
+194
-17
Example/Consumer/DBGrpcApiDemo/App.xaml
Example/Consumer/DBGrpcApiDemo/App.xaml
+9
-0
Example/Consumer/DBGrpcApiDemo/App.xaml.cs
Example/Consumer/DBGrpcApiDemo/App.xaml.cs
+17
-0
Example/Consumer/DBGrpcApiDemo/AssemblyInfo.cs
Example/Consumer/DBGrpcApiDemo/AssemblyInfo.cs
+10
-0
Example/Consumer/DBGrpcApiDemo/DBGrpcApiDemo.csproj
Example/Consumer/DBGrpcApiDemo/DBGrpcApiDemo.csproj
+13
-0
Example/Consumer/DBGrpcApiDemo/MainWindow.xaml
Example/Consumer/DBGrpcApiDemo/MainWindow.xaml
+12
-0
Example/Consumer/DBGrpcApiDemo/MainWindow.xaml.cs
Example/Consumer/DBGrpcApiDemo/MainWindow.xaml.cs
+28
-0
Mars.sln
Mars.sln
+8
-1
Proxy/DBGrpcApi/Config/DBGrpcApi.cfg
Proxy/DBGrpcApi/Config/DBGrpcApi.cfg
+1
-1
Proxy/DBGrpcApi/DBGrpcApi.csproj
Proxy/DBGrpcApi/DBGrpcApi.csproj
+5
-0
Proxy/DBGrpcApi/Program.cs
Proxy/DBGrpcApi/Program.cs
+24
-0
Proxy/DBGrpcApi/Properties/launchSettings.json
Proxy/DBGrpcApi/Properties/launchSettings.json
+6
-6
Proxy/DBGrpcApi/mrdbg.ico
Proxy/DBGrpcApi/mrdbg.ico
+0
-0
Proxy/DBHighApi/Config/DBHighApi.cfg
Proxy/DBHighApi/Config/DBHighApi.cfg
+2
-2
Proxy/DBHighApi/DBHighApi.csproj
Proxy/DBHighApi/DBHighApi.csproj
+8
-2
Proxy/DBHighApi/Program.cs
Proxy/DBHighApi/Program.cs
+26
-3
Proxy/DBHighApi/Properties/launchSettings.json
Proxy/DBHighApi/Properties/launchSettings.json
+1
-1
Proxy/DbInRunWebApi/Config/DbWebApi.cfg
Proxy/DbInRunWebApi/Config/DbWebApi.cfg
+1
-1
Proxy/DbInRunWebApi/Program.cs
Proxy/DbInRunWebApi/Program.cs
+23
-0
RunTime/DBRuntime.Proxy/Config/ProxyClientConfig.cfg
RunTime/DBRuntime.Proxy/Config/ProxyClientConfig.cfg
+0
-0
未找到文件。
Example/Consumer/DBGrpcApiDemo/App.xaml
0 → 100644
浏览文件 @
e7e3cd0b
<Application x:Class="DBGrpcApiDemo.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DBGrpcApiDemo"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
Example/Consumer/DBGrpcApiDemo/App.xaml.cs
0 → 100644
浏览文件 @
e7e3cd0b
using
System
;
using
System.Collections.Generic
;
using
System.Configuration
;
using
System.Data
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
System.Windows
;
namespace
DBGrpcApiDemo
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public
partial
class
App
:
Application
{
}
}
Example/Consumer/DBGrpcApiDemo/AssemblyInfo.cs
0 → 100644
浏览文件 @
e7e3cd0b
using
System.Windows
;
[
assembly
:
ThemeInfo
(
ResourceDictionaryLocation
.
None
,
//where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation
.
SourceAssembly
//where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
Example/Consumer/DBGrpcApiDemo/DBGrpcApiDemo.csproj
0 → 100644
浏览文件 @
e7e3cd0b
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Proxy\DBGrpcApi.Client\DBGrpcApi.Client.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
Example/Consumer/DBGrpcApiDemo/MainWindow.xaml
0 → 100644
浏览文件 @
e7e3cd0b
<Window x:Class="DBGrpcApiDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DBGrpcApiDemo"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>
Example/Consumer/DBGrpcApiDemo/MainWindow.xaml.cs
0 → 100644
浏览文件 @
e7e3cd0b
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
namespace
DBGrpcApiDemo
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public
partial
class
MainWindow
:
Window
{
public
MainWindow
()
{
InitializeComponent
();
}
}
}
Mars.sln
浏览文件 @
e7e3cd0b
...
...
@@ -83,7 +83,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DBRuntimeTests", "RunTime\D
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DBGrpcApi", "Proxy\DBGrpcApi\DBGrpcApi.csproj", "{A0FF67D7-D874-4CD5-A6B2-ADC3DC6E09C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBGrpcApi.Client", "Proxy\DBGrpcApi.Client\DBGrpcApi.Client.csproj", "{F9A34AAF-C915-45D4-82A0-C85FE8E77BBE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DBGrpcApi.Client", "Proxy\DBGrpcApi.Client\DBGrpcApi.Client.csproj", "{F9A34AAF-C915-45D4-82A0-C85FE8E77BBE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBGrpcApiDemo", "Example\Consumer\DBGrpcApiDemo\DBGrpcApiDemo.csproj", "{A8D3561D-EEEE-47DD-A47F-0F37BDA7350D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
...
...
@@ -215,6 +217,10 @@ Global
{F9A34AAF-C915-45D4-82A0-C85FE8E77BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9A34AAF-C915-45D4-82A0-C85FE8E77BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9A34AAF-C915-45D4-82A0-C85FE8E77BBE}.Release|Any CPU.Build.0 = Release|Any CPU
{A8D3561D-EEEE-47DD-A47F-0F37BDA7350D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8D3561D-EEEE-47DD-A47F-0F37BDA7350D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8D3561D-EEEE-47DD-A47F-0F37BDA7350D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8D3561D-EEEE-47DD-A47F-0F37BDA7350D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
@@ -253,6 +259,7 @@ Global
{8E64B132-719D-4DBF-925C-F33B42A0B29E} = {1A69E6A7-33B3-4DAF-9D9D-FD7CD474FFD3}
{A0FF67D7-D874-4CD5-A6B2-ADC3DC6E09C1} = {15D0D528-DC48-4E43-A8E8-3EFEC938951B}
{F9A34AAF-C915-45D4-82A0-C85FE8E77BBE} = {15D0D528-DC48-4E43-A8E8-3EFEC938951B}
{A8D3561D-EEEE-47DD-A47F-0F37BDA7350D} = {723CADA9-2D52-4F05-9661-1655F8182084}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {577CCEC3-4CDB-458A-B93D-F8579C2C3D8F}
...
...
Proxy/DBGrpcApi/Config/DBGrpcApi.cfg
浏览文件 @
e7e3cd0b
<?xml version="1.0" encoding="utf-8" ?>
<Config>
<Config
ServerPort=
"14333"
>
<ProxyClient
Ip=
"192.168.0.33"
Port=
"14330"
LoginUser=
"Admin"
LoginPassword=
"Admin"
WorkMode=
"0"
PollCircle=
"1000"
IsUseStandardHisDataServer=
"false"
/>
</Config>
\ No newline at end of file
Proxy/DBGrpcApi/DBGrpcApi.csproj
浏览文件 @
e7e3cd0b
...
...
@@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ApplicationIcon>mrdbg.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
...
...
@@ -29,4 +30,8 @@
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy "$(TargetPath)" "$(SolutionDir)\Output" /y
copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)\Output" /y
copy "$(TargetDir)$(TargetName).runtimeconfig.json" "$(SolutionDir)\Output" /y
if exist "$(TargetDir)$(TargetName).XML" copy "$(TargetDir)$(TargetName).XML" "$(SolutionDir)\Output\Xml" /y
if exist "$(TargetDir)$(TargetName).pdb" copy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)\Output" /y
if exist "$(TargetDir)zh-CN" copy "$(TargetDir)zh-CN\*.dll" "$(SolutionDir)\Output\zh-CN" /y
copy "$(TargetDir)Config\*.cfg" "$(SolutionDir)\Output\Config" /y" />
</Target>
</Project>
Proxy/DBGrpcApi/Program.cs
浏览文件 @
e7e3cd0b
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.IO
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
System.Xml.Linq
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Hosting
;
...
...
@@ -10,17 +11,40 @@ namespace DBGrpcApi
{
public
class
Program
{
static
int
Port
=
14333
;
private
static
int
ReadServerPort
()
{
try
{
string
spath
=
System
.
IO
.
Path
.
Combine
(
System
.
IO
.
Path
.
GetDirectoryName
(
typeof
(
Program
).
Assembly
.
Location
),
"Config"
,
"DBGrpcApi.cfg"
);
if
(
System
.
IO
.
File
.
Exists
(
spath
))
{
XElement
xx
=
XElement
.
Load
(
spath
);
return
int
.
Parse
(
xx
.
Attribute
(
"ServerPort"
)?.
Value
);
}
}
catch
{
}
return
14333
;
}
public
static
void
Main
(
string
[]
args
)
{
Port
=
ReadServerPort
();
CreateHostBuilder
(
args
).
Build
().
Run
();
}
// Additional configuration is required to successfully run gRPC on macOS.
// For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682
public
static
IHostBuilder
CreateHostBuilder
(
string
[]
args
)
=>
Host
.
CreateDefaultBuilder
(
args
)
.
ConfigureWebHostDefaults
(
webBuilder
=>
{
webBuilder
.
UseUrls
(
"https://0.0.0.0:"
+
Port
);
webBuilder
.
UseStartup
<
Startup
>();
});
}
...
...
Proxy/DBGrpcApi/Properties/launchSettings.json
浏览文件 @
e7e3cd0b
{
{
"profiles"
:
{
"DBGrpcApi"
:
{
"commandName"
:
"Project"
,
"launchBrowser"
:
false
,
"applicationUrl"
:
"https://localhost:5001"
,
"commandName"
:
"Executable"
,
"executablePath"
:
"C:
\\
Users
\\
cdy81
\\
source
\\
repos
\\
mars
\\
Output
\\
DBGrpcApi.exe"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
},
"applicationUrl"
:
"https://localhost:5001"
}
}
}
}
\ No newline at end of file
Proxy/DBGrpcApi/mrdbg.ico
0 → 100644
浏览文件 @
e7e3cd0b
41.3 KB
Proxy/DBHighApi/Config/DBHighApi.
xml
→
Proxy/DBHighApi/Config/DBHighApi.
cfg
浏览文件 @
e7e3cd0b
<?xml version="1.0" encoding="utf-8" ?>
<Config>
<ProxyClient
Ip=
"127.0.0.1"
Port=
"14330"
LoginUser=
"Admin"
LoginPassword=
"Admin"
WorkMode=
"0"
PollCircle=
"1000"
IsUseStandardHisDataServer=
"false"
ServerPort=
"14332"
/>
<Config
ServerPort=
"14332"
>
<ProxyClient
Ip=
"127.0.0.1"
Port=
"14330"
LoginUser=
"Admin"
LoginPassword=
"Admin"
WorkMode=
"0"
PollCircle=
"1000"
IsUseStandardHisDataServer=
"false"
/>
</Config>
\ No newline at end of file
Proxy/DBHighApi/DBHighApi.csproj
浏览文件 @
e7e3cd0b
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
...
...
@@ -35,8 +35,14 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="Config\DBHighApi.cfg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy "$(TargetPath)" "$(SolutionDir)\Output" /y
copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)\Output" /y
copy "$(TargetDir)$(TargetName).runtimeconfig.json" "$(SolutionDir)\Output" /y
if exist "$(TargetDir)$(TargetName).XML" copy "$(TargetDir)$(TargetName).XML" "$(SolutionDir)\Output\Xml" /y
if exist "$(TargetDir)$(TargetName).pdb" copy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)\Output" /y
if exist "$(TargetDir)zh-CN" copy "$(TargetDir)zh-CN\*.dll" "$(SolutionDir)\Output\zh-CN" /y" />
<Exec Command="copy "$(TargetPath)" "$(SolutionDir)\Output" /y
copy "$(TargetDir)$(TargetName).exe" "$(SolutionDir)\Output" /y
copy "$(TargetDir)$(TargetName).runtimeconfig.json" "$(SolutionDir)\Output" /y
if exist "$(TargetDir)$(TargetName).XML" copy "$(TargetDir)$(TargetName).XML" "$(SolutionDir)\Output\Xml" /y
if exist "$(TargetDir)$(TargetName).pdb" copy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)\Output" /y
if exist "$(TargetDir)zh-CN" copy "$(TargetDir)zh-CN\*.dll" "$(SolutionDir)\Output\zh-CN" /y

copy "$(TargetDir)Config\*.cfg" "$(SolutionDir)\Output\Config" /y
" />
</Target>
</Project>
Proxy/DBHighApi/Program.cs
浏览文件 @
e7e3cd0b
...
...
@@ -2,12 +2,33 @@
using
DBHighApi.Api
;
using
DBRuntime.Proxy
;
using
System
;
using
System.Xml.Linq
;
namespace
DBHighApi
{
class
Program
{
private
static
bool
mIsClosed
=
false
;
private
static
int
ReadServerPort
()
{
try
{
string
spath
=
System
.
IO
.
Path
.
Combine
(
System
.
IO
.
Path
.
GetDirectoryName
(
typeof
(
Program
).
Assembly
.
Location
),
"Config"
,
"DBHighApi.cfg"
);
if
(
System
.
IO
.
File
.
Exists
(
spath
))
{
XElement
xx
=
XElement
.
Load
(
spath
);
return
int
.
Parse
(
xx
.
Attribute
(
"ServerPort"
)?.
Value
);
}
}
catch
{
}
return
14332
;
}
static
void
Main
(
string
[]
args
)
{
Console
.
CancelKeyPress
+=
Console_CancelKeyPress
;
...
...
@@ -39,7 +60,6 @@ namespace DBHighApi
DatabaseRunner
.
Manager
.
Load
();
DatabaseRunner
.
Manager
.
Start
();
DatabaseRunner
.
Manager
.
IsReadyEvent
+=
Manager_IsReadyEvent
;
}
...
...
@@ -52,8 +72,11 @@ namespace DBHighApi
{
if
(
value
)
{
Cdy
.
Tag
.
LoggerService
.
Service
.
Info
(
"DBHighAPI"
,
string
.
Format
(
Res
.
Get
(
"serverstartmsg"
),
14332
));
DataService
.
Service
.
Start
(
"127.0.0.1"
,
14332
);
int
port
=
ReadServerPort
();
Cdy
.
Tag
.
LoggerService
.
Service
.
Info
(
"DBHighAPI"
,
string
.
Format
(
Res
.
Get
(
"serverstartmsg"
),
port
));
DataService
.
Service
.
Start
(
"127.0.0.1"
,
port
);
}
else
{
...
...
Proxy/DBHighApi/Properties/launchSettings.json
浏览文件 @
e7e3cd0b
...
...
@@ -2,7 +2,7 @@
"profiles"
:
{
"DBHighApi"
:
{
"commandName"
:
"Executable"
,
"executablePath"
:
"
D:
\\
Project
\\
Galaxy
\\
Output
\\
DBHighApi.exe"
"executablePath"
:
"
C:
\\
Users
\\
cdy81
\\
source
\\
repos
\\
mars
\\
Output
\\
DBHighApi.exe"
}
}
}
\ No newline at end of file
Proxy/DbInRunWebApi/Config/DbWebApi.cfg
浏览文件 @
e7e3cd0b
<?xml version="1.0" encoding="utf-8" ?>
<Config>
<Config
ServerPort=
"14331"
>
<ProxyClient
Ip=
"192.168.0.33"
Port=
"14330"
LoginUser=
"Admin"
LoginPassword=
"Admin"
WorkMode=
"0"
PollCircle=
"1000"
IsUseStandardHisDataServer=
"false"
/>
</Config>
\ No newline at end of file
Proxy/DbInRunWebApi/Program.cs
浏览文件 @
e7e3cd0b
...
...
@@ -2,6 +2,7 @@ using System;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
System.Xml.Linq
;
using
Cdy.Tag
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Configuration
;
...
...
@@ -12,8 +13,29 @@ namespace DbInRunWebApi
{
public
class
Program
{
static
int
Port
=
14331
;
private
static
int
ReadServerPort
()
{
try
{
string
spath
=
System
.
IO
.
Path
.
Combine
(
System
.
IO
.
Path
.
GetDirectoryName
(
typeof
(
Program
).
Assembly
.
Location
),
"Config"
,
"DbWebApi.cfg"
);
if
(
System
.
IO
.
File
.
Exists
(
spath
))
{
XElement
xx
=
XElement
.
Load
(
spath
);
return
int
.
Parse
(
xx
.
Attribute
(
"ServerPort"
)?.
Value
);
}
}
catch
{
}
return
14331
;
}
public
static
void
Main
(
string
[]
args
)
{
Port
=
ReadServerPort
();
WindowConsolHelper
.
DisbleQuickEditMode
();
CreateHostBuilder
(
args
).
Build
().
Run
();
}
...
...
@@ -22,6 +44,7 @@ namespace DbInRunWebApi
Host
.
CreateDefaultBuilder
(
args
)
.
ConfigureWebHostDefaults
(
webBuilder
=>
{
webBuilder
.
UseUrls
(
"https://0.0.0.0:"
+
Port
);
webBuilder
.
UseStartup
<
WebAPIStartup
>();
});
}
...
...
RunTime/DBRuntime.Proxy/Config/ProxyClientConfig.
xml
→
RunTime/DBRuntime.Proxy/Config/ProxyClientConfig.
cfg
浏览文件 @
e7e3cd0b
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录