-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent user service capture scoped app db context
- Loading branch information
Showing
32 changed files
with
880 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/Snap.Hutao/Snap.Hutao/Model/Binding/LaunchGame/LaunchScheme.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Snap.Hutao.Model.Binding.LaunchGame; | ||
|
||
/// <summary> | ||
/// 服务器方案 | ||
/// </summary> | ||
/// <summary> | ||
/// 启动方案 | ||
/// </summary> | ||
public class LaunchScheme | ||
{ | ||
/// <summary> | ||
/// 构造一个新的启动方案 | ||
/// </summary> | ||
/// <param name="name">名称</param> | ||
/// <param name="channel">通道</param> | ||
/// <param name="cps">通道描述字符串</param> | ||
/// <param name="subChannel">子通道</param> | ||
public LaunchScheme(string name, string channel, string subChannel) | ||
{ | ||
Name = name; | ||
Channel = channel; | ||
SubChannel = subChannel; | ||
} | ||
|
||
/// <summary> | ||
/// 名称 | ||
/// </summary> | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// 通道 | ||
/// </summary> | ||
public string Channel { get; set; } | ||
|
||
/// <summary> | ||
/// 子通道 | ||
/// </summary> | ||
public string SubChannel { get; set; } | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Snap.Hutao/Snap.Hutao/Model/Binding/LaunchGame/SchemeType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Snap.Hutao.Model.Binding.LaunchGame; | ||
|
||
/// <summary> | ||
/// 启动类型 | ||
/// </summary> | ||
public enum SchemeType | ||
{ | ||
/// <summary> | ||
/// 国际服 | ||
/// </summary> | ||
Mihoyo, | ||
|
||
/// <summary> | ||
/// 国服官服 | ||
/// </summary> | ||
Officical, | ||
|
||
/// <summary> | ||
/// 渠道服 | ||
/// </summary> | ||
Bilibili, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
using Snap.Hutao.Core.Database; | ||
using Snap.Hutao.Model.Binding.LaunchGame; | ||
using Snap.Hutao.Web.Hoyolab; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Snap.Hutao.Model.Entity; | ||
|
||
/// <summary> | ||
/// 游戏内账号 | ||
/// </summary> | ||
[Table("game_accounts")] | ||
public class GameAccount : ISelectable | ||
{ | ||
/// <summary> | ||
/// 内部Id | ||
/// </summary> | ||
[Key] | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
public Guid InnerId { get; set; } | ||
|
||
/// <inheritdoc/> | ||
public bool IsSelected { get; set; } | ||
|
||
/// <summary> | ||
/// 对应的Uid | ||
/// </summary> | ||
public string? AttachUid { get; set; } | ||
|
||
/// <summary> | ||
/// 服务器类型 | ||
/// </summary> | ||
public SchemeType Type { get; set; } | ||
|
||
/// <summary> | ||
/// 名称 | ||
/// </summary> | ||
public string Name { get; set; } = default!; | ||
|
||
/// <summary> | ||
/// MIHOYOSDK_ADL_PROD_CN_h3123967166 | ||
/// </summary> | ||
public string MihoyoSDK { get; set; } = default!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ public static User Create(Cookie cookie) | |
{ | ||
return new() { Cookie = cookie }; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
using CommunityToolkit.Mvvm.ComponentModel; | ||
|
||
namespace Snap.Hutao.Model; | ||
|
||
/// <summary> | ||
/// 封装带有名称描述的值 | ||
/// 在绑定枚举变量时非常有用 | ||
/// </summary> | ||
/// <typeparam name="T">包含值的类型</typeparam> | ||
public class NamedValue<T> | ||
{ | ||
/// <summary> | ||
/// 构造一个新的命名的值 | ||
/// </summary> | ||
/// <param name="name">命名</param> | ||
/// <param name="value">值</param> | ||
public NamedValue(string name, T value) | ||
{ | ||
Name = name; | ||
Value = value; | ||
} | ||
|
||
/// <summary> | ||
/// 名称 | ||
/// </summary> | ||
public string Name { get; } | ||
|
||
/// <summary> | ||
/// 值 | ||
/// </summary> | ||
public T Value { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.