mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
phase final
This commit is contained in:
@@ -11,12 +11,35 @@ namespace Snap.Hutao.Model.Intrinsic.Immutable;
|
|||||||
[HighQuality]
|
[HighQuality]
|
||||||
internal static class IntrinsicImmutables
|
internal static class IntrinsicImmutables
|
||||||
{
|
{
|
||||||
private static readonly ImmutableHashSet<string> associationTypes = Enum.GetValues<AssociationType>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
/// <summary>
|
||||||
private static readonly ImmutableHashSet<string> weaponTypes = Enum.GetValues<WeaponType>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
/// 所属地区
|
||||||
private static readonly ImmutableHashSet<string> itemQualities = Enum.GetValues<ItemQuality>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
/// </summary>
|
||||||
private static readonly ImmutableHashSet<string> bodyTypes = Enum.GetValues<BodyType>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
public static readonly ImmutableHashSet<string> AssociationTypes = Enum.GetValues<AssociationType>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
||||||
private static readonly ImmutableHashSet<string> fightProperties = Enum.GetValues<FightProperty>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
|
||||||
private static readonly ImmutableHashSet<string> elementNames = new HashSet<string>(7)
|
/// <summary>
|
||||||
|
/// 武器类型
|
||||||
|
/// </summary>
|
||||||
|
public static readonly ImmutableHashSet<string> WeaponTypes = Enum.GetValues<WeaponType>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物品类型
|
||||||
|
/// </summary>
|
||||||
|
public static readonly ImmutableHashSet<string> ItemQualities = Enum.GetValues<ItemQuality>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 身材类型
|
||||||
|
/// </summary>
|
||||||
|
public static readonly ImmutableHashSet<string> BodyTypes = Enum.GetValues<BodyType>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 战斗属性
|
||||||
|
/// </summary>
|
||||||
|
public static readonly ImmutableHashSet<string> FightProperties = Enum.GetValues<FightProperty>().Select(e => e.GetLocalizedDescriptionOrDefault()).OfType<string>().ToImmutableHashSet();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 元素名称
|
||||||
|
/// </summary>
|
||||||
|
public static readonly ImmutableHashSet<string> ElementNames = new HashSet<string>(7)
|
||||||
{
|
{
|
||||||
SH.ModelIntrinsicElementNameFire,
|
SH.ModelIntrinsicElementNameFire,
|
||||||
SH.ModelIntrinsicElementNameWater,
|
SH.ModelIntrinsicElementNameWater,
|
||||||
@@ -26,34 +49,4 @@ internal static class IntrinsicImmutables
|
|||||||
SH.ModelIntrinsicElementNameIce,
|
SH.ModelIntrinsicElementNameIce,
|
||||||
SH.ModelIntrinsicElementNameRock,
|
SH.ModelIntrinsicElementNameRock,
|
||||||
}.ToImmutableHashSet();
|
}.ToImmutableHashSet();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 所属地区
|
|
||||||
/// </summary>
|
|
||||||
public static ImmutableHashSet<string> AssociationTypes { get => associationTypes; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 武器类型
|
|
||||||
/// </summary>
|
|
||||||
public static ImmutableHashSet<string> WeaponTypes { get => weaponTypes; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 物品类型
|
|
||||||
/// </summary>
|
|
||||||
public static ImmutableHashSet<string> ItemQualities { get => itemQualities; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 身材类型
|
|
||||||
/// </summary>
|
|
||||||
public static ImmutableHashSet<string> BodyTypes { get => bodyTypes; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 战斗属性
|
|
||||||
/// </summary>
|
|
||||||
public static ImmutableHashSet<string> FightProperties { get => fightProperties; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 元素名称
|
|
||||||
/// </summary>
|
|
||||||
public static ImmutableHashSet<string> ElementNames { get => elementNames; }
|
|
||||||
}
|
}
|
||||||
@@ -4731,6 +4731,15 @@ namespace Snap.Hutao.Resource.Localization {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Hoyolab 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
internal static string ViewUserCookieOperation2 {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ViewUserCookieOperation2", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 网页登录 的本地化字符串。
|
/// 查找类似 网页登录 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1818,4 +1818,7 @@
|
|||||||
<data name="ViewPageLoginHoyoverseUserHint" xml:space="preserve">
|
<data name="ViewPageLoginHoyoverseUserHint" xml:space="preserve">
|
||||||
<value>请输入你的 Hoyolab Uid</value>
|
<value>请输入你的 Hoyolab Uid</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ViewUserCookieOperation2" xml:space="preserve">
|
||||||
|
<value>Hoyolab</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -31,20 +31,16 @@ internal sealed class AvatarInfoService : IAvatarInfoService
|
|||||||
/// 构造一个新的角色信息服务
|
/// 构造一个新的角色信息服务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="appDbContext">数据库上下文</param>
|
/// <param name="appDbContext">数据库上下文</param>
|
||||||
/// <param name="metadataService">元数据服务</param>
|
/// <param name="serviceProvider">服务提供器</param>
|
||||||
/// <param name="summaryFactory">简述工厂</param>
|
|
||||||
/// <param name="logger">日志器</param>
|
|
||||||
public AvatarInfoService(
|
public AvatarInfoService(
|
||||||
AppDbContext appDbContext,
|
AppDbContext appDbContext,
|
||||||
IMetadataService metadataService,
|
IServiceProvider serviceProvider)
|
||||||
ISummaryFactory summaryFactory,
|
|
||||||
ILogger<AvatarInfoService> logger)
|
|
||||||
{
|
{
|
||||||
this.metadataService = metadataService;
|
metadataService = serviceProvider.GetRequiredService<IMetadataService>();
|
||||||
this.summaryFactory = summaryFactory;
|
summaryFactory = serviceProvider.GetRequiredService<ISummaryFactory>();
|
||||||
this.logger = logger;
|
logger = serviceProvider.GetRequiredService<ILogger<AvatarInfoService>>();
|
||||||
|
|
||||||
avatarInfoDbOperation = new(appDbContext);
|
avatarInfoDbOperation = new(appDbContext, serviceProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -116,10 +116,7 @@
|
|||||||
SelectionMode="Single">
|
SelectionMode="Single">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid
|
<Grid Padding="0,12" Background="Transparent">
|
||||||
Width="200"
|
|
||||||
Padding="0,12"
|
|
||||||
Background="Transparent">
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="auto"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
@@ -204,44 +201,65 @@
|
|||||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
Text="{shcm:ResourceString Name=ViewUserDefaultDescription}"
|
Text="{shcm:ResourceString Name=ViewUserDefaultDescription}"
|
||||||
Visibility="{Binding Users.Count, Converter={StaticResource Int32ToVisibilityRevertConverter}}"/>
|
Visibility="{Binding Users.Count, Converter={StaticResource Int32ToVisibilityRevertConverter}}"/>
|
||||||
<TextBlock
|
<Grid>
|
||||||
Margin="10,6,0,6"
|
<Grid.ColumnDefinitions>
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
<ColumnDefinition/>
|
||||||
Text="{shcm:ResourceString Name=ViewUserCookieOperation}"/>
|
<ColumnDefinition/>
|
||||||
<StackPanel
|
<ColumnDefinition/>
|
||||||
Margin="0,0,6,0"
|
<ColumnDefinition/>
|
||||||
HorizontalAlignment="Right"
|
<ColumnDefinition/>
|
||||||
Orientation="Horizontal">
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
<AppBarButton
|
<AppBarButton
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
Command="{Binding RefreshCookieTokenCommand}"
|
Command="{Binding RefreshCookieTokenCommand}"
|
||||||
Icon="{shcm:FontIcon Glyph=}"
|
Icon="{shcm:FontIcon Glyph=}"
|
||||||
Label="{shcm:ResourceString Name=ViewUserCookieOperationRefreshCookieAction}"/>
|
Label="{shcm:ResourceString Name=ViewUserCookieOperationRefreshCookieAction}"/>
|
||||||
<AppBarButton
|
<AppBarSeparator Grid.RowSpan="2" Grid.Column="1"/>
|
||||||
Command="{Binding LoginMihoyoUserCommand}"
|
<TextBlock
|
||||||
Icon="{shcm:FontIcon Glyph=}"
|
Grid.Row="0"
|
||||||
Label="{shcm:ResourceString Name=ViewUserCookieOperationLoginMihoyoUserAction}"/>
|
Grid.Column="2"
|
||||||
<AppBarButton
|
Margin="4,6,0,0"
|
||||||
Command="{Binding AddUserCommand}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
Icon="{shcm:FontIcon Glyph=}"
|
Text="{shcm:ResourceString Name=ViewUserCookieOperation}"/>
|
||||||
Label="{shcm:ResourceString Name=ViewUserCookieOperationManualInputAction}"/>
|
<StackPanel
|
||||||
</StackPanel>
|
Grid.Row="1"
|
||||||
<TextBlock
|
Grid.Column="2"
|
||||||
Margin="10,6,0,6"
|
Orientation="Horizontal">
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
<AppBarButton
|
||||||
Text="HoyoVerse Account"/>
|
Command="{Binding LoginMihoyoUserCommand}"
|
||||||
<StackPanel
|
Icon="{shcm:FontIcon Glyph=}"
|
||||||
Margin="0,0,6,0"
|
Label="{shcm:ResourceString Name=ViewUserCookieOperationLoginMihoyoUserAction}"/>
|
||||||
HorizontalAlignment="Right"
|
<AppBarButton
|
||||||
Orientation="Horizontal">
|
Command="{Binding AddUserCommand}"
|
||||||
<AppBarButton
|
Icon="{shcm:FontIcon Glyph=}"
|
||||||
Command="{Binding LoginHoyoverseUserCommand}"
|
Label="{shcm:ResourceString Name=ViewUserCookieOperationManualInputAction}"/>
|
||||||
Icon="{shcm:FontIcon Glyph=}"
|
</StackPanel>
|
||||||
Label="{shcm:ResourceString Name=ViewUserCookieOperationLoginMihoyoUserAction}"/>
|
<AppBarSeparator Grid.RowSpan="2" Grid.Column="3"/>
|
||||||
<AppBarButton
|
<TextBlock
|
||||||
Command="{Binding AddOverseaUserCommand}"
|
Grid.Row="0"
|
||||||
Icon="{shcm:FontIcon Glyph=}"
|
Grid.Column="4"
|
||||||
Label="{shcm:ResourceString Name=ViewUserCookieOperationManualInputAction}"/>
|
Margin="4,6,0,0"
|
||||||
</StackPanel>
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
|
Text="{shcm:ResourceString Name=ViewUserCookieOperation2}"/>
|
||||||
|
<StackPanel
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="4"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<AppBarButton
|
||||||
|
Command="{Binding LoginHoyoverseUserCommand}"
|
||||||
|
Icon="{shcm:FontIcon Glyph=}"
|
||||||
|
Label="{shcm:ResourceString Name=ViewUserCookieOperationLoginMihoyoUserAction}"/>
|
||||||
|
<AppBarButton
|
||||||
|
Command="{Binding AddOverseaUserCommand}"
|
||||||
|
Icon="{shcm:FontIcon Glyph=}"
|
||||||
|
Label="{shcm:ResourceString Name=ViewUserCookieOperationManualInputAction}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Flyout>
|
</Flyout>
|
||||||
</Button.Flyout>
|
</Button.Flyout>
|
||||||
|
|||||||
@@ -185,17 +185,17 @@ internal static class ApiOsEndpoints
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算器家具计算
|
/// 计算器家具计算
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string CalculateOsFurnitureCompute = $"{SgPublicApi}/event/calculateos/furniture/list";
|
public const string CalculateFurnitureCompute = $"{SgPublicApi}/event/calculateos/furniture/list";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算器角色列表 size 20
|
/// 计算器角色列表 size 20
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string CalculateOsAvatarList = $"{SgPublicApi}/event/calculateos/avatar/list";
|
public const string CalculateAvatarList = $"{SgPublicApi}/event/calculateos/avatar/list";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算器武器列表 size 20
|
/// 计算器武器列表 size 20
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string CalculateOsWeaponList = $"{SgPublicApi}/event/calculateos/weapon/list";
|
public const string CalculateWeaponList = $"{SgPublicApi}/event/calculateos/weapon/list";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算器结果
|
/// 计算器结果
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
namespace Snap.Hutao.Web.Hoyolab.Passport;
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
namespace Snap.Hutao.Web.Hoyolab.Passport;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SToken 包装器
|
/// SToken 包装器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal sealed class STokenWrapper
|
internal sealed class STokenWrapper
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 构造一个新的SToken 包装器
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="stoken">stoken</param>
|
||||||
|
/// <param name="uid">uid</param>
|
||||||
public STokenWrapper(string stoken, string uid)
|
public STokenWrapper(string stoken, string uid)
|
||||||
{
|
{
|
||||||
SToken = stoken;
|
SToken = stoken;
|
||||||
|
|||||||
Reference in New Issue
Block a user