diff options
author | Dennis Kobert <d-kobert@web.de> | 2019-05-19 17:00:02 +0200 |
---|---|---|
committer | Dennis Kobert <d-kobert@web.de> | 2019-05-19 17:00:02 +0200 |
commit | c4d046858e0822b7c2c540ac2368b2c0e88e7a26 (patch) | |
tree | 8ff5cfd8646908784a45762a6148ebc150810160 /DSACore/Models/Network | |
parent | f89f308c525e9deebc6d2cf6416e27dfe1a299dc (diff) |
general refectoring
added 42 as dummy Token
Diffstat (limited to 'DSACore/Models/Network')
-rw-r--r-- | DSACore/Models/Network/Command.cs | 4 | ||||
-rw-r--r-- | DSACore/Models/Network/CommandResponse.cs | 7 | ||||
-rw-r--r-- | DSACore/Models/Network/Group.cs | 2 | ||||
-rw-r--r-- | DSACore/Models/Network/Token.cs | 10 | ||||
-rw-r--r-- | DSACore/Models/Network/User.cs | 7 |
5 files changed, 9 insertions, 21 deletions
diff --git a/DSACore/Models/Network/Command.cs b/DSACore/Models/Network/Command.cs index 316461e..00b00a6 100644 --- a/DSACore/Models/Network/Command.cs +++ b/DSACore/Models/Network/Command.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; namespace DSACore.Models.Network { diff --git a/DSACore/Models/Network/CommandResponse.cs b/DSACore/Models/Network/CommandResponse.cs index 7478397..c7a410a 100644 --- a/DSACore/Models/Network/CommandResponse.cs +++ b/DSACore/Models/Network/CommandResponse.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace DSACore.Models.Network { @@ -13,8 +10,8 @@ namespace DSACore.Models.Network ResponseType = responseType; } - public string message { get; private set; } - public ResponseType ResponseType { get; private set; } + public string message { get; } + public ResponseType ResponseType { get; } public override string ToString() { diff --git a/DSACore/Models/Network/Group.cs b/DSACore/Models/Network/Group.cs index 3a8ce77..efe12ee 100644 --- a/DSACore/Models/Network/Group.cs +++ b/DSACore/Models/Network/Group.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace DSACore.Models.Network { diff --git a/DSACore/Models/Network/Token.cs b/DSACore/Models/Network/Token.cs index 0021317..451cafc 100644 --- a/DSACore/Models/Network/Token.cs +++ b/DSACore/Models/Network/Token.cs @@ -1,18 +1,18 @@ using System; -using Microsoft.EntityFrameworkCore; namespace DSACore.Models.Network { public class Token { - public string Group { get; set; } - private DateTime creation = DateTime.Now; + private readonly DateTime creation = DateTime.Now; - public Token(string @group) + public Token(string group) { - Group = @group; + Group = group; } + public string Group { get; set; } + public bool IsValid() { return DateTime.Now - creation < TimeSpan.FromMinutes(1); diff --git a/DSACore/Models/Network/User.cs b/DSACore/Models/Network/User.cs index 97a9224..8b8008c 100644 --- a/DSACore/Models/Network/User.cs +++ b/DSACore/Models/Network/User.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace DSACore.Models.Network +namespace DSACore.Models.Network { public class User { |