From 5d29fd6d3bc4b0364ecbf7eb7738468ec43f5f5b Mon Sep 17 00:00:00 2001 From: chenchun Date: Fri, 29 Aug 2025 13:41:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BA=E5=BE=AE=E4=BF=A1=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=8F=B7=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E6=A8=A1=E5=9E=8B=E6=B7=BB=E5=8A=A0JsonPropertyName?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E5=B9=B6=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Managers/Fuwuhao/FuwuhaoManager.cs | 10 ++-------- .../Managers/Fuwuhao/UserBaseInfoResponse.cs | 17 +++++++---------- .../Managers/Fuwuhao/UserInfoResponse.cs | 19 +++++++++---------- 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/FuwuhaoManager.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/FuwuhaoManager.cs index 90b1d8b2..d99af62d 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/FuwuhaoManager.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/FuwuhaoManager.cs @@ -109,10 +109,7 @@ public class FuwuhaoManager : DomainService var jsonContent = await response.Content.ReadAsStringAsync(); _logger.LogInformation($"服务号code获取用户基础信息:{jsonContent}"); - var result = JsonSerializer.Deserialize(jsonContent, new JsonSerializerOptions - { - PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower - }); + var result = JsonSerializer.Deserialize(jsonContent); return result; } @@ -133,10 +130,7 @@ public class FuwuhaoManager : DomainService var jsonContent = await response.Content.ReadAsStringAsync(); _logger.LogInformation($"服务号code获取用户详细信息:{jsonContent}"); - var result = JsonSerializer.Deserialize(jsonContent, new JsonSerializerOptions - { - PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower - }); + var result = JsonSerializer.Deserialize(jsonContent); return result; } diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/UserBaseInfoResponse.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/UserBaseInfoResponse.cs index bd2afb36..6becf902 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/UserBaseInfoResponse.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/UserBaseInfoResponse.cs @@ -1,3 +1,5 @@ +using System.Text.Json.Serialization; + namespace Yi.Framework.AiHub.Domain.Managers.Fuwuhao; /// @@ -8,35 +10,30 @@ public class UserBaseInfoResponse /// /// 访问令牌 /// + [JsonPropertyName("access_token")] public string AccessToken { get; set; } /// /// 过期时间(秒) /// + [JsonPropertyName("expires_in")] public int ExpiresIn { get; set; } /// /// 刷新令牌 /// + [JsonPropertyName("refresh_token")] public string RefreshToken { get; set; } /// /// 用户OpenID /// + [JsonPropertyName("openid")] public string OpenId { get; set; } /// /// 授权作用域 /// + [JsonPropertyName("scope")] public string Scope { get; set; } - - /// - /// 是否为快照用户 - /// - public int IsSnapshotUser { get; set; } - - /// - /// 用户UnionID - /// - public string UnionId { get; set; } } \ No newline at end of file diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/UserInfoResponse.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/UserInfoResponse.cs index a8c2faa7..72241b2f 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/UserInfoResponse.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/Fuwuhao/UserInfoResponse.cs @@ -1,3 +1,5 @@ +using System.Text.Json.Serialization; + namespace Yi.Framework.AiHub.Domain.Managers.Fuwuhao; /// @@ -8,45 +10,42 @@ public class UserInfoResponse /// /// 用户OpenID /// + [JsonPropertyName("openid")] public string OpenId { get; set; } /// /// 用户昵称 /// + [JsonPropertyName("nickname")] public string Nickname { get; set; } /// /// 用户性别,值为1时是男性,值为2时是女性,值为0时是未知 /// + [JsonPropertyName("sex")] public int Sex { get; set; } /// /// 用户个人资料填写的省份 /// + [JsonPropertyName("province")] public string Province { get; set; } /// /// 普通用户个人资料填写的城市 /// + [JsonPropertyName("city")] public string City { get; set; } /// /// 国家,如中国为CN /// + [JsonPropertyName("country")] public string Country { get; set; } /// /// 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像) /// + [JsonPropertyName("headimgurl")] public string HeadImgUrl { get; set; } - - /// - /// 用户特权信息 - /// - public string[] Privilege { get; set; } - - /// - /// 用户UnionID - /// - public string UnionId { get; set; } } \ No newline at end of file