diff --git a/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/AvatarInfoService.cs b/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/AvatarInfoService.cs index be8286d9..44ed0d8b 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/AvatarInfoService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/AvatarInfoService.cs @@ -13,9 +13,6 @@ using EntityAvatarInfo = Snap.Hutao.Model.Entity.AvatarInfo; namespace Snap.Hutao.Service.AvatarInfo; -/// -/// 角色信息服务 -/// [HighQuality] [ConstructorGenerated] [Injection(InjectAs.Scoped, typeof(IAvatarInfoService))] @@ -23,12 +20,11 @@ internal sealed partial class AvatarInfoService : IAvatarInfoService { private readonly AvatarInfoDbBulkOperation avatarInfoDbBulkOperation; private readonly IAvatarInfoDbService avatarInfoDbService; + private readonly IServiceScopeFactory serviceScopeFactory; private readonly ILogger logger; private readonly IMetadataService metadataService; private readonly ISummaryFactory summaryFactory; - private readonly EnkaClient enkaClient; - /// public async ValueTask> GetSummaryAsync(UserAndUid userAndUid, RefreshOption refreshOption, CancellationToken token = default) { if (await metadataService.InitializeAsync().ConfigureAwait(false)) @@ -92,8 +88,13 @@ internal sealed partial class AvatarInfoService : IAvatarInfoService private async ValueTask GetEnkaResponseAsync(PlayerUid uid, CancellationToken token = default) { - return await enkaClient.GetForwardDataAsync(uid, token).ConfigureAwait(false) - ?? await enkaClient.GetDataAsync(uid, token).ConfigureAwait(false); + using (IServiceScope scope = serviceScopeFactory.CreateScope()) + { + EnkaClient enkaClient = scope.ServiceProvider.GetRequiredService(); + + return await enkaClient.GetForwardDataAsync(uid, token).ConfigureAwait(false) + ?? await enkaClient.GetDataAsync(uid, token).ConfigureAwait(false); + } } private async ValueTask GetSummaryCoreAsync(IEnumerable avatarInfos, CancellationToken token) diff --git a/src/Snap.Hutao/Snap.Hutao/Service/DailyNote/DailyNoteService.cs b/src/Snap.Hutao/Snap.Hutao/Service/DailyNote/DailyNoteService.cs index 59946a3d..85615462 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/DailyNote/DailyNoteService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/DailyNote/DailyNoteService.cs @@ -46,11 +46,17 @@ internal sealed partial class DailyNoteService : IDailyNoteService, IRecipient dailyNoteResponse = await serviceProvider - .GetRequiredService>() - .Create(PlayerUid.IsOversea(roleUid)) - .GetDailyNoteAsync(userAndUid) - .ConfigureAwait(false); + Web.Response.Response dailyNoteResponse; + using (IServiceScope scope = serviceProvider.CreateScope()) + { + IGameRecordClient gameRecordClient = scope.ServiceProvider + .GetRequiredService>() + .Create(PlayerUid.IsOversea(roleUid)); + + dailyNoteResponse = await gameRecordClient + .GetDailyNoteAsync(userAndUid) + .ConfigureAwait(false); + } if (dailyNoteResponse.IsOk()) { @@ -117,11 +123,17 @@ internal sealed partial class DailyNoteService : IDailyNoteService, IRecipient dailyNoteResponse = await serviceProvider - .GetRequiredService>() - .Create(PlayerUid.IsOversea(entry.Uid)) - .GetDailyNoteAsync(new(entry.User, entry.Uid)) - .ConfigureAwait(false); + Web.Response.Response dailyNoteResponse; + using (IServiceScope scope = serviceProvider.CreateScope()) + { + IGameRecordClient gameRecordClient = serviceProvider + .GetRequiredService>() + .Create(PlayerUid.IsOversea(entry.Uid)); + + dailyNoteResponse = await gameRecordClient + .GetDailyNoteAsync(new(entry.User, entry.Uid)) + .ConfigureAwait(false); + } if (dailyNoteResponse.IsOk()) { diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Metadata/ContextAbstraction/MetadataServiceContextExtension.cs b/src/Snap.Hutao/Snap.Hutao/Service/Metadata/ContextAbstraction/MetadataServiceContextExtension.cs index d39d5c2f..4f1fb65e 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Metadata/ContextAbstraction/MetadataServiceContextExtension.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Metadata/ContextAbstraction/MetadataServiceContextExtension.cs @@ -36,6 +36,11 @@ internal static class MetadataServiceContextExtension // Dictionary { + if (context is IMetadataDictionaryIdAchievementSource dictionaryIdAchievementSource) + { + dictionaryIdAchievementSource.IdAchievementMap = await metadataService.GetIdToAchievementMapAsync(token).ConfigureAwait(false); + } + if (context is IMetadataDictionaryIdAvatarSource dictionaryIdAvatarSource) { dictionaryIdAvatarSource.IdAvatarMap = await metadataService.GetIdToAvatarMapAsync(token).ConfigureAwait(false); diff --git a/src/Snap.Hutao/Snap.Hutao/Service/SignIn/SignInService.cs b/src/Snap.Hutao/Snap.Hutao/Service/SignIn/SignInService.cs index 18d690c4..4c46a367 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/SignIn/SignInService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/SignIn/SignInService.cs @@ -16,31 +16,22 @@ internal sealed partial class SignInService : ISignInService public async ValueTask> ClaimRewardAsync(UserAndUid userAndUid, CancellationToken token = default) { - ISignInClient signInClient = serviceProvider - .GetRequiredService>() - .Create(userAndUid.User.IsOversea); - - Response rewardResponse = await signInClient.GetRewardAsync(userAndUid.User, token).ConfigureAwait(false); - - if (rewardResponse.IsOk()) + using (IServiceScope scope = serviceProvider.CreateScope()) { + ISignInClient signInClient = scope.ServiceProvider + .GetRequiredService>() + .Create(userAndUid.User.IsOversea); + + Response rewardResponse = await signInClient.GetRewardAsync(userAndUid.User, token).ConfigureAwait(false); + + if (!rewardResponse.IsOk()) + { + return new(false, SH.ServiceSignInRewardListRequestFailed); + } + Response resultResponse = await signInClient.SignAsync(userAndUid, token).ConfigureAwait(false); - if (resultResponse.IsOk(showInfoBar: false)) - { - Response infoResponse = await signInClient.GetInfoAsync(userAndUid, token).ConfigureAwait(false); - if (infoResponse.IsOk()) - { - int index = infoResponse.Data.TotalSignDay - 1; - Award award = rewardResponse.Data.Awards[index]; - return new(true, SH.FormatServiceSignInSuccessRewardFormat(award.Name, award.Count)); - } - else - { - return new(false, SH.ServiceSignInInfoRequestFailed); - } - } - else + if (!resultResponse.IsOk(showInfoBar: false)) { string message = resultResponse.Message; @@ -56,10 +47,16 @@ internal sealed partial class SignInService : ISignInService return new(false, SH.FormatServiceSignInClaimRewardFailedFormat(message)); } - } - else - { - return new(false, SH.ServiceSignInRewardListRequestFailed); + + Response infoResponse = await signInClient.GetInfoAsync(userAndUid, token).ConfigureAwait(false); + if (!infoResponse.IsOk()) + { + return new(false, SH.ServiceSignInInfoRequestFailed); + } + + int index = infoResponse.Data.TotalSignDay - 1; + Award award = rewardResponse.Data.Awards[index]; + return new(true, SH.FormatServiceSignInSuccessRewardFormat(award.Name, award.Count)); } } } \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Service/SpiralAbyss/SpiralAbyssRecordService.cs b/src/Snap.Hutao/Snap.Hutao/Service/SpiralAbyss/SpiralAbyssRecordService.cs index 161e45f3..08afbaa8 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/SpiralAbyss/SpiralAbyssRecordService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/SpiralAbyss/SpiralAbyssRecordService.cs @@ -21,8 +21,9 @@ namespace Snap.Hutao.Service.SpiralAbyss; [Injection(InjectAs.Scoped, typeof(ISpiralAbyssRecordService))] internal sealed partial class SpiralAbyssRecordService : ISpiralAbyssRecordService { - private readonly IOverseaSupportFactory gameRecordClientFactory; + //private readonly IOverseaSupportFactory gameRecordClientFactory; private readonly ISpiralAbyssRecordDbService spiralAbyssRecordDbService; + private readonly IServiceScopeFactory serviceScopeFactory; private readonly IMetadataService metadataService; private readonly ITaskContext taskContext; @@ -76,54 +77,69 @@ internal sealed partial class SpiralAbyssRecordService : ISpiralAbyssRecordServi /// public async ValueTask RefreshSpiralAbyssAsync(UserAndUid userAndUid) { - // request the index first - await gameRecordClientFactory - .Create(userAndUid.User.IsOversea) - .GetPlayerInfoAsync(userAndUid) - .ConfigureAwait(false); + using (IServiceScope scope = serviceScopeFactory.CreateScope()) + { + IOverseaSupportFactory gameRecordClientFactory = scope.ServiceProvider.GetRequiredService>(); - await RefreshSpiralAbyssCoreAsync(userAndUid, SpiralAbyssSchedule.Last).ConfigureAwait(false); - await RefreshSpiralAbyssCoreAsync(userAndUid, SpiralAbyssSchedule.Current).ConfigureAwait(false); + // request the index first + await gameRecordClientFactory + .Create(userAndUid.User.IsOversea) + .GetPlayerInfoAsync(userAndUid) + .ConfigureAwait(false); + + await RefreshSpiralAbyssCoreAsync(userAndUid, SpiralAbyssSchedule.Last).ConfigureAwait(false); + await RefreshSpiralAbyssCoreAsync(userAndUid, SpiralAbyssSchedule.Current).ConfigureAwait(false); + } } private async ValueTask RefreshSpiralAbyssCoreAsync(UserAndUid userAndUid, SpiralAbyssSchedule schedule) { - Response response = await gameRecordClientFactory - .Create(userAndUid.User.IsOversea) - .GetSpiralAbyssAsync(userAndUid, schedule) - .ConfigureAwait(false); - - if (response.IsOk()) + Response response; + using (IServiceScope scope = serviceScopeFactory.CreateScope()) { - Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.SpiralAbyss webSpiralAbyss = response.Data; + IOverseaSupportFactory gameRecordClientFactory = scope.ServiceProvider.GetRequiredService>(); - ArgumentNullException.ThrowIfNull(spiralAbysses); - ArgumentNullException.ThrowIfNull(metadataContext); - - int index = spiralAbysses.FirstIndexOf(s => s.ScheduleId == webSpiralAbyss.ScheduleId); - if (index >= 0) - { - await taskContext.SwitchToBackgroundAsync(); - SpiralAbyssView view = spiralAbysses[index]; - - SpiralAbyssEntry targetEntry; - if (view.Entity is not null) - { - view.Entity.SpiralAbyss = webSpiralAbyss; - await spiralAbyssRecordDbService.UpdateSpiralAbyssEntryAsync(view.Entity).ConfigureAwait(false); - targetEntry = view.Entity; - } - else - { - SpiralAbyssEntry newEntry = SpiralAbyssEntry.From(userAndUid.Uid.Value, webSpiralAbyss); - await spiralAbyssRecordDbService.AddSpiralAbyssEntryAsync(newEntry).ConfigureAwait(false); - targetEntry = newEntry; - } - - await taskContext.SwitchToMainThreadAsync(); - spiralAbysses.RemoveAt(index); - spiralAbysses.Insert(index, SpiralAbyssView.From(targetEntry, metadataContext)); - } + response = await gameRecordClientFactory + .Create(userAndUid.User.IsOversea) + .GetSpiralAbyssAsync(userAndUid, schedule) + .ConfigureAwait(false); } + + if (!response.IsOk()) + { + return; + } + + Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.SpiralAbyss webSpiralAbyss = response.Data; + + ArgumentNullException.ThrowIfNull(spiralAbysses); + ArgumentNullException.ThrowIfNull(metadataContext); + + int index = spiralAbysses.FirstIndexOf(s => s.ScheduleId == webSpiralAbyss.ScheduleId); + if (index < 0) + { + return; + } + + await taskContext.SwitchToBackgroundAsync(); + SpiralAbyssView view = spiralAbysses[index]; + + SpiralAbyssEntry targetEntry; + if (view.Entity is not null) + { + view.Entity.SpiralAbyss = webSpiralAbyss; + await spiralAbyssRecordDbService.UpdateSpiralAbyssEntryAsync(view.Entity).ConfigureAwait(false); + targetEntry = view.Entity; + } + else + { + SpiralAbyssEntry newEntry = SpiralAbyssEntry.From(userAndUid.Uid.Value, webSpiralAbyss); + await spiralAbyssRecordDbService.AddSpiralAbyssEntryAsync(newEntry).ConfigureAwait(false); + targetEntry = newEntry; + } + + await taskContext.SwitchToMainThreadAsync(); + spiralAbysses.RemoveAt(index); + spiralAbysses.Insert(index, SpiralAbyssView.From(targetEntry, metadataContext)); } } \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Service/User/UserInitializationService.cs b/src/Snap.Hutao/Snap.Hutao/Service/User/UserInitializationService.cs index 3f551ae7..18af3acd 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/User/UserInitializationService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/User/UserInitializationService.cs @@ -68,6 +68,7 @@ internal sealed partial class UserInitializationService : IUserInitializationSer return false; } + // TODO: sharing scope if (!await TrySetUserLTokenAsync(user, token).ConfigureAwait(false)) { return false; @@ -100,11 +101,17 @@ internal sealed partial class UserInitializationService : IUserInitializationSer return true; } - Response lTokenResponse = await serviceProvider - .GetRequiredService>() - .Create(user.IsOversea) - .GetLTokenBySTokenAsync(user.Entity, token) - .ConfigureAwait(false); + Response lTokenResponse; + using (IServiceScope scope = serviceProvider.CreateScope()) + { + IPassportClient passportClient = scope.ServiceProvider + .GetRequiredService>() + .Create(user.IsOversea); + + lTokenResponse = await passportClient + .GetLTokenBySTokenAsync(user.Entity, token) + .ConfigureAwait(false); + } if (lTokenResponse.IsOk()) { @@ -131,11 +138,17 @@ internal sealed partial class UserInitializationService : IUserInitializationSer } } - Response cookieTokenResponse = await serviceProvider - .GetRequiredService>() - .Create(user.IsOversea) - .GetCookieAccountInfoBySTokenAsync(user.Entity, token) - .ConfigureAwait(false); + Response cookieTokenResponse; + using (IServiceScope scope = serviceProvider.CreateScope()) + { + IPassportClient passportClient = scope.ServiceProvider + .GetRequiredService>() + .Create(user.IsOversea); + + cookieTokenResponse = await passportClient + .GetCookieAccountInfoBySTokenAsync(user.Entity, token) + .ConfigureAwait(false); + } if (cookieTokenResponse.IsOk()) { @@ -157,11 +170,17 @@ internal sealed partial class UserInitializationService : IUserInitializationSer private async ValueTask TrySetUserUserInfoAsync(ViewModel.User.User user, CancellationToken token) { - Response response = await serviceProvider - .GetRequiredService>() - .Create(user.IsOversea) - .GetUserFullInfoAsync(user.Entity, token) - .ConfigureAwait(false); + Response response; + using (IServiceScope scope = serviceProvider.CreateScope()) + { + IUserClient userClient = scope.ServiceProvider + .GetRequiredService>() + .Create(user.IsOversea); + + response = await userClient + .GetUserFullInfoAsync(user.Entity, token) + .ConfigureAwait(false); + } if (response.IsOk()) { @@ -176,10 +195,16 @@ internal sealed partial class UserInitializationService : IUserInitializationSer private async ValueTask TrySetUserUserGameRolesAsync(ViewModel.User.User user, CancellationToken token) { - Response> userGameRolesResponse = await serviceProvider - .GetRequiredService() - .GetUserGameRolesOverseaAwareAsync(user.Entity, token) - .ConfigureAwait(false); + Response> userGameRolesResponse; + using (IServiceScope scope = serviceProvider.CreateScope()) + { + BindingClient bindingClient = scope.ServiceProvider + .GetRequiredService(); + + userGameRolesResponse = await bindingClient + .GetUserGameRolesOverseaAwareAsync(user.Entity, token) + .ConfigureAwait(false); + } if (userGameRolesResponse.IsOk()) { diff --git a/src/Snap.Hutao/Snap.Hutao/Service/User/UserService.cs b/src/Snap.Hutao/Snap.Hutao/Service/User/UserService.cs index 4c3ffae1..24b46f0c 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/User/UserService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/User/UserService.cs @@ -93,11 +93,17 @@ internal sealed partial class UserService : IUserService, IUserServiceUnsafe public async ValueTask RefreshCookieTokenAsync(Model.Entity.User user) { // TODO: 提醒其他组件此用户的Cookie已更改 - Response cookieTokenResponse = await serviceProvider - .GetRequiredService>() - .Create(user.IsOversea) - .GetCookieAccountInfoBySTokenAsync(user) - .ConfigureAwait(false); + Response cookieTokenResponse; + using (IServiceScope scope = serviceProvider.CreateScope()) + { + IPassportClient passportClient = serviceProvider + .GetRequiredService>() + .Create(user.IsOversea); + + cookieTokenResponse = await passportClient + .GetCookieAccountInfoBySTokenAsync(user) + .ConfigureAwait(false); + } if (!cookieTokenResponse.IsOk()) { diff --git a/src/Snap.Hutao/Snap.Hutao/ViewModel/SpiralAbyss/SpiralAbyssMetadataContext.cs b/src/Snap.Hutao/Snap.Hutao/ViewModel/SpiralAbyss/SpiralAbyssMetadataContext.cs index a258da01..20f94fa2 100644 --- a/src/Snap.Hutao/Snap.Hutao/ViewModel/SpiralAbyss/SpiralAbyssMetadataContext.cs +++ b/src/Snap.Hutao/Snap.Hutao/ViewModel/SpiralAbyss/SpiralAbyssMetadataContext.cs @@ -8,6 +8,7 @@ using Snap.Hutao.Model.Primitive; namespace Snap.Hutao.ViewModel.SpiralAbyss; +// TODO: replace this internal sealed class SpiralAbyssMetadataContext { public Dictionary IdScheduleMap { get; set; } = default!; diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Bridge/MiHoYoJSBridge.cs b/src/Snap.Hutao/Snap.Hutao/Web/Bridge/MiHoYoJSBridge.cs index 315fe113..43b1a422 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Bridge/MiHoYoJSBridge.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Bridge/MiHoYoJSBridge.cs @@ -259,31 +259,35 @@ internal class MiHoYoJSBridge protected virtual async ValueTask>> GetUserInfoAsync(JsParam param) { - Response response = await serviceProvider - .GetRequiredService>() - .Create(userAndUid.User.IsOversea) - .GetUserFullInfoAsync(userAndUid.User) - .ConfigureAwait(false); - - if (response.IsOk()) + Response response; + using (IServiceScope scope = serviceProvider.CreateScope()) { - UserInfo info = response.Data.UserInfo; - return new() - { - Data = new() - { - ["id"] = info.Uid, - ["gender"] = info.Gender, - ["nickname"] = info.Nickname, - ["introduce"] = info.Introduce, - ["avatar_url"] = info.AvatarUrl, - }, - }; + IUserClient userClient = scope.ServiceProvider + .GetRequiredService>() + .Create(userAndUid.User.IsOversea); + + response = await userClient + .GetUserFullInfoAsync(userAndUid.User) + .ConfigureAwait(false); } - else + + if (!response.IsOk()) { return new(); } + + UserInfo info = response.Data.UserInfo; + return new() + { + Data = new() + { + ["id"] = info.Uid, + ["gender"] = info.Gender, + ["nickname"] = info.Nickname, + ["introduce"] = info.Introduce, + ["avatar_url"] = info.AvatarUrl, + }, + }; } protected virtual async ValueTask PushPageAsync(JsParam param) diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Enka/EnkaClient.cs b/src/Snap.Hutao/Snap.Hutao/Web/Enka/EnkaClient.cs index 7290ebc3..c02c196c 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Enka/EnkaClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Enka/EnkaClient.cs @@ -15,9 +15,6 @@ using System.Net.Sockets; namespace Snap.Hutao.Web.Enka; -/// -/// Enka API 客户端 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.Default)] @@ -29,23 +26,11 @@ internal sealed partial class EnkaClient private readonly JsonSerializerOptions options; private readonly HttpClient httpClient; - /// - /// 异步获取转发的 Enka API 响应 - /// - /// 玩家Uid - /// 取消令牌 - /// Enka API 响应 public ValueTask GetForwardDataAsync(in PlayerUid playerUid, CancellationToken token = default) { return TryGetEnkaResponseCoreAsync(HutaoEndpoints.Enka(playerUid), token); } - /// - /// 异步获取 Enka API 响应 - /// - /// 玩家Uid - /// 取消令牌 - /// Enka API 响应 public ValueTask GetDataAsync(in PlayerUid playerUid, CancellationToken token = default) { return TryGetEnkaResponseCoreAsync(string.Format(CultureInfo.CurrentCulture, EnkaAPI, playerUid), token); diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Annotation/ApiInformationAttribute.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Annotation/ApiInformationAttribute.cs deleted file mode 100644 index 83a7fa01..00000000 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Annotation/ApiInformationAttribute.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) DGP Studio. All rights reserved. -// Licensed under the MIT license. - -using Snap.Hutao.Web.Hoyolab.DataSigning; - -namespace Snap.Hutao.Web.Hoyolab.Annotation; - -/// -/// API 信息 -/// 指示此API 已经经过验证,且明确其调用 -/// -[AttributeUsage(AttributeTargets.Method)] -internal sealed class ApiInformationAttribute : Attribute -{ - /// - /// Cookie类型 - /// - public CookieType Cookie { get; set; } - - /// - /// SALT - /// - public SaltType Salt { get; set; } -} \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/App/Account/AccountClient.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/App/Account/AccountClient.cs index 2e7f3b89..e80c3d83 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/App/Account/AccountClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/App/Account/AccountClient.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.Model.Entity; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Hoyolab.DataSigning; using Snap.Hutao.Web.Hoyolab.Takumi.Binding; using Snap.Hutao.Web.Request.Builder; @@ -13,9 +12,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.App.Account; -/// -/// 账户客户端 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.XRpc)] @@ -25,14 +21,6 @@ internal sealed partial class AccountClient private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 异步生成米游社操作验证密钥 - /// - /// 用户 - /// 提交数据 - /// 取消令牌 - /// 用户角色信息 - [ApiInformation(Cookie = CookieType.SToken, Salt = SaltType.K2)] public async ValueTask> GenerateAuthenticationKeyAsync(User user, GenAuthKeyData data, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Bbs/User/UserClient.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Bbs/User/UserClient.cs index f13416d8..329ece47 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Bbs/User/UserClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Bbs/User/UserClient.cs @@ -9,9 +9,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Bbs.User; -/// -/// 用户信息客户端 DS版 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.XRpc)] @@ -21,12 +18,6 @@ internal sealed partial class UserClient : IUserClient private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 获取当前用户详细信息 - /// - /// 用户 - /// 取消令牌 - /// 详细信息 public async ValueTask> GetUserFullInfoAsync(Model.Entity.User user, CancellationToken token = default) { ArgumentException.ThrowIfNullOrEmpty(user.Aid); diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Bbs/User/UserClientOversea.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Bbs/User/UserClientOversea.cs index ac719dfc..9a060b2c 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Bbs/User/UserClientOversea.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Bbs/User/UserClientOversea.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Request.Builder; using Snap.Hutao.Web.Request.Builder.Abstraction; using Snap.Hutao.Web.Response; @@ -10,9 +9,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Bbs.User; -/// -/// 用户信息客户端 Hoyolab版 -/// [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.Default)] internal sealed partial class UserClientOversea : IUserClient @@ -21,13 +17,6 @@ internal sealed partial class UserClientOversea : IUserClient private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 获取当前用户详细信息,使用 LToken - /// - /// 用户 - /// 取消令牌 - /// 详细信息 - [ApiInformation(Cookie = CookieType.LToken)] public async ValueTask> GetUserFullInfoAsync(Model.Entity.User user, CancellationToken token = default) { ArgumentException.ThrowIfNullOrEmpty(user.Aid); diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClient.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClient.cs index 8f98219d..19c0f34a 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClient.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.Model.Entity; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Hoyolab.DataSigning; using Snap.Hutao.Web.Request.Builder; using Snap.Hutao.Web.Request.Builder.Abstraction; @@ -12,9 +11,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Passport; -/// -/// 通行证客户端 XRPC 版 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.XRpc2)] @@ -24,13 +20,6 @@ internal sealed partial class PassportClient : IPassportClient private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 异步获取 CookieToken - /// - /// 用户 - /// 取消令牌 - /// cookie token - [ApiInformation(Cookie = CookieType.SToken, Salt = SaltType.PROD)] public async ValueTask> GetCookieAccountInfoBySTokenAsync(User user, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -47,13 +36,6 @@ internal sealed partial class PassportClient : IPassportClient return Response.Response.DefaultIfNull(resp); } - /// - /// 异步获取 LToken - /// - /// 用户 - /// 取消令牌 - /// uid 与 cookie token - [ApiInformation(Cookie = CookieType.SToken, Salt = SaltType.PROD)] public async ValueTask> GetLTokenBySTokenAsync(User user, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClient2.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClient2.cs index ebe956ec..13cdbb69 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClient2.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClient2.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.Model.Entity; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Hoyolab.DataSigning; using Snap.Hutao.Web.Request.Builder; using Snap.Hutao.Web.Request.Builder.Abstraction; @@ -13,9 +12,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Passport; -/// -/// 通行证客户端 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.XRpc2)] @@ -25,13 +21,6 @@ internal sealed partial class PassportClient2 private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 异步验证 LToken - /// - /// 用户 - /// 取消令牌 - /// 验证信息 - [ApiInformation(Cookie = CookieType.LToken)] public async ValueTask> VerifyLtokenAsync(User user, CancellationToken token) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -46,13 +35,6 @@ internal sealed partial class PassportClient2 return Response.Response.DefaultIfNull(resp); } - /// - /// V1 SToken 登录 - /// - /// v1 SToken - /// 取消令牌 - /// 登录数据 - [ApiInformation(Salt = SaltType.PROD)] public async ValueTask> LoginBySTokenAsync(Cookie stokenV1, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClientOversea.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClientOversea.cs index 2f4a1ac8..faf49461 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClientOversea.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/PassportClientOversea.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.Model.Entity; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Request.Builder; using Snap.Hutao.Web.Request.Builder.Abstraction; using Snap.Hutao.Web.Response; @@ -11,9 +10,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Passport; -/// -/// 通行证客户端 XRPC 版 -/// [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.XRpc3)] internal sealed partial class PassportClientOversea : IPassportClient @@ -22,13 +18,6 @@ internal sealed partial class PassportClientOversea : IPassportClient private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 异步获取 CookieToken - /// - /// 用户 - /// 取消令牌 - /// cookie token - [ApiInformation(Cookie = CookieType.SToken)] public async ValueTask> GetCookieAccountInfoBySTokenAsync(User user, CancellationToken token = default) { string? stoken = user.SToken?.GetValueOrDefault(Cookie.STOKEN); @@ -48,13 +37,6 @@ internal sealed partial class PassportClientOversea : IPassportClient return Response.Response.DefaultIfNull(resp); } - /// - /// 异步获取 LToken - /// - /// 用户 - /// 取消令牌 - /// uid 与 cookie token - [ApiInformation(Cookie = CookieType.SToken)] public async ValueTask> GetLTokenBySTokenAsync(User user, CancellationToken token = default) { string? stoken = user.SToken?.GetValueOrDefault(Cookie.STOKEN); diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Auth/AuthClient.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Auth/AuthClient.cs index 50820381..0f7207e8 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Auth/AuthClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Auth/AuthClient.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.Model.Entity; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Hoyolab.DataSigning; using Snap.Hutao.Web.Hoyolab.Takumi.Binding; using Snap.Hutao.Web.Request.Builder; @@ -13,9 +12,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Takumi.Auth; -/// -/// 授权客户端 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.Default)] @@ -25,7 +21,6 @@ internal sealed partial class AuthClient private readonly ILogger logger; private readonly HttpClient httpClient; - [ApiInformation(Cookie = CookieType.SToken, Salt = SaltType.K2)] public async ValueTask> GetActionTicketBySTokenAsync(string action, User user, CancellationToken token = default) { ArgumentException.ThrowIfNullOrEmpty(user.Aid); @@ -45,13 +40,6 @@ internal sealed partial class AuthClient return Response.Response.DefaultIfNull(resp); } - /// - /// 获取 MultiToken - /// - /// login cookie - /// 是否为国际服 - /// 取消令牌 - /// 包含token的字典 public async ValueTask>> GetMultiTokenByLoginTicketAsync(Cookie cookie, bool isOversea, CancellationToken token = default) { Response>? resp = null; diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Binding/BindingClient.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Binding/BindingClient.cs index c02f6736..7fab149c 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Binding/BindingClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Binding/BindingClient.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.Model.Entity; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Hoyolab.Takumi.Auth; using Snap.Hutao.Web.Request.Builder; using Snap.Hutao.Web.Request.Builder.Abstraction; @@ -12,9 +11,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Takumi.Binding; -/// -/// 绑定客户端 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.Default)] @@ -25,13 +21,6 @@ internal sealed partial class BindingClient private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 异步获取用户角色信息 - /// 自动判断是否为国际服 - /// - /// 用户 - /// 取消令牌 - /// 用户角色信息 public async ValueTask>> GetUserGameRolesOverseaAwareAsync(User user, CancellationToken token = default) { if (user.IsOversea) @@ -55,14 +44,6 @@ internal sealed partial class BindingClient } } - /// - /// 异步获取用户角色信息 - /// - /// 操作凭证 - /// 用户 - /// 取消令牌 - /// 用户角色信息 - [ApiInformation(Cookie = CookieType.LToken)] public async ValueTask>> GetUserGameRolesByActionTicketAsync(string actionTicket, User user, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -77,13 +58,6 @@ internal sealed partial class BindingClient return Response.Response.DefaultIfNull(resp); } - /// - /// 异步获取国际服用户角色信息 - /// - /// 用户 - /// 取消令牌 - /// 用户角色信息 - [ApiInformation(Cookie = CookieType.LToken)] public async ValueTask>> GetOverseaUserGameRolesByCookieAsync(User user, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Binding/BindingClient2.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Binding/BindingClient2.cs index fdf4232a..19a3d1a2 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Binding/BindingClient2.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Binding/BindingClient2.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.Model.Entity; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Hoyolab.DataSigning; using Snap.Hutao.Web.Request.Builder; using Snap.Hutao.Web.Request.Builder.Abstraction; @@ -12,9 +11,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Takumi.Binding; -/// -/// SToken绑定客户端 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.XRpc)] @@ -25,13 +21,6 @@ internal sealed partial class BindingClient2 private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 获取用户角色信息 - /// - /// 用户 - /// 取消令牌 - /// 用户角色信息 - [ApiInformation(Cookie = CookieType.SToken, Salt = SaltType.LK2)] public async ValueTask>> GetUserGameRolesBySTokenAsync(User user, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -49,15 +38,6 @@ internal sealed partial class BindingClient2 return Response.Response.DefaultIfNull(resp); } - /// - /// 异步生成祈愿验证密钥 - /// 需要 SToken - /// - /// 用户 - /// 提交数据 - /// 取消令牌 - /// 用户角色信息 - [ApiInformation(Cookie = CookieType.SToken, Salt = SaltType.LK2)] public async ValueTask> GenerateAuthenticationKeyAsync(User user, GenAuthKeyData data, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Event/Calculate/CalculateClient.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Event/Calculate/CalculateClient.cs index 88257ea7..e3e050f0 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Event/Calculate/CalculateClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/Event/Calculate/CalculateClient.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.ViewModel.User; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Request.Builder; using Snap.Hutao.Web.Request.Builder.Abstraction; using Snap.Hutao.Web.Response; @@ -11,9 +10,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate; -/// -/// 养成计算器客户端 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.Default)] @@ -23,14 +19,6 @@ internal sealed partial class CalculateClient private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 异步计算结果 - /// - /// 用户 - /// 差异 - /// 取消令牌 - /// 消耗结果 - [ApiInformation(Cookie = CookieType.Cookie)] public async ValueTask> ComputeAsync(Model.Entity.User user, AvatarPromotionDelta delta, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -46,12 +34,6 @@ internal sealed partial class CalculateClient return Response.Response.DefaultIfNull(resp); } - /// - /// 异步获取角色列表 - /// - /// 用户与角色 - /// 取消令牌 - /// 角色列表 public async ValueTask> GetAvatarsAsync(UserAndUid userAndUid, CancellationToken token = default) { int currentPage = 1; @@ -91,13 +73,6 @@ internal sealed partial class CalculateClient return avatars; } - /// - /// 异步获取角色详情 - /// - /// 用户与角色 - /// 角色 - /// 取消令牌 - /// 角色详情 public async ValueTask> GetAvatarDetailAsync(UserAndUid userAndUid, Avatar avatar, CancellationToken token = default) { string url = userAndUid.User.IsOversea @@ -117,13 +92,6 @@ internal sealed partial class CalculateClient return Response.Response.DefaultIfNull(resp); } - /// - /// 异步获取摹本的家具列表 - /// - /// 用户 - /// 摹本码 - /// 取消令牌 - /// 家具列表 public async ValueTask> FurnitureBlueprintAsync(Model.Entity.User user, string shareCode, CancellationToken token) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -139,13 +107,6 @@ internal sealed partial class CalculateClient return Response.Response.DefaultIfNull(resp); } - /// - /// 家具数量计算 - /// - /// 用户 - /// 物品 - /// 取消令牌 - /// 消耗 public async ValueTask>> FurnitureComputeAsync(Model.Entity.User user, List items, CancellationToken token) { ListWrapper data = new() { List = items.Select(i => new IdCount { Id = i.Id, Count = i.Num }).ToList() }; diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/CardClient.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/CardClient.cs index 41e9e4b2..3061c4ea 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/CardClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/CardClient.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.Model.Entity; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Hoyolab.DataSigning; using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.Verification; using Snap.Hutao.Web.Request.Builder; @@ -13,9 +12,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Takumi.GameRecord; -/// -/// 卡片客户端 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.XRpc)] @@ -60,13 +56,6 @@ internal sealed partial class CardClient return Response.Response.DefaultIfNull(resp); } - /// - /// 异步获取桌面小组件数据 - /// - /// 用户 - /// 取消令牌 - /// 桌面小组件数据 - [ApiInformation(Cookie = CookieType.SToken, Salt = SaltType.X6)] public async ValueTask> GetWidgetDataAsync(User user, CancellationToken token) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/GameRecordClient.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/GameRecordClient.cs index 34f78c9b..37c8d537 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/GameRecordClient.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/GameRecordClient.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.ViewModel.User; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Hoyolab.DataSigning; using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.Avatar; using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.Verification; @@ -14,9 +13,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Takumi.GameRecord; -/// -/// 游戏记录提供器 -/// [HighQuality] [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.XRpc)] @@ -28,7 +24,6 @@ internal sealed partial class GameRecordClient : IGameRecordClient private readonly ILogger logger; private readonly HttpClient httpClient; - [ApiInformation(Cookie = CookieType.Cookie, Salt = SaltType.X4)] public async ValueTask> GetDailyNoteAsync(UserAndUid userAndUid, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -72,7 +67,6 @@ internal sealed partial class GameRecordClient : IGameRecordClient return Response.Response.DefaultIfNull(resp); } - [ApiInformation(Cookie = CookieType.LToken, Salt = SaltType.X4)] public async ValueTask> GetPlayerInfoAsync(UserAndUid userAndUid, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -116,14 +110,6 @@ internal sealed partial class GameRecordClient : IGameRecordClient return Response.Response.DefaultIfNull(resp); } - /// - /// 获取玩家深渊信息 - /// - /// 用户 - /// 1:当期,2:上期 - /// 取消令牌 - /// 深渊信息 - [ApiInformation(Cookie = CookieType.Cookie, Salt = SaltType.X4)] public async ValueTask> GetSpiralAbyssAsync(UserAndUid userAndUid, SpiralAbyssSchedule schedule, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -167,13 +153,6 @@ internal sealed partial class GameRecordClient : IGameRecordClient return Response.Response.DefaultIfNull(resp); } - /// - /// 异步获取角色基本信息 - /// - /// 用户与角色 - /// 取消令牌 - /// 角色基本信息 - [ApiInformation(Cookie = CookieType.LToken, Salt = SaltType.X4)] public async ValueTask> GetRoleBasicInfoAsync(UserAndUid userAndUid, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -191,14 +170,6 @@ internal sealed partial class GameRecordClient : IGameRecordClient return Response.Response.DefaultIfNull(resp); } - /// - /// 获取玩家角色详细信息 - /// - /// 用户与角色 - /// 玩家的基础信息 - /// 取消令牌 - /// 角色列表 - [ApiInformation(Cookie = CookieType.LToken, Salt = SaltType.X4)] public async ValueTask> GetCharactersAsync(UserAndUid userAndUid, PlayerInfo playerInfo, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/GameRecordClientOversea.cs b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/GameRecordClientOversea.cs index a1ca3068..8d781286 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/GameRecordClientOversea.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Takumi/GameRecord/GameRecordClientOversea.cs @@ -3,7 +3,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient; using Snap.Hutao.ViewModel.User; -using Snap.Hutao.Web.Hoyolab.Annotation; using Snap.Hutao.Web.Hoyolab.DataSigning; using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.Avatar; using Snap.Hutao.Web.Request.Builder; @@ -13,9 +12,6 @@ using System.Net.Http; namespace Snap.Hutao.Web.Hoyolab.Takumi.GameRecord; -/// -/// Hoyoverse game record provider -/// [ConstructorGenerated(ResolveHttpClient = true)] [HttpClient(HttpClientConfiguration.XRpc3)] [PrimaryHttpMessageHandler(UseCookies = false)] @@ -25,13 +21,6 @@ internal sealed partial class GameRecordClientOversea : IGameRecordClient private readonly ILogger logger; private readonly HttpClient httpClient; - /// - /// 异步获取实时便笺 - /// - /// 用户与角色 - /// 取消令牌 - /// 实时便笺 - [ApiInformation(Cookie = CookieType.Cookie, Salt = SaltType.OSX4)] public async ValueTask> GetDailyNoteAsync(UserAndUid userAndUid, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -48,13 +37,6 @@ internal sealed partial class GameRecordClientOversea : IGameRecordClient return Response.Response.DefaultIfNull(resp); } - /// - /// 获取玩家基础信息 - /// - /// 用户与角色 - /// 取消令牌 - /// 玩家的基础信息 - [ApiInformation(Cookie = CookieType.LToken, Salt = SaltType.OSX4)] public async ValueTask> GetPlayerInfoAsync(UserAndUid userAndUid, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -71,14 +53,6 @@ internal sealed partial class GameRecordClientOversea : IGameRecordClient return Response.Response.DefaultIfNull(resp); } - /// - /// 获取玩家深渊信息 - /// - /// 用户 - /// 1:当期,2:上期 - /// 取消令牌 - /// 深渊信息 - [ApiInformation(Cookie = CookieType.Cookie, Salt = SaltType.OSX4)] public async ValueTask> GetSpiralAbyssAsync(UserAndUid userAndUid, SpiralAbyssSchedule schedule, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create() @@ -95,14 +69,6 @@ internal sealed partial class GameRecordClientOversea : IGameRecordClient return Response.Response.DefaultIfNull(resp); } - /// - /// 获取玩家角色详细信息 - /// - /// 用户与角色 - /// 玩家的基础信息 - /// 取消令牌 - /// 角色列表 - [ApiInformation(Cookie = CookieType.LToken, Salt = SaltType.OSX4)] public async ValueTask> GetCharactersAsync(UserAndUid userAndUid, PlayerInfo playerInfo, CancellationToken token = default) { HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create()