feat(import): import owned card collection with unknown-card skip
Extends POST /admin/import_viewer to accept owned_cards (snapshot full-replace). Unknown card_ids are skipped, counted in skipped_card_count on the response, and logged server-side. Count is clamped to OwnedCardEntry.MaxCopies (3). Also injects ILogger into AdminController and adds Cards/Items/Decks to the viewer reload graph. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,8 @@ public class ImportViewerRequest
|
||||
[JsonPropertyName("owned_mypage_background_ids")] public List<int>? OwnedMyPageBackgroundIds { get; set; }
|
||||
|
||||
[JsonPropertyName("classes")] public List<ImportClassData>? Classes { get; set; }
|
||||
|
||||
[JsonPropertyName("owned_cards")] public List<ImportCard>? OwnedCards { get; set; }
|
||||
}
|
||||
|
||||
public class ImportCurrency
|
||||
@@ -41,3 +43,10 @@ public class ImportClassData
|
||||
[JsonPropertyName("level")] public int Level { get; set; }
|
||||
[JsonPropertyName("exp")] public int Exp { get; set; }
|
||||
}
|
||||
|
||||
public class ImportCard
|
||||
{
|
||||
[JsonPropertyName("card_id")] public long CardId { get; set; }
|
||||
[JsonPropertyName("count")] public int Count { get; set; }
|
||||
[JsonPropertyName("is_protected")] public bool IsProtected { get; set; }
|
||||
}
|
||||
|
||||
@@ -7,4 +7,5 @@ public class ImportViewerResponse
|
||||
[JsonPropertyName("viewer_id")] public long ViewerId { get; set; }
|
||||
[JsonPropertyName("short_udid")] public long ShortUdid { get; set; }
|
||||
[JsonPropertyName("was_created")] public bool WasCreated { get; set; }
|
||||
[JsonPropertyName("skipped_card_count")] public int SkippedCardCount { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user