DTOs for index mostly done, doing DB models
This commit is contained in:
101
SVSim.Database/Enums/FeatureMaintenance.cs
Normal file
101
SVSim.Database/Enums/FeatureMaintenance.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
namespace SVSim.Database.Enums;
|
||||
|
||||
public enum FeatureMaintenance
|
||||
{
|
||||
ProfileMaintenance = 2001,
|
||||
MypageMaintenance,
|
||||
GiftMaintenance,
|
||||
SignupMaintenance,
|
||||
PaymentMaintenanceIOs,
|
||||
PaymentMaintenanceAndroid,
|
||||
PaymentMaintenanceDmm = 2025,
|
||||
PaymentMaintenanceSteam,
|
||||
ShopCardpackMaintenance = 2007,
|
||||
ShopBuilddeckMaintenance = 2032,
|
||||
ShopSleeveMaintenance = 2008,
|
||||
ShopSkinMaintenance = 2024,
|
||||
ShopItemMaintenance = 2037,
|
||||
AchievementMaintenance = 2009,
|
||||
MissionMaintenance,
|
||||
BpPointMaintenance,
|
||||
FreebattleMaintenance,
|
||||
RankbattleMaintenance,
|
||||
RoomBattleMaintenance,
|
||||
StoryMaintenance,
|
||||
PracticeMaintenance,
|
||||
ArenaTwopickMaintenance,
|
||||
CardMaintenance,
|
||||
DeckMaintenance,
|
||||
TutorialMaintenance,
|
||||
AccountMaintenance,
|
||||
FriendMaintenance,
|
||||
ArenaTwopickBattleMaintenance,
|
||||
RoomTwopickMaintenance = 2029,
|
||||
RoomAllMaintenance,
|
||||
RoomWatchingMaintenance,
|
||||
RoomRuleBo1 = 2038,
|
||||
RoomRuleTwoPick,
|
||||
RoomRuleTwoPickBackdraft,
|
||||
RoomRuleBo3,
|
||||
RoomRuleBo5,
|
||||
RoomRuleBo3Ban1 = 2071,
|
||||
RoomRuleBo5Ban1,
|
||||
ArenaConvention = 2043,
|
||||
FreebattleUnlimited,
|
||||
FreebattleRotation,
|
||||
RankbattleUnlimited,
|
||||
RankbattleRotation,
|
||||
RoomUnlimited,
|
||||
RoomRotation,
|
||||
Colosseum,
|
||||
ColosseumBattle,
|
||||
ColosseumRankMatchUser,
|
||||
RoomRuleTwoPickQube,
|
||||
GuildMaintenance,
|
||||
ArenaSealedMaintenance,
|
||||
ArenaSealedBattleMaintenance,
|
||||
RoomFormatHof,
|
||||
SealedDeckCode = 2059,
|
||||
SpotcardExchange,
|
||||
RoomPreRotation,
|
||||
RoomRuleTwoPickBo3,
|
||||
RoomRuleTwoPickBo5,
|
||||
FreebattlePrerotation = 2065,
|
||||
GatheringAll,
|
||||
GatheringCreate,
|
||||
BattlePass = 2070,
|
||||
RoomRuleTwoPickChaos = 2073,
|
||||
Quest = 2077,
|
||||
RoomFormatWindfall,
|
||||
DeckQrCode,
|
||||
AutoDeckCreate,
|
||||
CompetitionAll,
|
||||
CompetitionBattle,
|
||||
CompetitionRankMatchUser,
|
||||
FreebattleCrossover,
|
||||
RankbattleCrossover,
|
||||
RoomFormatCrossover,
|
||||
GatheringCrossover,
|
||||
PracticePuzzle,
|
||||
FreebattleMyrotation = 2093,
|
||||
RoomFormatMyrotation,
|
||||
GatheringMyrotation,
|
||||
BossRush,
|
||||
SecretBossBattle = 2100,
|
||||
ReplayAll = 2034,
|
||||
NewreplayAll = 2097,
|
||||
NewreplayExcludeRotation,
|
||||
NewreplayRecord,
|
||||
ChatGuild = 2101,
|
||||
ChatGathering,
|
||||
FreebattleAvatar,
|
||||
RoomFormatAvatar,
|
||||
GatheringAvatar,
|
||||
RoomRuleTwoPickCubeBackdraft,
|
||||
RoomRuleTwoPickCubeBo3,
|
||||
RoomRuleTwoPickCubeBo5,
|
||||
RoomRuleTwoPickChaosBackdraft,
|
||||
RoomRuleTwoPickChaosBo3,
|
||||
RoomRuleTwoPickChaosBo5,
|
||||
InvalidValue = 0
|
||||
}
|
||||
12
SVSim.Database/Enums/PickTwoFormat.cs
Normal file
12
SVSim.Database/Enums/PickTwoFormat.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace SVSim.Database.Enums;
|
||||
|
||||
public enum PickTwoFormat
|
||||
{
|
||||
None,
|
||||
Normal,
|
||||
Backdraft,
|
||||
Cube,
|
||||
Chaos,
|
||||
BackdraftCube,
|
||||
BackdraftChaos
|
||||
}
|
||||
10
SVSim.Database/Enums/Rarity.cs
Normal file
10
SVSim.Database/Enums/Rarity.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace SVSim.Database.Enums;
|
||||
|
||||
public enum Rarity
|
||||
{
|
||||
Unknown = 0,
|
||||
Bronze = 1,
|
||||
Silver = 2,
|
||||
Gold = 3,
|
||||
Legendary = 4
|
||||
}
|
||||
12
SVSim.Database/Models/ClassEntry.cs
Normal file
12
SVSim.Database/Models/ClassEntry.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using DCGEngine.Database.Models;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
public class ClassEntry : BaseEntity<int>
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the class.
|
||||
/// </summary>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
}
|
||||
10
SVSim.Database/Models/CollectionInfo.cs
Normal file
10
SVSim.Database/Models/CollectionInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
[Owned]
|
||||
public class CollectionInfo
|
||||
{
|
||||
public int CraftCost { get; set; }
|
||||
public int DustReward { get; set; }
|
||||
}
|
||||
8
SVSim.Database/Models/DegreeEntry.cs
Normal file
8
SVSim.Database/Models/DegreeEntry.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using DCGEngine.Database.Models;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
public class DegreeEntry : BaseEntity<int>
|
||||
{
|
||||
|
||||
}
|
||||
8
SVSim.Database/Models/EmblemEntry.cs
Normal file
8
SVSim.Database/Models/EmblemEntry.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using DCGEngine.Database.Models;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
public class EmblemEntry : BaseEntity<long>
|
||||
{
|
||||
|
||||
}
|
||||
8
SVSim.Database/Models/FormatEntry.cs
Normal file
8
SVSim.Database/Models/FormatEntry.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using DCGEngine.Database.Models;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
public class FormatEntry : BaseEntity<int>
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -1,12 +1,37 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using DCGEngine.Database.Models;
|
||||
using SVSim.Database.Enums;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
public class ShadowverseCardEntry : CardEntry
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public override long Id { get; set; }
|
||||
/// <summary>
|
||||
/// The rarity of this card.
|
||||
/// </summary>
|
||||
public Rarity Rarity { get; set; }
|
||||
|
||||
#region Owned
|
||||
|
||||
/// <summary>
|
||||
/// Info about this card in the collection, if it can be collected.
|
||||
/// </summary>
|
||||
public CollectionInfo? CollectionInfo { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Navigation Properties
|
||||
|
||||
/// <summary>
|
||||
/// The class this card belongs to, or optionally none for neutral cards.
|
||||
/// </summary>
|
||||
public ClassEntry? Class { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The set this card belongs to.
|
||||
/// </summary>
|
||||
public CardSetEntry CardSet { get; set; } = new ShadowverseCardSetEntry();
|
||||
|
||||
#endregion
|
||||
}
|
||||
8
SVSim.Database/Models/ShadowverseCardSetEntry.cs
Normal file
8
SVSim.Database/Models/ShadowverseCardSetEntry.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using DCGEngine.Database.Models;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
public class ShadowverseCardSetEntry : CardSetEntry
|
||||
{
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using DCGEngine.Database.Models;
|
||||
using SVSim.Database.Enums;
|
||||
|
||||
@@ -8,6 +9,9 @@ namespace SVSim.Database.Models;
|
||||
/// </summary>
|
||||
public class SocialAccountConnection : BaseEntity<Guid>
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public override Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of the social account.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using DCGEngine.Database.Models;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
@@ -7,6 +8,9 @@ namespace SVSim.Database.Models;
|
||||
/// </summary>
|
||||
public class Viewer : BaseEntity<ulong>
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public override ulong Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This user's name displayed in game.
|
||||
/// </summary>
|
||||
@@ -16,6 +20,18 @@ public class Viewer : BaseEntity<ulong>
|
||||
/// This user's short identifier.
|
||||
/// </summary>
|
||||
public ulong ShortUdid { get; set; }
|
||||
|
||||
public DateTime LastLogin { get; set; }
|
||||
|
||||
#region Owned
|
||||
|
||||
public ViewerInfo Info { get; set; } = new ViewerInfo();
|
||||
|
||||
public ViewerMissionData MissionData { get; set; } = new ViewerMissionData();
|
||||
|
||||
public ViewerCurrency Currency { get; set; } = new ViewerCurrency();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Navigation Properties
|
||||
|
||||
|
||||
18
SVSim.Database/Models/ViewerCurrency.cs
Normal file
18
SVSim.Database/Models/ViewerCurrency.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
[Owned]
|
||||
public class ViewerCurrency
|
||||
{
|
||||
public ulong Crystals { get; set; }
|
||||
public ulong AndroidCrystals { get; set; }
|
||||
public ulong IosCrystals { get; set; }
|
||||
public ulong SteamCrystals { get; set; }
|
||||
public ulong DmmCrystals { get; set; }
|
||||
public ulong FreeCrystals { get; set; }
|
||||
public ulong TotalCrystals { get; set; }
|
||||
public ulong LifeTotalCrystals { get; set; }
|
||||
public ulong RedEther { get; set; }
|
||||
public ulong Rupees { get; set; }
|
||||
}
|
||||
21
SVSim.Database/Models/ViewerInfo.cs
Normal file
21
SVSim.Database/Models/ViewerInfo.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
[Owned]
|
||||
public class ViewerInfo
|
||||
{
|
||||
public DateTime BirthDate { get; set; }
|
||||
public string CountryCode { get; set; } = string.Empty;
|
||||
public int MaxFriends { get; set; }
|
||||
public bool IsOfficial { get; set; }
|
||||
public bool IsOfficialMarkDisplayed { get; set; }
|
||||
|
||||
#region Navigation Properties
|
||||
|
||||
public EmblemEntry SelectedEmblem { get; set; } = new EmblemEntry();
|
||||
|
||||
public DegreeEntry SelectedDegree { get; set; } = new DegreeEntry();
|
||||
|
||||
#endregion
|
||||
}
|
||||
12
SVSim.Database/Models/ViewerMissionData.cs
Normal file
12
SVSim.Database/Models/ViewerMissionData.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SVSim.Database.Models;
|
||||
|
||||
[Owned]
|
||||
public class ViewerMissionData
|
||||
{
|
||||
public bool HasReceivedPickTwoMission { get; set; }
|
||||
public int MissionReceiveType { get; set; }
|
||||
public DateTime MissionChangeTime { get; set; }
|
||||
public int TutorialState { get; set; }
|
||||
}
|
||||
@@ -6,4 +6,5 @@ public interface IViewerRepository
|
||||
{
|
||||
Task<Models.Viewer?> GetViewerBySocialConnection(SocialAccountType accountType, ulong socialId);
|
||||
Task<Models.Viewer?> GetViewerWithSocials(ulong id);
|
||||
Task<Models.Viewer?> GetViewerByShortUdid(ulong shortUdid);
|
||||
}
|
||||
@@ -27,4 +27,10 @@ public class ViewerRepository : IViewerRepository
|
||||
return await _dbContext.Set<Models.Viewer>().AsNoTracking().Include(viewer => viewer.SocialAccountConnections)
|
||||
.FirstOrDefaultAsync(viewer => viewer.Id == id);
|
||||
}
|
||||
|
||||
public async Task<Models.Viewer?> GetViewerByShortUdid(ulong shortUdid)
|
||||
{
|
||||
return await _dbContext.Set<Models.Viewer>().AsNoTracking().Include(viewer => viewer.MissionData)
|
||||
.Include(viewer => viewer.Info).FirstOrDefaultAsync(viewer => viewer.ShortUdid == shortUdid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user