Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
若汝棋茗
RRQMSocket
提交
b6ec0dba
RRQMSocket
项目概览
若汝棋茗
/
RRQMSocket
11 个月 前同步成功
通知
20
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
RRQMSocket
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b6ec0dba
编写于
7月 30, 2022
作者:
若
若汝棋茗
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复JsonRpc,XmlRpc的注册bug
上级
aac929e9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
9 deletion
+16
-9
examples/JsonRpc简单示例/JsonRpcConsoleApp/Program.cs
examples/JsonRpc简单示例/JsonRpcConsoleApp/Program.cs
+10
-1
examples/WebApi简单示例/WebApiServer/Program.cs
examples/WebApi简单示例/WebApiServer/Program.cs
+3
-5
src/TouchSocket/Rpc/JsonRpc/Plugins/JsonRpcParserPlugin.cs
src/TouchSocket/Rpc/JsonRpc/Plugins/JsonRpcParserPlugin.cs
+1
-1
src/TouchSocket/Rpc/XmlRpc/Plugins/XmlRpcParserPlugin.cs
src/TouchSocket/Rpc/XmlRpc/Plugins/XmlRpcParserPlugin.cs
+1
-1
src/TouchSocket/TouchSocket.csproj
src/TouchSocket/TouchSocket.csproj
+1
-1
未找到文件。
examples/JsonRpc简单示例/JsonRpcConsoleApp/Program.cs
浏览文件 @
b6ec0dba
...
...
@@ -186,6 +186,7 @@ namespace JsonRpcConsoleApp
{
return
"RRQM"
+
str
;
}
/// <summary>
/// 当标记为true时直接使用方法名称
/// </summary>
...
...
@@ -194,9 +195,16 @@ namespace JsonRpcConsoleApp
[
JsonRpc
(
true
)]
public
string
TestJsonRpc1
(
string
str
)
{
return
"RRQM"
+
str
;
}
/// <summary>
/// 使用调用上下文。
/// 可以从上下文获取调用的SocketClient。从而获得IP和Port等相关信息。
/// </summary>
/// <param name="callContext"></param>
/// <param name="str"></param>
/// <returns></returns>
[
JsonRpc
]
[
TouchRpc
(
MethodFlags
=
MethodFlags
.
IncludeCallContext
)]
//使用调用上才文
public
string
TestGetContext
(
ICallContext
callContext
,
string
str
)
...
...
@@ -224,6 +232,7 @@ namespace JsonRpcConsoleApp
}
return
"RRQM"
+
str
;
}
[
JsonRpc
]
public
JObject
TestJObject
(
JObject
obj
)
{
...
...
examples/WebApi简单示例/WebApiServer/Program.cs
浏览文件 @
b6ec0dba
...
...
@@ -28,17 +28,15 @@ namespace WebApiServerApp
Console
.
WriteLine
(
"以下连接用于测试webApi"
);
Console
.
WriteLine
(
$"使用:http://127.0.0.1:7789/Server/Sum?a=10&b=20"
);
//RpcStore.ProxyAttributeMap.TryAdd("webapi", typeof(WebApiAttribute));
//生成的WebApi的本地代理文件。
//ServerCellCode[] cellCodes = rpcStore.GetProxyInfo(RpcStore.ProxyAttributeMap.Values.ToArray());
//当想导出全部时,RpcStore.ProxyAttributeMap.Values.ToArray()
//string codeString = CodeGenerator.ConvertToCode("RRQMProxy", cellCodes);
//下列代码,会生成客户端的调用代码。
string
codeString
=
webApiParser
.
RpcStore
.
GetProxyCodes
(
"WebApiProxy"
);
Console
.
ReadKey
();
}
}
public
class
Server
:
RpcServer
{
[
Router
(
"[api]/[action]ab"
)]
//此路由会以"/Server/Sumab"实现
[
WebApi
(
HttpMethodType
.
GET
)]
public
int
Sum
(
int
a
,
int
b
)
{
...
...
src/TouchSocket/Rpc/JsonRpc/Plugins/JsonRpcParserPlugin.cs
浏览文件 @
b6ec0dba
...
...
@@ -38,8 +38,8 @@ namespace TouchSocket.Rpc.JsonRpc
/// </summary>
public
JsonRpcParserPlugin
([
DependencyParamterInject
(
true
)]
RpcStore
rpcStore
)
{
rpcStore
?.
AddRpcParser
(
this
.
GetType
().
Name
,
this
);
this
.
m_actionMap
=
new
ActionMap
();
rpcStore
?.
AddRpcParser
(
this
.
GetType
().
Name
,
this
);
}
/// <summary>
...
...
src/TouchSocket/Rpc/XmlRpc/Plugins/XmlRpcParserPlugin.cs
浏览文件 @
b6ec0dba
...
...
@@ -35,8 +35,8 @@ namespace TouchSocket.Rpc.XmlRpc
/// </summary>
public
XmlRpcParserPlugin
([
DependencyParamterInject
(
true
)]
RpcStore
rpcStore
)
{
rpcStore
?.
AddRpcParser
(
this
.
GetType
().
Name
,
this
);
this
.
m_actionMap
=
new
ActionMap
();
rpcStore
?.
AddRpcParser
(
this
.
GetType
().
Name
,
this
);
}
/// <summary>
...
...
src/TouchSocket/TouchSocket.csproj
浏览文件 @
b6ec0dba
...
...
@@ -4,7 +4,7 @@
<ApplicationIcon>logo.ico</ApplicationIcon>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>RRQM.pfx</AssemblyOriginatorKeyFile>
<Version>0.2.
3
</Version>
<Version>0.2.
4
</Version>
<LangVersion>8.0</LangVersion>
<Company>若汝棋茗</Company>
<Copyright>Copyright © 2022 若汝棋茗</Copyright>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录