From 176535ca982ec1013e7f7bba2889929d50e7acc6 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Mon, 17 Jun 2024 13:14:03 +0800 Subject: [PATCH] minor change --- .../Hoyolab/HoyoPlay/Connect/ChannelSDK/ChannelSDK.cs | 5 +---- .../Connect/DeprecatedFile/DeprecatedFileConfig.cs | 5 +---- .../HoyoPlay/Connect/{GameIdentifier.cs => Game.cs} | 2 +- .../Web/Hoyolab/HoyoPlay/Connect/GameSpecified.cs | 10 ++++++++++ .../Connect/Package/{Game.cs => GameBranch.cs} | 2 +- .../Hoyolab/HoyoPlay/Connect/Package/GamePackage.cs | 9 +++------ 6 files changed, 17 insertions(+), 16 deletions(-) rename src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/{GameIdentifier.cs => Game.cs} (89%) create mode 100644 src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/GameSpecified.cs rename src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/{Game.cs => GameBranch.cs} (90%) diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/ChannelSDK/ChannelSDK.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/ChannelSDK/ChannelSDK.cs index 3586926c..18d048d7 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/ChannelSDK/ChannelSDK.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/ChannelSDK/ChannelSDK.cs @@ -3,14 +3,11 @@ namespace Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect.ChannelSDK; -internal sealed class ChannelSDK +internal sealed class ChannelSDK : GameSpecified { [JsonPropertyName("channel_sdk_pkg")] public PackageSegment ChannelSdkPackage { get; set; } = default!; - [JsonPropertyName("game")] - public GameIdentifier Game { get; set; } = default!; - [JsonPropertyName("pkg_version_file_name")] public string PackageVersionFileName { get; set; } = default!; diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/DeprecatedFile/DeprecatedFileConfig.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/DeprecatedFile/DeprecatedFileConfig.cs index 49d3dbae..7266f897 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/DeprecatedFile/DeprecatedFileConfig.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/DeprecatedFile/DeprecatedFileConfig.cs @@ -3,11 +3,8 @@ namespace Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect.DeprecatedFile; -internal sealed class DeprecatedFileConfig +internal sealed class DeprecatedFileConfig : GameSpecified { [JsonPropertyName("deprecated_files")] public List DeprecatedFiles { get; set; } = default!; - - [JsonPropertyName("game")] - public GameIdentifier Game { get; set; } = default!; } diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/GameIdentifier.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Game.cs similarity index 89% rename from src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/GameIdentifier.cs rename to src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Game.cs index 0ddbb308..44f50099 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/GameIdentifier.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Game.cs @@ -3,7 +3,7 @@ namespace Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect; -internal sealed class GameIdentifier +internal sealed class Game { [JsonPropertyName("id")] public string Id { get; set; } = default!; diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/GameSpecified.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/GameSpecified.cs new file mode 100644 index 00000000..58acd2ec --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/GameSpecified.cs @@ -0,0 +1,10 @@ +// Copyright (c) DGP Studio. All rights reserved. +// Licensed under the MIT license. + +namespace Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect; + +internal class GameSpecified +{ + [JsonPropertyName("game")] + public Game Game { get; set; } = default!; +} diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/Game.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/GameBranch.cs similarity index 90% rename from src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/Game.cs rename to src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/GameBranch.cs index b23bd126..d3088ecc 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/Game.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/GameBranch.cs @@ -3,7 +3,7 @@ namespace Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect.Package; -internal sealed class Game +internal sealed class GameBranch { [JsonPropertyName("major")] public Package? Major { get; set; } diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/GamePackage.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/GamePackage.cs index 6ecea371..56af36d4 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/GamePackage.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/HoyoPlay/Connect/Package/GamePackage.cs @@ -3,14 +3,11 @@ namespace Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect.Package; -internal sealed class GamePackage +internal sealed class GamePackage : GameSpecified { - [JsonPropertyName("game")] - public GameIdentifier Game { get; set; } = default!; - [JsonPropertyName("main")] - public Game Main { get; set; } = default!; + public GameBranch Main { get; set; } = default!; [JsonPropertyName("pre_download")] - public Game PreDownload { get; set; } = default!; + public GameBranch PreDownload { get; set; } = default!; }