|
1 | 1 | using Newtonsoft.Json.Linq; |
2 | 2 | using System.Collections.Generic; |
| 3 | +using System.Text.Json.Serialization; |
3 | 4 |
|
4 | 5 | namespace Amino.Objects |
5 | 6 | { |
6 | 7 | public class InfluencerInfo |
7 | 8 | { |
8 | 9 |
|
9 | | - public _FanClubMember MyFanClub { get; } |
10 | | - public _FanClubUserProfile InfluencerUserProfile { get; } |
11 | | - public List<_FanClubMember> FanClubMembers { get; } = new(); |
12 | | - public string json { get; } |
13 | | - |
14 | | - public InfluencerInfo(JObject json) |
15 | | - { |
16 | | - this.json = json.ToString(); |
17 | | - try { MyFanClub = new(JObject.Parse((string)json["myFanClub"])); } catch { } |
18 | | - try { InfluencerUserProfile = new(JObject.Parse((string)json["influencerUserProfile"])); } catch { } |
19 | | - if (json["fanClubList"] != null) { foreach (JObject clubMember in json["fanClubList"]) { FanClubMembers.Add(new(clubMember)); } } |
20 | | - |
21 | | - } |
22 | | - |
23 | | - |
24 | | - |
25 | | - public class _FanClubMember |
26 | | - { |
27 | | - public string userId { get; } |
28 | | - public string lastThankedTime { get; } |
29 | | - public string expiredTime { get; } |
30 | | - public string createdTime { get; } |
31 | | - public int fansStatus { get; } = 0; |
32 | | - public _FanClubUserProfile FanUserProfile { get; } |
33 | | - |
34 | | - public _FanClubMember(JObject json) |
35 | | - { |
36 | | - try { userId = (string)json["uid"]; } catch { } |
37 | | - try { lastThankedTime = (string)json["lastThankedTime"]; } catch { } |
38 | | - try { expiredTime = (string)json["expiredTime"]; } catch { } |
39 | | - try { createdTime = (string)json["createdTime"]; } catch { } |
40 | | - try { fansStatus = (int)json["fansStatus"]; } catch { } |
41 | | - |
42 | | - try { FanUserProfile = new(JObject.Parse((string)json["fansUserProfile"])); } catch { } |
43 | | - } |
44 | | - |
45 | | - |
46 | | - |
47 | | - } |
48 | | - public class _FanClubUserProfile |
49 | | - { |
50 | | - public int status { get; } = 0; |
51 | | - public string moodSticker { get; } |
52 | | - public int itemsCount { get; } = 0; |
53 | | - public int consecutiveCheckInDays { get; } = 0; |
54 | | - public string userId { get; } |
55 | | - public string modifiedTime { get; } |
56 | | - public int followingStatus { get; } = 0; |
57 | | - public int onlineStatus { get; } = 0; |
58 | | - public int accountMembershipStatus { get; } = 0; |
59 | | - public bool isGlobal { get; } = false; |
60 | | - public string avatarFrameId { get; } |
61 | | - public int reputation { get; } = 0; |
62 | | - public int postsCount { get; } = 0; |
63 | | - public int membersCount { get; } = 0; |
64 | | - public string nickname { get; } |
65 | | - public string iconUrl { get; } |
66 | | - public bool isNicknameVerified { get; } = false; |
67 | | - public string mood { get; } |
68 | | - public int level { get; } = 0; |
69 | | - public int notificationSubscriptionStatus { get; } = 0; |
70 | | - public bool pushEnabled { get; } = false; |
71 | | - public int membershipStatus { get; } = 0; |
72 | | - public string content { get; } |
73 | | - public int joinedCount { get; } = 0; |
74 | | - public int role { get; } = 0; |
75 | | - public int commentsCount { get; } = 0; |
76 | | - public int communityId { get; } = 0; |
77 | | - public string createdTime { get; } |
78 | | - public int storiesCount { get; } = 0; |
79 | | - public int blogsCount { get; } = 0; |
80 | | - public _AvatarFrame AvatarFrame { get; } |
81 | | - public _Extensions Extensions { get; } |
82 | | - public _InfluencerInfo InfluencerInfo { get; } |
83 | | - |
84 | | - |
85 | | - public _FanClubUserProfile(JObject json) |
86 | | - { |
87 | | - try { status = (int)json["status"]; } catch { } |
88 | | - try { moodSticker = (string)json["moodSticker"]; } catch { } |
89 | | - try { itemsCount = (int)json["itemsCount"]; } catch { } |
90 | | - try { consecutiveCheckInDays = (int)json["consecutiveCheckInDays"]; } catch { } |
91 | | - try { userId = (string)json["uid"]; } catch { } |
92 | | - try { modifiedTime = (string)json["modifiedTime"]; } catch { } |
93 | | - try { followingStatus = (int)json["followingStatus"]; } catch { } |
94 | | - try { onlineStatus = (int)json["onlineStatus"]; } catch { } |
95 | | - try { accountMembershipStatus = (int)json["accountMembershipStatus"]; } catch { } |
96 | | - try { isGlobal = (bool)json["isGlobal"]; } catch { } |
97 | | - try { reputation = (int)json["reputation"]; } catch { } |
98 | | - try { postsCount = (int)json["postsCount"]; } catch { } |
99 | | - try { membersCount = (int)json["membersCount"]; } catch { } |
100 | | - try { nickname = (string)json["nickname"]; } catch { } |
101 | | - try { iconUrl = (string)json["icon"]; } catch { } |
102 | | - try { isNicknameVerified = (bool)json["isNicknameVerified"]; } catch { } |
103 | | - try { mood = (string)json["mood"]; } catch { } |
104 | | - try { level = (int)json["level"]; } catch { } |
105 | | - try { notificationSubscriptionStatus = (int)json["notificationSubscriptionStatus"]; } catch { } |
106 | | - try { pushEnabled = (bool)json["pushEnabled"]; } catch { } |
107 | | - try { membershipStatus = (int)json["membershipStatus"]; } catch { } |
108 | | - try { content = (string)json["content"]; } catch { } |
109 | | - try { joinedCount = (int)json["joinedCount"]; } catch { } |
110 | | - try { role = (int)json["role"]; } catch { } |
111 | | - try { commentsCount = (int)json["commentsCount"]; } catch { } |
112 | | - try { communityId = (int)json["ndcId"]; } catch { } |
113 | | - try { createdTime = (string)json["createdTime"]; } catch { } |
114 | | - try { storiesCount = (int)json["storiesCount"]; } catch { } |
115 | | - try { blogsCount = (int)json["blogsCount"]; } catch { } |
116 | | - |
117 | | - if (json["extensions"] != null) { Extensions = new(JObject.Parse((string)json["extensions"])); } |
118 | | - if (json["avatarFrame"] != null) { AvatarFrame = new(JObject.Parse((string)json["avatarFrame"])); } |
119 | | - if (json["influencerInfo"] != null) { InfluencerInfo = new(JObject.Parse((string)json["influencerInfo"])); } |
120 | | - } |
121 | | - |
122 | | - |
123 | | - |
124 | | - public class _AvatarFrame |
125 | | - { |
126 | | - public int status { get; } = 0; |
127 | | - public int ownershipStatus { get; } = 0; |
128 | | - public int version { get; } = 0; |
129 | | - public string resoureUrl { get; } |
130 | | - public string name { get; } |
131 | | - public string iconUrl { get; } |
132 | | - public int frameType { get; } = 0; |
133 | | - public string frameId { get; } |
134 | | - |
135 | | - public _AvatarFrame(JObject json) |
136 | | - { |
137 | | - try { status = (int)json["status"]; } catch { } |
138 | | - try { ownershipStatus = (int)json["ownershipStatus"]; } catch { } |
139 | | - try { version = (int)json["version"]; } catch { } |
140 | | - try { resoureUrl = (string)json["resourceUrl"]; } catch { } |
141 | | - try { name = (string)json["name"]; } catch { } |
142 | | - try { iconUrl = (string)json["icon"]; } catch { } |
143 | | - try { frameType = (int)json["frameType"]; } catch { } |
144 | | - try { frameId = (string)json["frameId"]; } catch { } |
145 | | - } |
146 | | - } |
147 | | - |
148 | | - public class _InfluencerInfo |
149 | | - { |
150 | | - public bool pinned { get; } = false; |
151 | | - public string createdTime { get; } |
152 | | - public int fansCount { get; } = 0; |
153 | | - public int monthlyFee { get; } = 0; |
154 | | - |
155 | | - public _InfluencerInfo(JObject json) |
156 | | - { |
157 | | - try { pinned = (bool)json["pinned"]; } catch { } |
158 | | - try { createdTime = (string)json["createdTime"]; } catch { } |
159 | | - try { fansCount = (int)json["fansCount"]; } catch { } |
160 | | - try { monthlyFee = (int)json["monthlyFee"]; } catch { } |
161 | | - } |
162 | | - } |
163 | | - |
164 | | - public class _Extensions |
165 | | - { |
166 | | - public string defaultBubbleId { get; } |
167 | | - public _Style Style { get; } |
168 | | - public List<_CustomTitle> CustomTitles { get; } = new List<_CustomTitle>(); |
169 | | - |
170 | | - public _Extensions(JObject json) |
171 | | - { |
172 | | - try { defaultBubbleId = (string)json["defaultBubbleId"]; } catch { } |
173 | | - if (json["style"] != null) { Style = new(JObject.Parse((string)json["style"])); } |
174 | | - if (json["customTitles"] != null) |
175 | | - { |
176 | | - foreach(JObject title in json["customTitles"]) { CustomTitles.Add(new(title)); } |
177 | | - } |
178 | | - } |
179 | | - |
180 | | - public class _CustomTitle |
181 | | - { |
182 | | - public string color { get; } |
183 | | - public string title { get; } |
184 | | - |
185 | | - public _CustomTitle(JObject json) |
186 | | - { |
187 | | - try { color = (string)json["color"]; } catch { } |
188 | | - try { title = (string)json["title"]; } catch { } |
189 | | - } |
190 | | - } |
191 | | - |
192 | | - public class _Style |
193 | | - { |
194 | | - public string backgroundColor { get; } |
195 | | - |
196 | | - public _Style(JObject json) |
197 | | - { |
198 | | - try { backgroundColor = (string)json["backgroundColor"]; } catch { } |
199 | | - } |
200 | | - } |
201 | | - } |
202 | | - } |
| 10 | + [JsonPropertyName("myFanClub")]public InfluencerFanClubMember MyFanClub { get; set; } |
| 11 | + [JsonPropertyName("influencerUserProfile")]public UserProfile InfluencerUserProfile { get; set; } |
| 12 | + [JsonPropertyName("fanClubList")]public List<InfluencerFanClubMember> FanClubMembers { get; set; } |
203 | 13 | } |
204 | 14 | } |
0 commit comments