Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
修复因用户Id过长导致的解析问题 (#1566)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy committed Nov 14, 2022
1 parent 1db86ea commit 4bd5d49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Adapter/Adapter.Implementation/DynamicAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Adapter/Adapter.Implementation/UserAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public AccountInformation ConvertToAccountInformation(Mine myInfo, AvatarSize av
/// <inheritdoc/>
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,
Expand Down Expand Up @@ -107,7 +107,7 @@ public AccountInformation ConvertToAccountInformation(UserSearchItem item, Avata
/// <inheritdoc/>
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);
}

Expand All @@ -121,7 +121,7 @@ public RoleProfile ConvertToRoleProfile(PublisherInfo publisher, AvatarSize avat
/// <inheritdoc/>
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));
Expand All @@ -137,7 +137,7 @@ public RoleProfile ConvertToRoleProfile(RecommendAvatar avatar, AvatarSize avata
/// <inheritdoc/>
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);
}

Expand Down

0 comments on commit 4bd5d49

Please sign in to comment.