From 5c7ed7387f9ff11883097441013e800d9638a04e Mon Sep 17 00:00:00 2001 From: Richasy Date: Mon, 14 Nov 2022 22:24:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=A0=E7=94=A8=E6=88=B7Id?= =?UTF-8?q?=E8=BF=87=E9=95=BF=E5=AF=BC=E8=87=B4=E7=9A=84=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Adapter/Adapter.Implementation/DynamicAdapter.cs | 4 ++-- src/Adapter/Adapter.Implementation/UserAdapter.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Adapter/Adapter.Implementation/DynamicAdapter.cs b/src/Adapter/Adapter.Implementation/DynamicAdapter.cs index 8eaa806e8..27a35a83d 100644 --- a/src/Adapter/Adapter.Implementation/DynamicAdapter.cs +++ b/src/Adapter/Adapter.Implementation/DynamicAdapter.cs @@ -78,7 +78,7 @@ public DynamicInformation ConvertToDynamicInformation(DynamicItem item) if (userModule != null) { var author = userModule.Author; - user = _userAdapter.ConvertToUserProfile(Convert.ToInt32(author.Mid), author.Name, author.Face, Models.Enums.App.AvatarSize.Size64); + user = _userAdapter.ConvertToUserProfile(author.Mid, author.Name, author.Face, Models.Enums.App.AvatarSize.Size64); tip = userModule.PtimeLabelText; } else @@ -87,7 +87,7 @@ public DynamicInformation ConvertToDynamicInformation(DynamicItem item) if (forwardUserModule != null) { var name = forwardUserModule.Title.FirstOrDefault()?.Text ?? "--"; - user = _userAdapter.ConvertToUserProfile(Convert.ToInt32(forwardUserModule.Uid), name, forwardUserModule.FaceUrl, Models.Enums.App.AvatarSize.Size32); + user = _userAdapter.ConvertToUserProfile(forwardUserModule.Uid, name, forwardUserModule.FaceUrl, Models.Enums.App.AvatarSize.Size32); tip = forwardUserModule.PtimeLabelText; } } diff --git a/src/Adapter/Adapter.Implementation/UserAdapter.cs b/src/Adapter/Adapter.Implementation/UserAdapter.cs index a7dc85ac3..f934e7613 100644 --- a/src/Adapter/Adapter.Implementation/UserAdapter.cs +++ b/src/Adapter/Adapter.Implementation/UserAdapter.cs @@ -68,7 +68,7 @@ public AccountInformation ConvertToAccountInformation(Mine myInfo, AvatarSize av /// public AccountInformation ConvertToAccountInformation(UserSpaceInformation spaceInfo, AvatarSize avatarSize) { - var user = ConvertToUserProfile(Convert.ToInt32(spaceInfo.UserId), spaceInfo.UserName, spaceInfo.Avatar, avatarSize); + var user = ConvertToUserProfile(Convert.ToInt64(spaceInfo.UserId), spaceInfo.UserName, spaceInfo.Avatar, avatarSize); var communityInfo = _communityAdapter.ConvertToUserCommunityInformation(spaceInfo); return new AccountInformation( user, @@ -107,7 +107,7 @@ public AccountInformation ConvertToAccountInformation(UserSearchItem item, Avata /// public AccountInformation ConvertToAccountInformation(Member member, AvatarSize avatarSize = AvatarSize.Size64) { - var profile = ConvertToUserProfile(Convert.ToInt32(member.Mid), member.Name, member.Face, avatarSize); + var profile = ConvertToUserProfile(member.Mid, member.Name, member.Face, avatarSize); return new AccountInformation(profile, default, Convert.ToInt32(member.Level), default); } @@ -121,7 +121,7 @@ public RoleProfile ConvertToRoleProfile(PublisherInfo publisher, AvatarSize avat /// public RoleProfile ConvertToRoleProfile(Staff staff, AvatarSize avatarSize) { - var user = ConvertToUserProfile(Convert.ToInt32(staff.Mid), staff.Name, staff.Face, avatarSize); + var user = ConvertToUserProfile(staff.Mid, staff.Name, staff.Face, avatarSize); return new RoleProfile( user, _textToolkit.ConvertToTraditionalChineseIfNeeded(staff.Title)); @@ -137,7 +137,7 @@ public RoleProfile ConvertToRoleProfile(RecommendAvatar avatar, AvatarSize avata /// public RoleProfile ConvertToRoleProfile(Author author, AvatarSize avatarSize = AvatarSize.Size32) { - var user = ConvertToUserProfile(Convert.ToInt32(author.Mid), author.Name, author.Face, avatarSize); + var user = ConvertToUserProfile(author.Mid, author.Name, author.Face, avatarSize); return new RoleProfile(user); }