Add persistence entities for lodestone
This commit is contained in:
parent
6d25611c4e
commit
33d5668bcc
29
ChaosBot/Database/Entity/LodestoneCharacters.cs
Normal file
29
ChaosBot/Database/Entity/LodestoneCharacters.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using ChaosBot.Attribute;
|
||||||
|
using ChaosBot.Lodestone;
|
||||||
|
|
||||||
|
namespace ChaosBot.Database.Entity
|
||||||
|
{
|
||||||
|
[DBEntity("LodestoneCharacter")]
|
||||||
|
public class LodestoneCharacter
|
||||||
|
{
|
||||||
|
[DBUnique]
|
||||||
|
[DBPrimaryKey]
|
||||||
|
public int id { get; }
|
||||||
|
public string name { get; }
|
||||||
|
public string avatar { get; }
|
||||||
|
|
||||||
|
public LodestoneCharacter(int id, string name, string avatar)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LodestoneCharacter(Character character)
|
||||||
|
{
|
||||||
|
this.id = (int)character.ID;
|
||||||
|
this.name = character.Name;
|
||||||
|
this.avatar = character.Avatar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
ChaosBot/Database/Entity/LodestoneFreeCompany.cs
Normal file
18
ChaosBot/Database/Entity/LodestoneFreeCompany.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using ChaosBot.Attribute;
|
||||||
|
|
||||||
|
namespace ChaosBot.Database.Entity
|
||||||
|
{
|
||||||
|
[DBEntity("LodestoneFreeCompany")]
|
||||||
|
public class LodestoneFreeCompany
|
||||||
|
{
|
||||||
|
[DBUnique]
|
||||||
|
public string id { get; }
|
||||||
|
public string name { get; }
|
||||||
|
|
||||||
|
public LodestoneFreeCompany(string id, string name)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user