feat: db models
This commit is contained in:
21
Models/Database/Mission.cs
Normal file
21
Models/Database/Mission.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class Mission
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public MissionCategory? MissionCategory { get; set; }
|
||||
public long MissionCategoryId { get; set; }
|
||||
public Mission? ParentMission { get; set; }
|
||||
public long ParentMissionId { get; set; }
|
||||
public int ExpReward { get; set; }
|
||||
public int ManaReward { get; set; }
|
||||
|
||||
public ICollection<Mission> ChildMissions { get; set; } = new List<Mission>();
|
||||
public ICollection<PlayerMission> PlayerMissions { get; set; } = new List<PlayerMission>();
|
||||
public ICollection<MissionItemReward> MissionItemRewards { get; set; } = new List<MissionItemReward>();
|
||||
public ICollection<MissionSkillReward> MissionSkillRewards { get; set; } = new List<MissionSkillReward>();
|
||||
public ICollection<MissionRankRule> MissionRankRules { get; set; } = new List<MissionRankRule>();
|
||||
public ICollection<RankMissionRule> RankMissionRules { get; set; } = new List<RankMissionRule>();
|
||||
}
|
||||
9
Models/Database/MissionCategory.cs
Normal file
9
Models/Database/MissionCategory.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class MissionCategory
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
public ICollection<Mission> Missions { get; set; } = new List<Mission>();
|
||||
}
|
||||
9
Models/Database/MissionItemReward.cs
Normal file
9
Models/Database/MissionItemReward.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class MissionItemReward
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long ItemId { get; set; }
|
||||
public long MissionId { get; set; }
|
||||
public required Mission Mission { get; set; }
|
||||
}
|
||||
13
Models/Database/MissionRankRule.cs
Normal file
13
Models/Database/MissionRankRule.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using GamificationService.Enums.Database;
|
||||
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class MissionRankRule
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long MissionId { get; set; }
|
||||
public Mission Mission { get; set; } = null!;
|
||||
public long RankId { get; set; }
|
||||
public Rank Rank { get; set; } = null!;
|
||||
public MissionRankRuleType Type { get; set; }
|
||||
}
|
||||
11
Models/Database/MissionSkillReward.cs
Normal file
11
Models/Database/MissionSkillReward.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class MissionSkillReward
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long MissionId { get; set; }
|
||||
public Mission Mission { get; set; } = null!;
|
||||
public long SkillId { get; set; }
|
||||
public Skill Skill { get; set; } = null!;
|
||||
public int Value { get; set; }
|
||||
}
|
||||
13
Models/Database/Player.cs
Normal file
13
Models/Database/Player.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class Player
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long UserId { get; set; }
|
||||
public Rank? Rank { get; set; }
|
||||
public long RankId {get; set; }
|
||||
public int Experience { get; set; }
|
||||
|
||||
public ICollection<PlayerMission> PlayerMissions { get; set; } = new List<PlayerMission>();
|
||||
public ICollection<PlayerSkill> PlayerSkills { get; set; } = new List<PlayerSkill>();
|
||||
}
|
||||
12
Models/Database/PlayerMission.cs
Normal file
12
Models/Database/PlayerMission.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class PlayerMission
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long PlayerId { get; set; }
|
||||
public required Player Player { get; set; }
|
||||
public long MissionId { get; set; }
|
||||
public required Mission Mission { get; set; }
|
||||
public DateTime? Completed { get; set; }
|
||||
public DateTime? RewardsRedeemed { get; set; }
|
||||
}
|
||||
11
Models/Database/PlayerSkill.cs
Normal file
11
Models/Database/PlayerSkill.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class PlayerSkill
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long PlayerId { get; set; }
|
||||
public Player Player { get; set; } = null!;
|
||||
public long SkillId { get; set; }
|
||||
public Skill Skill { get; set; } = null!;
|
||||
public int Score { get; set; }
|
||||
}
|
||||
13
Models/Database/Rank.cs
Normal file
13
Models/Database/Rank.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class Rank
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public int ExpNeeded { get; set; }
|
||||
|
||||
public ICollection<Player> Players { get; set; } = new List<Player>();
|
||||
public ICollection<MissionRankRule> MissionRankRules { get; set; } = new List<MissionRankRule>();
|
||||
public ICollection<RankMissionRule> RankMissionRules { get; set; } = new List<RankMissionRule>();
|
||||
public ICollection<RankSkillRule> RankSkillRules { get; set; } = new List<RankSkillRule>();
|
||||
}
|
||||
10
Models/Database/RankMissionRule.cs
Normal file
10
Models/Database/RankMissionRule.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class RankMissionRule
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long RankId { get; set; }
|
||||
public Rank Rank { get; set; } = null!;
|
||||
public long MissionId { get; set; }
|
||||
public Mission Mission { get; set; } = null!;
|
||||
}
|
||||
11
Models/Database/RankSkillRule.cs
Normal file
11
Models/Database/RankSkillRule.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class RankSkillRule
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long RankId { get; set; }
|
||||
public Rank Rank { get; set; } = null!;
|
||||
public long SkillId { get; set; }
|
||||
public Skill Skill { get; set; } = null!;
|
||||
public int Min { get; set; }
|
||||
}
|
||||
10
Models/Database/Skill.cs
Normal file
10
Models/Database/Skill.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace GamificationService.Models.Database;
|
||||
|
||||
public class Skill
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public ICollection<MissionSkillReward> MissionSkillRewards { get; set; } = new List<MissionSkillReward>();
|
||||
public ICollection<RankSkillRule> RankSkillRules { get; set; } = new List<RankSkillRule>();
|
||||
public ICollection<PlayerSkill> PlayerSkills { get; set; } = new List<PlayerSkill>();
|
||||
}
|
||||
Reference in New Issue
Block a user