mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
move files
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Snap.Hutao.Core;
|
||||
using Windows.Foundation;
|
||||
|
||||
namespace Snap.Hutao.Control;
|
||||
|
||||
@@ -52,14 +52,10 @@ internal static class DependencyInjection
|
||||
|
||||
CultureInfo cultureInfo = appOptions.CurrentCulture;
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
|
||||
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
|
||||
CultureInfo.CurrentCulture = cultureInfo;
|
||||
CultureInfo.CurrentUICulture = cultureInfo;
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
|
||||
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
|
||||
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
|
||||
|
||||
ApplicationLanguages.PrimaryLanguageOverride = cultureInfo.Name;
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace Snap.Hutao.Core.Diagnostics;
|
||||
/// </summary>
|
||||
internal readonly struct ValueStopwatch
|
||||
{
|
||||
private static readonly double TimestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency;
|
||||
|
||||
private readonly long startTimestamp;
|
||||
|
||||
private ValueStopwatch(long startTimestamp)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Snap.Hutao.Model.Metadata.Avatar;
|
||||
|
||||
|
||||
@@ -128,7 +128,16 @@ internal abstract partial class DbStoreOptions : ObservableObject, IOptions<DbSt
|
||||
{
|
||||
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
string? value = appDbContext.Settings.SingleOrDefault(e => e.Key == key)?.Value;
|
||||
storage = value is null ? defaultValue : deserializer(value)!;
|
||||
if (value is null)
|
||||
{
|
||||
storage = defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
T targetValue = deserializer(value);
|
||||
ArgumentNullException.ThrowIfNull(targetValue);
|
||||
storage = targetValue;
|
||||
}
|
||||
}
|
||||
|
||||
return storage;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Web.Hoyolab.Hk4e.Event.GachaInfo;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.GachaLog;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
|
||||
namespace Snap.Hutao.Service.GachaLog.Factory;
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ using Snap.Hutao.Service.GachaLog.Factory;
|
||||
using Snap.Hutao.Service.Metadata;
|
||||
using Snap.Hutao.ViewModel.GachaLog;
|
||||
using Snap.Hutao.Web.Hoyolab.Hk4e.Event.GachaInfo;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.GachaLog;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
using Snap.Hutao.Web.Response;
|
||||
|
||||
namespace Snap.Hutao.Service.GachaLog;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.ViewModel.GachaLog;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.GachaLog;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
|
||||
namespace Snap.Hutao.Service.GachaLog;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Core;
|
||||
using Snap.Hutao.Core.ExceptionService;
|
||||
using Snap.Hutao.Service.Discord;
|
||||
using Snap.Hutao.Service.Game.Scheme;
|
||||
using Snap.Hutao.Service.Game.Unlocker;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
using Snap.Hutao.Web.Hutao.SpiralAbyss;
|
||||
using Snap.Hutao.Web.Response;
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace Snap.Hutao.Service.Metadata;
|
||||
/// </summary>
|
||||
internal static class LocaleNames
|
||||
{
|
||||
public const string CHS = "CHS"; // Chinese (Simplified)
|
||||
public const string CHT = "CHT"; // Chinese (Traditional)
|
||||
public const string DE = "DE"; // German
|
||||
public const string EN = "EN"; // English
|
||||
public const string ES = "ES"; // Spanish
|
||||
@@ -21,8 +23,6 @@ internal static class LocaleNames
|
||||
public const string TH = "TH"; // Thai
|
||||
public const string TR = "TR"; // Turkish
|
||||
public const string VI = "VI"; // Vietnamese
|
||||
public const string CHS = "CHS"; // Chinese (Simplified)
|
||||
public const string CHT = "CHT"; // Chinese (Traditional)
|
||||
|
||||
public static bool TryGetLocaleNameFromLanguageName(string languageName, [NotNullWhen(true)] out string? localeName)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ using CommunityToolkit.Common;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Snap.Hutao.Service.Notification;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
|
||||
namespace Snap.Hutao.View.Dialog;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using CommunityToolkit.Common;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Snap.Hutao.Service.Notification;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
|
||||
namespace Snap.Hutao.View.Dialog;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using CommunityToolkit.Common;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Snap.Hutao.Service.Notification;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
|
||||
namespace Snap.Hutao.View.Dialog;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using Snap.Hutao.Service.Notification;
|
||||
using Snap.Hutao.View.Dialog;
|
||||
using Snap.Hutao.Web;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
using Windows.System;
|
||||
|
||||
namespace Snap.Hutao.ViewModel.Setting;
|
||||
|
||||
@@ -8,7 +8,7 @@ using Snap.Hutao.Service.SpiralAbyss;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.ViewModel.Complex;
|
||||
using Snap.Hutao.ViewModel.User;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
using Snap.Hutao.Web.Hutao.SpiralAbyss;
|
||||
using Snap.Hutao.Web.Hutao.SpiralAbyss.Post;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient;
|
||||
using Snap.Hutao.Service.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
using Snap.Hutao.Web.Request.Builder;
|
||||
using Snap.Hutao.Web.Request.Builder.Abstraction;
|
||||
using System.Net.Http;
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Snap.Hutao.Web.Hutao.Geetest;
|
||||
|
||||
internal sealed class GeetestResponse
|
||||
{
|
||||
public static GeetestResponse InternalFailure { get; } = new() { Code = Response.Response.InternalFailure };
|
||||
public static GeetestResponse InternalFailure { get; } = new() { Code = Web.Response.Response.InternalFailure };
|
||||
|
||||
[JsonPropertyName("code")]
|
||||
public int Code { get; set; }
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient;
|
||||
using Snap.Hutao.Service.Hutao;
|
||||
using Snap.Hutao.Service.Metadata;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
using Snap.Hutao.Web.Request.Builder;
|
||||
using Snap.Hutao.Web.Request.Builder.Abstraction;
|
||||
using System.Net.Http;
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient;
|
||||
using Snap.Hutao.Service.Hutao;
|
||||
using Snap.Hutao.Web.Request.Builder;
|
||||
using Snap.Hutao.Web.Request.Builder.Abstraction;
|
||||
using Snap.Hutao.Web.Response;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Snap.Hutao.Web.Hutao;
|
||||
|
||||
@@ -27,6 +24,6 @@ internal sealed partial class HutaoInfrastructureClient
|
||||
.Get();
|
||||
|
||||
Response<IPInformation>? resp = await builder.TryCatchSendAsync<Response<IPInformation>>(httpClient, logger, token).ConfigureAwait(false);
|
||||
return Response.Response.DefaultIfNull(resp);
|
||||
return Web.Response.Response.DefaultIfNull(resp);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient;
|
||||
using Snap.Hutao.Service.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
using Snap.Hutao.Web.Request.Builder;
|
||||
using Snap.Hutao.Web.Request.Builder.Abstraction;
|
||||
using System.Net.Http;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Snap.Hutao.Web.Hutao;
|
||||
namespace Snap.Hutao.Web.Hutao.Response;
|
||||
|
||||
internal sealed class HutaoResponse : Response.Response, ILocalizableResponse
|
||||
internal sealed class HutaoResponse : Web.Response.Response, ILocalizableResponse
|
||||
{
|
||||
[JsonConstructor]
|
||||
public HutaoResponse(int returnCode, string message, string? localizationKey)
|
||||
@@ -38,7 +38,7 @@ internal sealed class HutaoResponse : Response.Response, ILocalizableResponse
|
||||
}
|
||||
|
||||
[SuppressMessage("", "SA1402")]
|
||||
internal sealed class HutaoResponse<TData> : Response.Response<TData>, ILocalizableResponse
|
||||
internal sealed class HutaoResponse<TData> : Web.Response.Response<TData>, ILocalizableResponse
|
||||
{
|
||||
[JsonConstructor]
|
||||
public HutaoResponse(int returnCode, string message, TData? data, string? localizationKey)
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Web.Hutao;
|
||||
namespace Snap.Hutao.Web.Hutao.Response;
|
||||
|
||||
internal interface ILocalizableResponse
|
||||
{
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
using System.Globalization;
|
||||
|
||||
namespace Snap.Hutao.Web.Hutao;
|
||||
namespace Snap.Hutao.Web.Hutao.Response;
|
||||
|
||||
internal static class LocalizableResponseExtension
|
||||
{
|
||||
@@ -19,7 +19,7 @@ internal static class LocalizableResponseExtension
|
||||
}
|
||||
|
||||
public static string GetLocalizationMessageOrMessage<TResponse>(this TResponse localizableResponse)
|
||||
where TResponse : Response.Response, ILocalizableResponse
|
||||
where TResponse : Web.Response.Response, ILocalizableResponse
|
||||
{
|
||||
return localizableResponse.GetLocalizationMessageOrDefault() ?? localizableResponse.Message;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using Snap.Hutao.ViewModel.User;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.Avatar;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
using Snap.Hutao.Web.Hutao.SpiralAbyss.Post;
|
||||
using Snap.Hutao.Web.Request.Builder;
|
||||
using Snap.Hutao.Web.Request.Builder.Abstraction;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Response;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
|
||||
Reference in New Issue
Block a user