Skip to content

Commit 8e7cf86

Browse files
committed
feat 新增 CLAIMPOINTITEM 命令
1 parent 9c1c4f3 commit 8e7cf86

File tree

10 files changed

+224
-154
lines changed

10 files changed

+224
-154
lines changed

ASFEnhance.IPC/Data/Responses/MixWishlistResponse.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,39 @@
22

33
namespace ASFEnhance.IPC.Data.Responses;
44

5+
/// <summary>
6+
/// 愿望单响应
7+
/// </summary>
58
public sealed record MixWishlistResponse
69
{
10+
/// <summary>
11+
///
12+
/// </summary>
13+
/// <param name="count"></param>
14+
/// <param name="data"></param>
715
public MixWishlistResponse(int count, GetWishlistResponse? data)
816
{
917
Count = count;
1018
Items = data?.Items;
1119
}
1220

21+
/// <summary>
22+
///
23+
/// </summary>
24+
/// <param name="data"></param>
1325
public MixWishlistResponse(GetWishlistResponse? data)
1426
{
1527
Count = data?.Items?.Count ?? -1;
1628
Items = data?.Items;
1729
}
1830

31+
/// <summary>
32+
///
33+
/// </summary>
1934
public int Count { get; set; }
35+
36+
/// <summary>
37+
///
38+
/// </summary>
2039
public List<GetWishlistResponse.ItemData>? Items { get; set; }
2140
}

ASFEnhance/ASFEnhance.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ public Task OnLoaded()
207207
"CI" when access >= EAccess.Operator =>
208208
Event.Command.ResponseClaimItem(bot),
209209

210+
"CLAIMPOINTITEM" or
211+
"CLAIMPOINTSITEM" or
212+
"CPI" when access >= EAccess.Operator =>
213+
Event.Command.ResponseClaimPointStoreItem(bot),
214+
210215
"CLAIM20TH" or
211216
"C20" when access >= EAccess.Operator =>
212217
Event.Command.ResponseClaim20Th(bot),
@@ -471,6 +476,11 @@ public Task OnLoaded()
471476
"CI" when access >= EAccess.Operator =>
472477
Event.Command.ResponseClaimItem(Utilities.GetArgsAsText(args, 1, ",")),
473478

479+
"CLAIMPOINTITEM" or
480+
"CLAIMPOINTSITEM" or
481+
"CPI" when access >= EAccess.Operator =>
482+
Event.Command.ResponseClaimPointStoreItem(Utilities.GetArgsAsText(args, 1, ",")),
483+
474484
"CLAIM20TH" or
475485
"C20" when access >= EAccess.Operator =>
476486
Event.Command.ResponseClaim20Th(Utilities.GetArgsAsText(args, 1, ",")),
Lines changed: 7 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,15 @@
1+
using ASFEnhance.Data.Common;
12
using System.Text.Json.Serialization;
23

34
namespace ASFEnhance.Data;
45
internal sealed record ClaimItemResponse
56
{
6-
[JsonPropertyName("response")]
7-
public ResponseData? Response { get; set; }
7+
[JsonPropertyName("communityitemid")]
8+
public string? CommunityItemId { get; set; }
89

9-
public sealed record ResponseData
10-
{
11-
[JsonPropertyName("communityitemid")]
12-
public string? CommunityItemId { get; set; }
10+
[JsonPropertyName("next_claim_time")]
11+
public long NextClaimTime { get; set; }
1312

14-
[JsonPropertyName("next_claim_time")]
15-
public long NextClaimTime { get; set; }
16-
17-
[JsonPropertyName("reward_item")]
18-
public RewardItemData? RewardItem { get; set; }
19-
}
20-
21-
public sealed record RewardItemData
22-
{
23-
//[JsonPropertyName( "appid")]
24-
//public int AppId { get; set; }
25-
26-
//[JsonPropertyName( "defid")]
27-
//public int DefId { get; set; }
28-
29-
//[JsonPropertyName( "type")]
30-
//public int Type { get; set; }
31-
32-
//[JsonPropertyName( "community_item_class")]
33-
//public int CommunityItemClass { get; set; }
34-
35-
//[JsonPropertyName( "community_item_type")]
36-
//public int CommunityItemType { get; set; }
37-
38-
//[JsonPropertyName( "point_cost")]
39-
//public string? PointCost { get; set; }
40-
41-
//[JsonPropertyName( "timestamp_created")]
42-
//public long TimestampCreated { get; set; }
43-
44-
//[JsonPropertyName( "timestamp_updated")]
45-
//public long TimestampUpdated { get; set; }
46-
47-
//[JsonPropertyName( "timestamp_available")]
48-
//public long TimestampAvailable { get; set; }
49-
50-
//[JsonPropertyName( "timestamp_available_end")]
51-
//public long TimestampAvailableEnd { get; set; }
52-
53-
//[JsonPropertyName( "quantity")]
54-
//public string? Quantity { get; set; }
55-
56-
//[JsonPropertyName( "internal_description")]
57-
//public string? InternalDescription { get; set; }
58-
59-
//[JsonPropertyName( "active")]
60-
//public bool Active { get; set; }
61-
62-
[JsonPropertyName("community_item_data")]
63-
public CommunityItemData? CommunityItemData { get; set; }
64-
65-
//[JsonPropertyName( "usable_duration")]
66-
//public int UsableDuration { get; set; }
67-
68-
//[JsonPropertyName( "bundle_discount")]
69-
//public int BundleDiscount { get; set; }
70-
}
71-
72-
public sealed record CommunityItemData
73-
{
74-
[JsonPropertyName("item_name")]
75-
public string? ItemName { get; set; }
76-
77-
[JsonPropertyName("item_title")]
78-
public string? ItemTitle { get; set; }
79-
80-
[JsonPropertyName("item_description")]
81-
public string? ItemDescription { get; set; }
82-
83-
[JsonPropertyName("item_image_small")]
84-
public string? ItemImageSmall { get; set; }
85-
86-
[JsonPropertyName("item_image_large")]
87-
public string? ItemImageLarge { get; set; }
88-
89-
[JsonPropertyName("animated")]
90-
public bool Animated { get; set; }
91-
}
13+
[JsonPropertyName("reward_item")]
14+
public RewardItemData? RewardItem { get; set; }
9215
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace ASFEnhance.Data.Common;
4+
internal sealed record RewardItemData
5+
{
6+
[JsonPropertyName("appid")]
7+
public uint AppId { get; set; }
8+
9+
[JsonPropertyName("defid")]
10+
public uint DefId { get; set; }
11+
12+
[JsonPropertyName("type")]
13+
public int Type { get; set; }
14+
15+
[JsonPropertyName("community_item_class")]
16+
public int CommunityItemClass { get; set; }
17+
18+
[JsonPropertyName("community_item_type")]
19+
public int CommunityItemType { get; set; }
20+
21+
[JsonPropertyName("point_cost")]
22+
public string? PointCost { get; set; }
23+
24+
[JsonPropertyName("timestamp_created")]
25+
public long TimestampCreated { get; set; }
26+
27+
[JsonPropertyName("timestamp_updated")]
28+
public long TimestampUpdated { get; set; }
29+
30+
[JsonPropertyName("timestamp_available")]
31+
public long TimestampAvailable { get; set; }
32+
33+
[JsonPropertyName("timestamp_available_end")]
34+
public long TimestampAvailableEnd { get; set; }
35+
36+
[JsonPropertyName("quantity")]
37+
public string? Quantity { get; set; }
38+
39+
[JsonPropertyName("internal_description")]
40+
public string? InternalDescription { get; set; }
41+
42+
[JsonPropertyName("active")]
43+
public bool Active { get; set; }
44+
45+
[JsonPropertyName("community_item_data")]
46+
public CommunityItemData? CommunityItem { get; set; }
47+
48+
[JsonPropertyName("usable_duration")]
49+
public int UsableDuration { get; set; }
50+
51+
[JsonPropertyName("bundle_discount")]
52+
public int BundleDiscount { get; set; }
53+
54+
public sealed record CommunityItemData
55+
{
56+
[JsonPropertyName("item_name")]
57+
public string? ItemName { get; set; }
58+
59+
[JsonPropertyName("item_title")]
60+
public string? ItemTitle { get; set; }
61+
62+
[JsonPropertyName("item_description")]
63+
public string? ItemDescription { get; set; }
64+
65+
[JsonPropertyName("item_image_small")]
66+
public string? ItemImageSmall { get; set; }
67+
68+
[JsonPropertyName("item_image_large")]
69+
public string? ItemImageLarge { get; set; }
70+
71+
[JsonPropertyName("animated")]
72+
public bool Animated { get; set; }
73+
74+
[JsonPropertyName("tiled")]
75+
public bool Tiled { get; set; }
76+
}
77+
}
Lines changed: 3 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,9 @@
1+
using ASFEnhance.Data.Common;
12
using System.Text.Json.Serialization;
2-
using static ASFEnhance.Data.ClaimItemResponse;
33

44
namespace ASFEnhance.Data.ILoyaltyRewardsService;
55
internal sealed record QueryRewardItemsResponse
66
{
7-
[JsonPropertyName("response")]
8-
public ResponseData? Response { get; set; }
9-
public sealed record ResponseData
10-
{
11-
[JsonPropertyName("definitions")]
12-
public List<DefinitionData>? Definitions { get; set; }
13-
}
14-
15-
public sealed record DefinitionData
16-
{
17-
[JsonPropertyName("appid")]
18-
public int AppId { get; set; }
19-
20-
[JsonPropertyName("defid")]
21-
public int DefId { get; set; }
22-
23-
[JsonPropertyName("type")]
24-
public int Type { get; set; }
25-
26-
[JsonPropertyName("community_item_class")]
27-
public int CommunityItemClass { get; set; }
28-
29-
[JsonPropertyName("community_item_type")]
30-
public int CommunityItemType { get; set; }
31-
32-
[JsonPropertyName("point_cost")]
33-
public string? PointCost { get; set; }
34-
35-
[JsonPropertyName("timestamp_created")]
36-
public long TimestampCreated { get; set; }
37-
38-
[JsonPropertyName("timestamp_updated")]
39-
public long TimestampUpdated { get; set; }
40-
41-
[JsonPropertyName("timestamp_available")]
42-
public long TimestampAvailable { get; set; }
43-
44-
[JsonPropertyName("timestamp_available_end")]
45-
public long TimestampAvailableEnd { get; set; }
46-
47-
[JsonPropertyName("quantity")]
48-
public string? Quantity { get; set; }
49-
50-
[JsonPropertyName("internal_description")]
51-
public string? InternalDescription { get; set; }
52-
53-
[JsonPropertyName("active")]
54-
public bool Active { get; set; }
55-
56-
[JsonPropertyName("community_item_data")]
57-
public CommunityItemData? CommunityItem { get; set; }
58-
59-
[JsonPropertyName("usable_duration")]
60-
public int UsableDuration { get; set; }
61-
62-
[JsonPropertyName("bundle_discount")]
63-
public int BundleDiscount { get; set; }
64-
}
7+
[JsonPropertyName("definitions")]
8+
public List<RewardItemData>? Definitions { get; set; }
659
}

0 commit comments

Comments
 (0)