Models.cs
2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using FreeSql.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.Text.RegularExpressions;
namespace Blueprint.Net.Server
{
public class Card
{
[Column(IsIdentity = true, IsPrimary = true)] public long Id { get; set; }
public long WorkspaceId { get; set; }
public int X { get; set; }
public int Y { get; set; }
public string Label { get; set; }
public string Type { get; set; }
[Navigate(nameof(CardNodeInfo.CardId))] public List<CardNodeInfo> Nodes { get; set; } = [];
public List<string> TitleBarColor { get; set; } = [];
}
public class Link
{
[Column(IsIdentity = true, IsPrimary = true)] public long Id { get; set; }
public long WorkspaceId { get; set; }
[Navigate(nameof(SourceId))] public NodeConnectInfo Source { get; set; }
[Navigate(nameof(TargetId))] public NodeConnectInfo Target { get; set; }
public long SourceId { get; set; }
public long TargetId { get; set; }
}
public class NodeConnectInfo
{
[Column(IsIdentity = true, IsPrimary = true)] public long Id { get; set; }
public string Node { get; set; }
public int X { get; set; }
public int Y { get; set; }
public string Color { get; set; }
public string EnumType { get; set; }
}
public class CardNodeInfo
{
[Column(IsIdentity = true, IsPrimary = true)] public long Id { get; set; }
public long CardId { get; set; }
public string Type { get; set; }
public int Level { get; set; }
public string EnumType { get; set; }
public string Color { get; set; }
public int? MultiConnected { get; set; }
public string Slot { get; set; }
public string Label { get; set; }
public string Value { get; set; }
}
public class Project
{
[Column(IsIdentity = true, IsPrimary = true)] public long Id { get; set; }
public string Name { get; set; }
[Navigate(nameof(Workspace.ProjectId))] public List<Workspace> Workspaces { get; set; } = [];
}
public class Workspace
{
[Column(IsIdentity = true, IsPrimary = true)] public long Id { get; set; }
public long ProjectId { get; set; }
public string Name { get; set; }
[Navigate(nameof(Card.WorkspaceId))] public List<Card> Cards { get; set; } = [];
[Navigate(nameof(Card.WorkspaceId))] public List<Link> Links { get; set; } = [];
}
}