Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
获取父级评论ID
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichiamane committed Sep 28, 2019
1 parent 91a1d4a commit 5688d1a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions PixivFSUWP/Data/IllustCommentItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,34 @@ namespace PixivFSUWP.Data
{
public class IllustCommentItem
{
public int ID { get; set; }
public string Comment { get; set; }
public string DateTime { get; set; }
public string UserName { get; set; }
public string UserAccount { get; set; }
public string AvatarUrl { get; set; }
public int ParentCommentID { get; set; }
public List<int> ChildrenComments { get; set; } = null;

public static IllustCommentItem FromJsonValue(JsonObject Source)
{
IllustCommentItem toret = new IllustCommentItem();
toret.ID = (int)Source["id"].GetNumber();
toret.Comment = Source["comment"].TryGetString();
toret.DateTime = Source["date"].TryGetString();
toret.UserName = Source["user"].GetObject()["name"].TryGetString();
toret.UserAccount = Source["user"].GetObject()["account"].TryGetString();
toret.AvatarUrl = Source["user"].GetObject()["profile_image_urls"].GetObject()["medium"].TryGetString();
var parent = Source["parent_comment"].ToString();
if(parent!="{}")
{
//有父级评论
toret.ParentCommentID = (int)Source["parent_comment"].GetObject()["id"].GetNumber();
}
else
{
toret.ParentCommentID = -1;
}
return toret;
}
}
Expand Down

0 comments on commit 5688d1a

Please sign in to comment.