Skip to content

Commit ab1c14a

Browse files
committed
增加JsonPropertyName
1 parent 52f7ea8 commit ab1c14a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

WebApiClientCore.Extensions.JsonRpc/Internals/JsonRpcContent.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace WebApiClientCore.Extensions.JsonRpc
66
/// 表示JsonRpc请求内容
77
/// </summary>
88
class JsonRpcContent : BufferContent
9-
{
9+
{
1010
/// <summary>
1111
/// 获取对应的ContentType
1212
/// </summary>
@@ -16,9 +16,9 @@ class JsonRpcContent : BufferContent
1616
/// JsonRpc请求内容
1717
/// </summary>
1818
/// <param name="mediaType">媒体类型</param>
19-
public JsonRpcContent( string? mediaType)
19+
public JsonRpcContent(string? mediaType)
2020
: base(mediaType ?? MediaType)
21-
{
22-
}
21+
{
22+
}
2323
}
2424
}

WebApiClientCore.Extensions.JsonRpc/JsonRpcError.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace WebApiClientCore.Extensions.JsonRpc
1+
using System.Text.Json.Serialization;
2+
3+
namespace WebApiClientCore.Extensions.JsonRpc
24
{
35
/// <summary>
46
/// 表示JsonRpc的错误内容
@@ -8,16 +10,19 @@ public class JsonRpcError
810
/// <summary>
911
/// 错误码
1012
/// </summary>
13+
[JsonPropertyName("code")]
1114
public int Code { get; set; }
1215

1316
/// <summary>
1417
/// 提示消息
1518
/// </summary>
19+
[JsonPropertyName("message")]
1620
public string? Message { get; set; }
1721

1822
/// <summary>
1923
/// 错误内容
2024
/// </summary>
25+
[JsonPropertyName("data")]
2126
public object? Data { get; set; }
2227
}
2328
}

0 commit comments

Comments
 (0)